Browse Source

fix steamclient logon race condition

pull/34/head
Rossen Georgiev 9 years ago
parent
commit
8989338bac
  1. 5
      steam/client/__init__.py
  2. 4
      steam/core/cm.py

5
steam/client/__init__.py

@ -34,7 +34,6 @@ class SteamClient(CMClient, FeatureBase):
self.on(None, self._handle_jobs)
self.on("disconnected", self._handle_disconnect)
self.on("reconnect", self._handle_disconnect)
self.on(EMsg.ClientLogOnResponse, self._handle_logon)
self.on(EMsg.ClientUpdateMachineAuth, self._handle_update_machine_auth)
#: indicates logged on status. Listen to ``logged_on`` when change to ``True``
@ -81,6 +80,8 @@ class SteamClient(CMClient, FeatureBase):
self.current_jobid = 0
def _handle_logon(self, msg):
CMClient._handle_logon(self, msg)
result = EResult(msg.body.eresult)
if result == EResult.OK:
@ -108,8 +109,6 @@ class SteamClient(CMClient, FeatureBase):
code_mismatch = (result == EResult.InvalidLoginAuthCode)
self.emit("auth_code_required", is_2fa, code_mismatch)
else:
self.emit("error", result)
def _handle_update_machine_auth(self, message):
ok = self.store_sentry(self.username, message.body.bytes)

4
steam/core/cm.py

@ -63,7 +63,7 @@ class CMClient(EventEmitter):
self.on(EMsg.ChannelEncryptRequest, self.__handle_encrypt_request),
self.on(EMsg.Multi, self.__handle_multi),
self.on(EMsg.ClientLogOnResponse, self.__handle_logon),
self.on(EMsg.ClientLogOnResponse, self._handle_logon),
self.on(EMsg.ClientCMList, self.__handle_cm_list),
def emit(self, event, *args):
@ -323,7 +323,7 @@ class CMClient(EventEmitter):
gevent.sleep(interval)
self.send(message)
def __handle_logon(self, msg):
def _handle_logon(self, msg):
result = msg.body.eresult
if result in (EResult.TryAnotherCM,

Loading…
Cancel
Save