diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-04-03 19:04:11 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-04-03 19:04:11 +0300 |
commit | 0c7a6aaea14d4c35a369b9bb86d6c0914bc877d1 (patch) | |
tree | 01324a017519cad8c853a9c6005a68d1946e2097 /servergreps/hercules/packets.py | |
parent | 06c188389431ae1157a169f480e9d699503b9de1 (diff) | |
download | evol-tools-0c7a6aaea14d4c35a369b9bb86d6c0914bc877d1.tar.gz evol-tools-0c7a6aaea14d4c35a369b9bb86d6c0914bc877d1.tar.bz2 evol-tools-0c7a6aaea14d4c35a369b9bb86d6c0914bc877d1.tar.xz evol-tools-0c7a6aaea14d4c35a369b9bb86d6c0914bc877d1.zip |
servergreps: add support for parsing more packet id in server.
Diffstat (limited to 'servergreps/hercules/packets.py')
-rwxr-xr-x | servergreps/hercules/packets.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/servergreps/hercules/packets.py b/servergreps/hercules/packets.py index 5eaac9a..a72beea 100755 --- a/servergreps/hercules/packets.py +++ b/servergreps/hercules/packets.py @@ -11,10 +11,10 @@ import sys filt = re.compile(".+[.]c", re.IGNORECASE) serverpacketre = re.compile("(WFIFOW|WBUFW)([ ]*)[(]([ ]*)([\w>_-]+),([ ]*)" + "(?P<offset>0)([ ]*)[)]([ ]*)=([ ]*)0x(?P<packet>[0-9a-fA-F]+)([ ]*)[;]") -#serverpacketre2 = re.compile("([.]|[-][>])PacketType([ ]*)=([ ]*)(?P<name>[\w]+);") serverpacketre2 = re.compile("PacketType([ ]*)=([ ]*)(?P<name>[\w_]+);") serverpacketre3 = re.compile("(WFIFOW|WBUFW)([ ]*)[(]([ ]*)([\w>_-]+),([ ]*)" + "(?P<offset>0)([ ]*)[)]([ ]*)=([ ]*)(?P<packet>[0-9\w]+)([ ]*)[;]") +serverpacketre4 = re.compile("int cmd([ ]*)=([ ]*)0x(?P<packet>[0-9a-fA-F]+);") protocolinre = re.compile("packet[(](?P<name>[A-Z0-9_]+),([ ]*)0x(?P<packet>[0-9a-fA-F]+),([ ]*)(?P<len>[\w-]+),([ ]*)") protocolinverre = re.compile("^// (?P<ver>[0-9]+)$") protocoloutre = re.compile("packet[(](?P<name>CMSG_[A-Z0-9_]+),([ ]*)0x(?P<packet>[0-9a-fA-F]+)[)];") @@ -52,6 +52,13 @@ def collectServerPackets(parentDir): elif filt.search(file1): with open(file2, "r") as f: for line in f: + m = serverpacketre4.findall(line) + if len(m) > 0: + for str in m: + data = str[2] + while len(data) < 4: + data = "0" + data + addServerPacket(data) m = serverpacketre.findall(line) if len(m) == 0: m = serverpacketre3.findall(line) @@ -60,6 +67,8 @@ def collectServerPackets(parentDir): if str[9] == "0": continue data = str[9] + if data == "cmd": + continue while len(data) < 4: data = "0" + data addServerPacket(data) |