From 86e40475822792c26ed9fb7a2ee2cc10fe484585 Mon Sep 17 00:00:00 2001 From: Rossen Georgiev Date: Wed, 16 Nov 2016 22:37:02 +0200 Subject: [PATCH] StructReader improvements * added read() to get raw bytes * renamed read_format() to unpack() * added parameter in read_cstring() to specify terminator --- docs/api/steam.util.rst | 16 ++++++++-------- steam/core/msg/structs.py | 12 ++++++------ steam/util/binary.py | 23 +++++++++++++++++------ 3 files changed, 31 insertions(+), 20 deletions(-) diff --git a/docs/api/steam.util.rst b/docs/api/steam.util.rst index a2585f3..759d9cb 100644 --- a/docs/api/steam.util.rst +++ b/docs/api/steam.util.rst @@ -6,6 +6,14 @@ util :undoc-members: :show-inheritance: +util.binary +----------- + +.. automodule:: steam.util.binary + :members: + :undoc-members: + :show-inheritance: + util.throttle ------------- @@ -21,11 +29,3 @@ util.web :members: :undoc-members: :show-inheritance: - -util.binary ------------ - -.. automodule:: steam.util.binary - :members: - :undoc-members: - :show-inheritance: diff --git a/steam/core/msg/structs.py b/steam/core/msg/structs.py index 9a88655..9322fb8 100644 --- a/steam/core/msg/structs.py +++ b/steam/core/msg/structs.py @@ -139,13 +139,13 @@ class ClientVACBanStatus(StructMessage): def load(self, data): buf = StructReader(data) - numBans, = buf.read_format(" m.end: m.start, m.end = m.end, m.start @@ -181,7 +181,7 @@ class ClientChatMsg(StructMessage): def load(self, data): buf = StructReader(data) - self.steamIdChatter, self.steamIdChatRoom, self.ChatMsgType = buf.read_format("