summaryrefslogtreecommitdiff
path: root/servergreps
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
parentf983fe42aa7ddb24488bc020c4a1d9e6c19f6feb (diff)
downloadevol-tools-11a56ba1da1a84063f02979aef2a426b5782faa3.tar.gz
evol-tools-11a56ba1da1a84063f02979aef2a426b5782faa3.tar.bz2
evol-tools-11a56ba1da1a84063f02979aef2a426b5782faa3.tar.xz
evol-tools-11a56ba1da1a84063f02979aef2a426b5782faa3.zip
servergreps: move handling packets functions calls into each class.
Diffstat (limited to 'servergreps')
-rwxr-xr-xservergreps/hercules/packets.py19
-rwxr-xr-xservergreps/hercules/src/hercules.py12
-rwxr-xr-xservergreps/hercules/src/manaplus.py8
3 files changed, 22 insertions, 17 deletions
diff --git a/servergreps/hercules/packets.py b/servergreps/hercules/packets.py
index 62ce954..b5fea2c 100755
--- a/servergreps/hercules/packets.py
+++ b/servergreps/hercules/packets.py
@@ -29,22 +29,7 @@ manaplus = ManaPlus()
reporter = Reporter()
reporter.packetDir = packetDir;
-srcPath = packetDir + "/src"
-namedPacketsPath = packetDir + "/src/packets_struct.h"
-manaplusPath = "../../../manaplus/src/"
-protocolPath = manaplusPath + "net/eathena/packets"
-serverInPacketsHPath = packetDir + "/src/packets.h"
-serverLoginInPackets = packetDir + "/src/lclif.c"
-packetsPath = manaplusPath + "net/eathena/packetsin.inc"
-eathenaPath = manaplusPath + "net/eathena/"
-
-hercules.collectNamedPackets(namedPacketsPath)
-hercules.collectOutPackets(srcPath)
-hercules.collectInPackets(serverInPacketsHPath, serverLoginInPackets)
-manaplus.collectInPackets(protocolPath + "in.inc", int(packetVersion))
-manaplus.collectOutPackets(protocolPath + "out.inc", int(packetVersion))
-manaplus.processCppFiles(eathenaPath)
-hercules.sortInPackets()
-hercules.sortOutPackets()
+hercules.processPackets(packetDir, packetVersion)
+manaplus.processPackets(packetVersion);
reporter.reportManaplus(hercules, manaplus)
reporter.reportHercules(hercules)
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)