summaryrefslogtreecommitdiff
path: root/servergreps/hercules
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-04-19 14:30:10 +0300
committerAndrei Karas <akaras@inbox.ru>2016-04-19 14:31:48 +0300
commit3e5ab5de17dc8d215f7ed653cdf9eb954113025a (patch)
tree4f0d70cc0ddbf99d3372ca9ce8e11f16e3f1e351 /servergreps/hercules
parenta3a1410376877d7d30d206ba3cba44a6e07679c6 (diff)
downloadevol-tools-3e5ab5de17dc8d215f7ed653cdf9eb954113025a.tar.gz
evol-tools-3e5ab5de17dc8d215f7ed653cdf9eb954113025a.tar.bz2
evol-tools-3e5ab5de17dc8d215f7ed653cdf9eb954113025a.tar.xz
evol-tools-3e5ab5de17dc8d215f7ed653cdf9eb954113025a.zip
servergreps: add parsing for new login packets format
Diffstat (limited to 'servergreps/hercules')
-rwxr-xr-xservergreps/hercules/packets.py11
-rwxr-xr-xservergreps/hercules/update.sh1
2 files changed, 11 insertions, 1 deletions
diff --git a/servergreps/hercules/packets.py b/servergreps/hercules/packets.py
index 85e4b43..34c91dd 100755
--- a/servergreps/hercules/packets.py
+++ b/servergreps/hercules/packets.py
@@ -8,13 +8,14 @@ import os
import re
import sys
-filt = re.compile(".+[.]c", re.IGNORECASE)
+filt = re.compile(".+[.](c|h)", 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_]+);")
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]+);")
+serverpacketre5 = re.compile("([ ]*)PACKET_ID_(?P<name>[A-Z_]+)([ ]*)=([ ]*)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]+),([ ]*)(?P<len>[\w-]+),([ ]*)(?P<function>[0-9a-zA-Z_>-]+)[)];")
@@ -61,6 +62,14 @@ def collectServerPackets(parentDir):
while len(data) < 4:
data = "0" + data
addServerPacket(data)
+ m = serverpacketre5.findall(line)
+ if len(m) > 0:
+ for str in m:
+ # here we ignoring str[1] or "name" for packet name
+ data = str[4]
+ while len(data) < 4:
+ data = "0" + data
+ addServerPacket(data)
m = serverpacketre.findall(line)
if len(m) == 0:
m = serverpacketre3.findall(line)
diff --git a/servergreps/hercules/update.sh b/servergreps/hercules/update.sh
index c6608b4..c15c479 100755
--- a/servergreps/hercules/update.sh
+++ b/servergreps/hercules/update.sh
@@ -19,6 +19,7 @@ function genpackets {
preproc $1 $2 char char.c
preproc $1 $2 login login.c
preproc $1 $2 map clif.c
+ preproc $1 $2 login lclif.p.h
./packets.py $2
}