From 947b93c6fee465be9b05f8b6225f170786b2e135 Mon Sep 17 00:00:00 2001 From: Rossen Georgiev Date: Fri, 25 Mar 2016 21:44:59 +0000 Subject: [PATCH] fix #23; protocol_version=65579 and gzip decomp --- steam/client/__init__.py | 2 +- steam/core/cm.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/steam/client/__init__.py b/steam/client/__init__.py index f991a58..6d42887 100644 --- a/steam/client/__init__.py +++ b/steam/client/__init__.py @@ -351,7 +351,7 @@ class SteamClient(EventEmitter, FeatureBase): message = MsgProto(EMsg.ClientLogon) message.header.steamid = SteamID(type='Individual', universe='Public') - message.body.protocol_version = 65575 + message.body.protocol_version = 65579 message.body.client_package_version = 1771 message.body.client_os_type = EOSType.Win10 message.body.client_language = "english" diff --git a/steam/core/cm.py b/steam/core/cm.py index db1cc78..0541c48 100644 --- a/steam/core/cm.py +++ b/steam/core/cm.py @@ -1,7 +1,7 @@ import struct import binascii import logging -import zipfile +from gzip import GzipFile from time import time from collections import defaultdict @@ -290,7 +290,8 @@ class CMClient(EventEmitter): if msg.body.size_unzipped: logger.debug("Unzipping body") - data = zipfile.ZipFile(BytesIO(msg.body.message_body)).read('z') + with GzipFile(fileobj=BytesIO(msg.body.message_body)) as f: + data = f.read() if len(data) != msg.body.size_unzipped: logger.fatal("Unzipped size mismatch")