summaryrefslogtreecommitdiff
path: root/servergreps/hercules/src/idathena.py
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-09-25 01:03:18 +0300
committerAndrei Karas <akaras@inbox.ru>2016-09-25 01:15:07 +0300
commitae2e0dfd1009e66bd970048a0fc9806998f6b6fc (patch)
tree074805dd8ef35489a4850b3f4bf4fbb9ac6a6867 /servergreps/hercules/src/idathena.py
parent8ab1170b13cf499e07ff1e29c7cd9bb7525d6684 (diff)
downloadtools-ae2e0dfd1009e66bd970048a0fc9806998f6b6fc.tar.gz
tools-ae2e0dfd1009e66bd970048a0fc9806998f6b6fc.tar.bz2
tools-ae2e0dfd1009e66bd970048a0fc9806998f6b6fc.tar.xz
tools-ae2e0dfd1009e66bd970048a0fc9806998f6b6fc.zip
servergreps: add parsing packets_db.txt for eAthena forks.
Diffstat (limited to 'servergreps/hercules/src/idathena.py')
-rwxr-xr-xservergreps/hercules/src/idathena.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/servergreps/hercules/src/idathena.py b/servergreps/hercules/src/idathena.py
index 07b04b9..80fb944 100755
--- a/servergreps/hercules/src/idathena.py
+++ b/servergreps/hercules/src/idathena.py
@@ -7,6 +7,7 @@
import os
import re
+from src.packetdb import PacketDb
from src.preproc import PreProc
from src.utils import Utils
@@ -21,6 +22,7 @@ class Idathena:
functionToId = dict()
loginPacketNameToId = dict()
getLenPackets = set()
+ knownLenPackets = dict()
namedPacketre = re.compile(
"((\t|[ ])*)(?P<name>[\w0-9_]+)([ ]*)=" +
@@ -154,17 +156,18 @@ class Idathena:
self.inPacketsSorted.sort()
- def processPackets(self, packetDir, packetVersion):
+ def processPackets(self, codeDir, packetDir, packetVersion):
# namedPacketsPath = packetDir + "/src/" + self.dirName + "/packets_struct.h"
srcPath = packetDir + "/src/" + self.dirName
+ packetsDbPath = "../links/" + codeDir + "/db/packet_db.txt"
# serverInPacketsHPath = packetDir + "/src/" + self.dirName + "/packets.h"
# serverLoginInPackets = packetDir + "/src/" + self.dirName + "/lclif.c"
# serverCharPackets = packetDir + "/src/" + self.dirName + "/char.c"
# self.collectNamedPackets(namedPacketsPath)
self.collectOutPackets(srcPath)
-# self.collectInPackets(serverInPacketsHPath, serverLoginInPackets)
+ PacketDb.getInPackets(packetsDbPath, packetVersion, self)
# self.collectCharInPackets(serverCharPackets);
-# self.sortInPackets()
+ self.sortInPackets()
self.sortOutPackets()