summaryrefslogtreecommitdiff
path: root/servergreps
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-04-19 19:51:35 +0300
committerAndrei Karas <akaras@inbox.ru>2016-04-19 19:51:35 +0300
commit9a266e594a138884bd4f2dad8552a384eb5b17f1 (patch)
treecf6feac1211a960869e062bdd30f8e29b912ba5c /servergreps
parentc8b494048c86c3f4eeab05f0738d4c7b5a98ed6e (diff)
downloadevol-tools-9a266e594a138884bd4f2dad8552a384eb5b17f1.tar.gz
evol-tools-9a266e594a138884bd4f2dad8552a384eb5b17f1.tar.bz2
evol-tools-9a266e594a138884bd4f2dad8552a384eb5b17f1.tar.xz
evol-tools-9a266e594a138884bd4f2dad8552a384eb5b17f1.zip
servergreps: add detection for lost packet in older versions.
Diffstat (limited to 'servergreps')
-rwxr-xr-xservergreps/hercules/packets.py58
1 files changed, 31 insertions, 27 deletions
diff --git a/servergreps/hercules/packets.py b/servergreps/hercules/packets.py
index 35ddc02..f1bfa9f 100755
--- a/servergreps/hercules/packets.py
+++ b/servergreps/hercules/packets.py
@@ -359,34 +359,38 @@ def printPackets(packetDir):
rev = []
with open(packetDir + "/clientpreferredpackets.txt", "w") as w:
- for name in outMsgNameToId:
- packet = outMsgNameToId[name]
- if packet in clientPackets:
- packet1 = clientPacketsManaPlusClient[packet]
- packet2 = clientPackets[packet]
- if packet1[0] != name:
- # skip if same id used for other packet already
- continue
- if packet1[2] in serverFunctionToId:
- data = serverFunctionToId[packet1[2]]
- if packet1[2] == packet2[1] and serverFunctionToId[packet1[2]] != packet:
- rev.append("{0:4} -> {1:4} {2:33} {3}".format(packet,
- data,
- packet1[0],
- packet1[2]))
- else:
- data = "unknown"
- if packet1[2] == packet2[1] and serverFunctionToId[packet1[2]] != packet:
- rev.append("{0:4} -> {1:4} {2:33} {3}".format(packet,
- data,
- packet1[0],
+ with open(packetDir + "/clientbadpackets.txt", "a+") as w2:
+ for name in outMsgNameToId:
+ packet = outMsgNameToId[name]
+ if packet in clientPackets:
+ packet1 = clientPacketsManaPlusClient[packet]
+ packet2 = clientPackets[packet]
+ if packet1[0] != name:
+ # skip if same id used for other packet already
+ #print("{0}, {1}, {2}, {3}".format(name, packet, packet1, packet2))
+ w2.write("{0:4} {1:33} hidden by {2}\n".format(packet,
+ name,
packet1[2]))
-
- rev.sort()
-
- for data in rev:
- w.write(data)
- w.write("\n")
+ continue
+ if packet1[2] in serverFunctionToId:
+ data = serverFunctionToId[packet1[2]]
+ if packet1[2] == packet2[1] and serverFunctionToId[packet1[2]] != packet:
+ rev.append("{0:4} -> {1:4} {2:33} {3}".format(packet,
+ data,
+ packet1[0],
+ packet1[2]))
+ else:
+ data = "unknown"
+ if packet1[2] == packet2[1] and serverFunctionToId[packet1[2]] != packet:
+ rev.append("{0:4} -> {1:4} {2:33} {3}".format(packet,
+ data,
+ packet1[0],
+ packet1[2]))
+
+ rev.sort()
+ for data in rev:
+ w.write(data)
+ w.write("\n")
def showHelp():
print("Usage: packets.py version");