From 8e3957969f7e42d7be8ff482ada130a6854c92a0 Mon Sep 17 00:00:00 2001 From: Rossen Georgiev Date: Mon, 30 May 2016 20:37:57 +0100 Subject: [PATCH] failing to resolvw proto for EMsg.EconTrading fix #33 --- steam/core/msg.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/steam/core/msg.py b/steam/core/msg.py index eae1b25..fceead9 100644 --- a/steam/core/msg.py +++ b/steam/core/msg.py @@ -213,10 +213,16 @@ def get_cmsg(emsg): """ global cmsg_lookup, cmsg_lookup2 + if not isinstance(emsg, EMsg): + emsg = EMsg(emsg) + if emsg in cmsg_lookup_predefined: return cmsg_lookup_predefined[emsg] else: - cmsg_name = "cmsg" + str(emsg).split('.', 1)[1].lower() + enum_name = emsg.name.lower() + if enum_name.startswith("econ"): # special case for 'EconTrading_' + enum_name = enum_name[4:] + cmsg_name = "cmsg" + enum_name if not cmsg_lookup: cmsg_list = steammessages_clientserver_pb2.__dict__