diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-09-05 19:00:20 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-09-05 19:07:21 +0300 |
commit | d4136a89129d2043f6dab714465f63bf2350dbb1 (patch) | |
tree | 2408e5d17674c1a6add5feaff0ff0b4698095e53 /servergreps/hercules | |
parent | 865c8e4bbf765e56852ec1aa74e7d9f7d8db63f5 (diff) | |
download | evol-tools-d4136a89129d2043f6dab714465f63bf2350dbb1.tar.gz evol-tools-d4136a89129d2043f6dab714465f63bf2350dbb1.tar.bz2 evol-tools-d4136a89129d2043f6dab714465f63bf2350dbb1.tar.xz evol-tools-d4136a89129d2043f6dab714465f63bf2350dbb1.zip |
servergreps: in hercules class set dir name configurable.
Diffstat (limited to 'servergreps/hercules')
-rwxr-xr-x | servergreps/hercules/packets.py | 2 | ||||
-rwxr-xr-x | servergreps/hercules/src/hercules.py | 12 | ||||
-rwxr-xr-x | servergreps/hercules/src/reporter.py | 4 |
3 files changed, 10 insertions, 8 deletions
diff --git a/servergreps/hercules/packets.py b/servergreps/hercules/packets.py index ea3ee56..49368ba 100755 --- a/servergreps/hercules/packets.py +++ b/servergreps/hercules/packets.py @@ -24,6 +24,8 @@ packetDir = sys.argv[2] packetVersion = sys.argv[3] hercules = Hercules() +hercules.dirName = "hercules" +hercules.reportName = "hercules" manaplus = ManaPlus() reporter = Reporter() reporter.packetDir = packetDir; diff --git a/servergreps/hercules/src/hercules.py b/servergreps/hercules/src/hercules.py index b910929..ee84a9f 100755 --- a/servergreps/hercules/src/hercules.py +++ b/servergreps/hercules/src/hercules.py @@ -160,10 +160,10 @@ class Hercules: def processPackets(self, packetDir, packetVersion): - namedPacketsPath = packetDir + "/src/hercules/packets_struct.h" - srcPath = packetDir + "/src/hercules" - serverInPacketsHPath = packetDir + "/src/hercules/packets.h" - serverLoginInPackets = packetDir + "/src/hercules/lclif.c" + namedPacketsPath = packetDir + "/src/" + self.dirName + "/packets_struct.h" + srcPath = packetDir + "/src/" + self.dirName + serverInPacketsHPath = packetDir + "/src/" + self.dirName + "/packets.h" + serverLoginInPackets = packetDir + "/src/" + self.dirName + "/lclif.c" self.collectNamedPackets(namedPacketsPath) self.collectOutPackets(srcPath) self.collectInPackets(serverInPacketsHPath, serverLoginInPackets) @@ -173,11 +173,11 @@ class Hercules: def prepareTempFiles(self, codeDir, packetDir, packetVersion): proc = PreProc() - proc.init(packetDir + "/src/hercules") + proc.init(packetDir + "/src/" + self.dirName) proc.defines = "-DPACKETVER=" + packetVersion + " -DCOMMON_SOCKET_H -DWFIFOW\\(fd,pos\\)=WFIFOW\\(fd,pos\\) -DWBUFW\\(p,pos\\)=WBUFW\\(p,pos\\)" proc.includes = "-I../links/" + codeDir + "/src -I../links/" + codeDir + "/3rdparty" proc.inDir = "../links/" + codeDir + "/src/" - proc.outDir = packetDir + "/src/hercules/" + proc.outDir = packetDir + "/src/" + self.dirName + "/" proc.run("map", "packets_struct.h"); proc.run("char", "char.c"); proc.run("login", "login.c"); diff --git a/servergreps/hercules/src/reporter.py b/servergreps/hercules/src/reporter.py index 535887e..fedb23a 100755 --- a/servergreps/hercules/src/reporter.py +++ b/servergreps/hercules/src/reporter.py @@ -6,7 +6,7 @@ class Reporter: def reportManaplus(self, hercules, manaplus): - with open(self.packetDir + "/hercules_outpackets.txt", "w") as w: + with open(self.packetDir + "/" + hercules.reportName + "_outpackets.txt", "w") as w: for packet in hercules.outPacketsSorted: data = packet while data[0] == "0": @@ -181,7 +181,7 @@ class Reporter: def reportHercules(self, hercules): - with open(self.packetDir + "/hercules_issues.txt", "w") as w: + with open(self.packetDir + "/" + hercules.reportName + "_issues.txt", "w") as w: for name in hercules.functionToId: packet = hercules.functionToId[name] if name != hercules.inPackets[packet][1]: |