diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-04-06 19:41:45 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-04-06 19:41:45 +0300 |
commit | 1ddb9fac2c36bd1c7e9dcb1f874c19878f475a49 (patch) | |
tree | 353cfa7940f81247c925f292f22224a473d907e9 | |
parent | dfce5ec0db36813fc21da69f2d26c57e2b63ed4f (diff) | |
download | evol-tools-1ddb9fac2c36bd1c7e9dcb1f874c19878f475a49.tar.gz evol-tools-1ddb9fac2c36bd1c7e9dcb1f874c19878f475a49.tar.bz2 evol-tools-1ddb9fac2c36bd1c7e9dcb1f874c19878f475a49.tar.xz evol-tools-1ddb9fac2c36bd1c7e9dcb1f874c19878f475a49.zip |
servergreps: add function for add sizes and function names into manaplus headers.
-rwxr-xr-x | servergreps/hercules/packets.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/servergreps/hercules/packets.py b/servergreps/hercules/packets.py index fd53673..0f89cc7 100755 --- a/servergreps/hercules/packets.py +++ b/servergreps/hercules/packets.py @@ -302,6 +302,28 @@ def printPackets(packetDir): # if sizes[packet] != clientPackets[packet][0]: # w.write("{0:>4} {1:4} -> {2:4}\n".format(data, sizes[packet], clientPackets[packet][0])) +#def processTempFile(path): +# with open(path + "/packetsout.inc", "r") as r: +# with open(path + "/packetsout2.inc", "w") as w: +# comaSplit = re.compile(",") +# for line in r: +# line2 = line.strip() +# if len(line2) < 10 or line.find("packet(") < 0: +# w.write(line) +# continue +# parts = comaSplit.split(line) +# packet = parts[1].strip() +# packet = packet[2:].lower() +# if packet not in clientPackets: +# w.write(line) +# continue +# parts[2] = str(clientPackets[packet][0]) +# while len(parts[2]) < 4: +# parts[2] = " " + parts[2] +# parts[3] = " " + clientPackets[packet][1] + ");\n" +# w.write(parts[0] + "," + parts[1] + "," + parts[2] + "," + parts[3]) + + def showHelp(): print("Usage: packets.py version"); exit(1) @@ -332,4 +354,5 @@ collectManaPlusOutPackets(protocolPath + "out.inc", int(packetVersion)) processManaPlusCppFiles(eathenaPath); sortClientPackets() sortServerPackets() +#processTempFile(packetDir) printPackets(packetDir) |