summaryrefslogtreecommitdiff
path: root/servergreps/hercules/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-09-05 17:34:04 +0300
committerAndrei Karas <akaras@inbox.ru>2016-09-05 17:34:04 +0300
commit11a56ba1da1a84063f02979aef2a426b5782faa3 (patch)
tree5347fdbaaf3cba8d07a493c1551968dbf6857ea8 /servergreps/hercules/src
parentf983fe42aa7ddb24488bc020c4a1d9e6c19f6feb (diff)
downloadtools-11a56ba1da1a84063f02979aef2a426b5782faa3.tar.gz
tools-11a56ba1da1a84063f02979aef2a426b5782faa3.tar.bz2
tools-11a56ba1da1a84063f02979aef2a426b5782faa3.tar.xz
tools-11a56ba1da1a84063f02979aef2a426b5782faa3.zip
servergreps: move handling packets functions calls into each class.
Diffstat (limited to 'servergreps/hercules/src')
-rwxr-xr-xservergreps/hercules/src/hercules.py12
-rwxr-xr-xservergreps/hercules/src/manaplus.py8
2 files changed, 20 insertions, 0 deletions
diff --git a/servergreps/hercules/src/hercules.py b/servergreps/hercules/src/hercules.py
index f60a0f8..1fd99e6 100755
--- a/servergreps/hercules/src/hercules.py
+++ b/servergreps/hercules/src/hercules.py
@@ -155,3 +155,15 @@ class Hercules:
for packet in self.inPackets:
self.inPacketsSorted.append(packet)
self.inPacketsSorted.sort()
+
+
+ def processPackets(self, packetDir, packetVersion):
+ namedPacketsPath = packetDir + "/src/packets_struct.h"
+ srcPath = packetDir + "/src"
+ serverInPacketsHPath = packetDir + "/src/packets.h"
+ serverLoginInPackets = packetDir + "/src/lclif.c"
+ self.collectNamedPackets(namedPacketsPath)
+ self.collectOutPackets(srcPath)
+ self.collectInPackets(serverInPacketsHPath, serverLoginInPackets)
+ self.sortInPackets()
+ self.sortOutPackets()
diff --git a/servergreps/hercules/src/manaplus.py b/servergreps/hercules/src/manaplus.py
index 144dd3f..56fd11c 100755
--- a/servergreps/hercules/src/manaplus.py
+++ b/servergreps/hercules/src/manaplus.py
@@ -87,3 +87,11 @@ class ManaPlus:
m = self.packetOutNametre.search(line)
if m is not None:
self.manaplusUsedPacketsSet.add(m.group("name"))
+
+ def processPackets(self, packetVersion):
+ manaplusPath = "../../../manaplus/src/"
+ protocolPath = manaplusPath + "net/eathena/packets"
+ eathenaPath = manaplusPath + "net/eathena/"
+ self.collectInPackets(protocolPath + "in.inc", int(packetVersion))
+ self.collectOutPackets(protocolPath + "out.inc", int(packetVersion))
+ self.processCppFiles(eathenaPath)