Beispiel #1
0
    def _actions_after_main_loop(self):
        LOG.debug("WorldConnection: session ended.")
        if self.account and self.session_cipher:
            AccountSessionManager.delete_session(self.account)
        if self.player:
            self.unset_player()

        with self.server.world_connections_lock:
            self.server.world_connections.remove(self)
Beispiel #2
0
    def _actions_after_main_loop(self):
        LOG.debug("WorldConnection: session ended.")
        if self.account and self.session_cipher:
            AccountSessionManager.delete_session(self.account)
        if self.player:
            self.unset_player()

        with self.server.world_connections_lock:
            self.server.world_connections.remove(self)
Beispiel #3
0
    def start(self):
        LOG.info("Starting login server")
        self._start_listen()

        simple_thread(self._accept_realms)
        self._accept_clients()

        self.shutdown_flag.set()
        self._stop_listen()
        AccountSessionManager.delete_all_sessions()
        LOG.info("Login server stopped.")
Beispiel #4
0
    def start(self):
        LOG.info("Starting login server")
        self._start_listen()

        simple_thread(self._accept_realms)
        self._accept_clients()

        self.shutdown_flag.set()
        self._stop_listen()
        AccountSessionManager.delete_all_sessions()
        LOG.info("Login server stopped.")
Beispiel #5
0
    def _generate_local_proof(self):
        account_name = self.conn.account.name
        session = AccountSessionManager.get_session(account_name)
        if session is None:
            LOG.warning("Reconnection proof: account wasn't logged in!")
            return

        challenge = self.conn.recon_challenge
        to_hash = ( account_name.encode("ascii") + self.proof_data +
                    challenge + session.session_key_as_bytes )
        self.local_proof = sha1(to_hash)
Beispiel #6
0
    def _generate_local_proof(self):
        account_name = self.conn.account.name
        session = AccountSessionManager.get_session(account_name)
        if session is None:
            LOG.warning("Reconnection proof: account wasn't logged in!")
            return

        challenge = self.conn.recon_challenge
        to_hash = (account_name.encode("ascii") + self.proof_data + challenge +
                   session.session_key_as_bytes)
        self.local_proof = sha1(to_hash)
Beispiel #7
0
 def _process_reconnection(self):
     session = AccountSessionManager.get_session(self.account_name)
     if session is not None:
         LOG.debug("Reconnection: account was logged in.")
         self.conn.account = ReconChallenge._get_session_account(session)
         self.conn.recon_challenge = os.urandom(16)
         response = self._get_success_response()
         return LoginConnectionState.RECON_CHALL, response
     else:
         LOG.warning("Reconnection: account wasn't logged in!")
         response = self._get_failure_response()
         return LoginConnectionState.CLOSED, response
Beispiel #8
0
 def _process_reconnection(self):
     session = AccountSessionManager.get_session(self.account_name)
     if session is not None:
         LOG.debug("Reconnection: account was logged in.")
         self.conn.account = ReconChallenge._get_session_account(session)
         self.conn.recon_challenge = os.urandom(16)
         response = self._get_success_response()
         return LoginConnectionState.RECON_CHALL, response
     else:
         LOG.warning("Reconnection: account wasn't logged in!")
         response = self._get_failure_response()
         return LoginConnectionState.CLOSED, response
Beispiel #9
0
 def _load_session_key(self):
     session = AccountSessionManager.get_session(self.account_name)
     if session is not None:
         self.conn.account = AuthSessionHandler._get_session_account(
             session)
         self.session_key = session.session_key_as_bytes
Beispiel #10
0
 def _load_session_key(self):
     session = AccountSessionManager.get_session(self.account_name)
     if session is not None:
         self.conn.account = AuthSessionHandler._get_session_account(session)
         self.session_key = session.session_key_as_bytes
Beispiel #11
0
 def accept_account_login(self, account, session_key):
     """ Accept the account login in the active sessions table. """
     AccountSessionManager.add_session(account, session_key)
Beispiel #12
0
 def accept_account_login(self, account, session_key):
     """ Accept the account login in the active sessions table. """
     AccountSessionManager.add_session(account, session_key)