diff --git a/steam/core/msg.py b/steam/core/msg.py index 6e60244..cefdb39 100644 --- a/steam/core/msg.py +++ b/steam/core/msg.py @@ -141,6 +141,12 @@ class Msg(object): self.body = ChannelEncryptResult(data) elif msg == EMsg.ClientLogOnResponse: self.body = ClientLogOnResponse(data) + elif msg == EMsg.ClientChatMsg: + self.body = ClientChatMsg(data) + elif msg == EMsg.ClientJoinChat: + self.body = ClientJoinChat(data) + elif msg == EMsg.ClientChatMemberInfo: + self.body = ClientChatMemberInfo(data) else: self.body = None @@ -412,6 +418,96 @@ class ClientLogOnResponse: def __str__(self): return "eresult: %s" % repr(self.eresult) +class ClientChatMsg: + steamIdChatter = 0 + steamIdChatRoom = 0 + ChatMsgType = 0 + ChatMsg = "" + + def __init__(self, data=None): + if data: + self.load(data) + + def serialize(self): + return struct.pack("QQI{}s".format(len(self.ChatMsg)), + self.steamIdChatter, + self.steamIdChatRoom, + self.ChatMsgType, + self.ChatMsg + ) + + def load(self, data): + (self.steamIdChatter, + self.steamIdChatRoom, + self.ChatMsgType, + self.ChatMsg + ) = struct.unpack_from("