From 0786fd274397e9883baa4da32730cf82efbd50c3 Mon Sep 17 00:00:00 2001 From: Rossen Georgiev Date: Wed, 23 Nov 2016 21:54:00 +0200 Subject: [PATCH] refactor register_product_key() --- steam/client/builtins/apps.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/steam/client/builtins/apps.py b/steam/client/builtins/apps.py index 78e4817..76a1f0a 100644 --- a/steam/client/builtins/apps.py +++ b/steam/client/builtins/apps.py @@ -186,13 +186,13 @@ class Apps(object): :param key: CD-Key :type key: :class:`str` :return: format ``(eresult, result_details, receipt_info)`` - :rtype: :class:`tuple`, :class:`None` + :rtype: :class:`tuple` Example ``receipt_info``: .. code:: python - {'MessageObject': {'BasePrice': 0, + {'BasePrice': 0, 'CurrencyCode': 0, 'ErrorHeadline': '', 'ErrorLinkText': '', @@ -210,14 +210,15 @@ class Apps(object): 'lineitems': {'0': {'ItemDescription': 'Half-Life 3', 'TransactionID': UINT_64(11111111111111111), 'packageid': 1234}}, - 'packageid': -1}} + 'packageid': -1} """ resp = self.send_job_and_wait(MsgProto(EMsg.ClientRegisterKey), {'key': key}, - timeout=20 - ) + timeout=30, + ) if resp: - details = vdf.binary_loads(resp.purchase_receipt_info) - + details = vdf.binary_loads(resp.purchase_receipt_info).get('MessageObject', None) return EResult(resp.eresult), resp.purchase_result_details, details + else: + return EResult.Timeout, None, None