From 5523d2f9e4a72dce8f03bf41347a59f79aa71e63 Mon Sep 17 00:00:00 2001 From: Rossen Georgiev Date: Fri, 10 Jun 2016 06:00:32 +0100 Subject: [PATCH] SteamClient: added 'new_login_key' event --- steam/client/__init__.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/steam/client/__init__.py b/steam/client/__init__.py index c208512..50bfe6f 100644 --- a/steam/client/__init__.py +++ b/steam/client/__init__.py @@ -11,6 +11,7 @@ Events | ``error`` - after login failure | ``auth_code_required`` - either email code or 2FA code is needed for login | ``logged_on`` - after successful login, client can send messages + | ``new_login_key`` - after new login key has been received and acknowledged | :class:`EMsg ` - all messages are emitted with their ``EMsg`` @@ -182,10 +183,14 @@ class SteamClient(CMClient, BuiltinBase): self.emit("auth_code_required", is_2fa, code_mismatch) def _handle_login_key(self, message): - self.login_key = message.body.login_key resp = MsgProto(EMsg.ClientNewLoginKeyAccepted) resp.body.unique_id = message.body.unique_id - self.send(resp) + + if self.logged_on: + self.send(resp) + gevent.idle() + self.login_key = message.body.login_key + self.emit("new_login_key") def _handle_update_machine_auth(self, message): ok = self.store_sentry(self.username, message.body.bytes)