diff --git a/steam/core/msg.py b/steam/core/msg.py index 5afafa6..90ce482 100644 --- a/steam/core/msg.py +++ b/steam/core/msg.py @@ -1,128 +1,71 @@ -from importlib import import_module -import re -import struct import fnmatch -from steam.enums import EResult, EUniverse +from steam.core.msg_unified import get_um +from steam.core.msg_structs import get_struct +from steam.core.msg_headers import MsgHdr, ExtendedMsgHdr, MsgHdrProtoBuf, GCMsgHdr, GCMsgHdrProto from steam.enums.emsg import EMsg from steam.protobufs import steammessages_base_pb2 from steam.protobufs import steammessages_clientserver_pb2 from steam.protobufs import steammessages_clientserver_2_pb2 -from steam.protobufs import gc_pb2 -from steam.util import set_proto_bit, clear_proto_bit -class MsgHdr: - _size = struct.calcsize(" 8: - self.challenge = data[8:] - - def __str__(self): - return '\n'.join(["protocolVersion: %s" % self.protocolVersion, - "universe: %s" % repr(self.universe), - "challenge: %s" % repr(self.challenge), - ]) - - -class ChannelEncryptResponse: - protocolVersion = 1 - keySize = 128 - key = '' - crc = 0 - - def __init__(self, data=None): - if data: - self.load(data) - - def serialize(self): - return struct.pack(" 8: + self.challenge = data[8:] + + def __str__(self): + return '\n'.join(["protocolVersion: %s" % self.protocolVersion, + "universe: %s" % repr(self.universe), + "challenge: %s" % repr(self.challenge), + ]) + +class ChannelEncryptResponse(StructMessage): + protocolVersion = 1 + keySize = 128 + key = '' + crc = 0 + + def __init__(self, data=None): + if data: + self.load(data) + + def serialize(self): + return struct.pack("