diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-09-05 18:52:54 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-09-05 18:52:54 +0300 |
commit | 865c8e4bbf765e56852ec1aa74e7d9f7d8db63f5 (patch) | |
tree | a57e1c9e2bf68f3616bb92d39ee590b0b190d69d /servergreps/hercules/src/hercules.py | |
parent | 4b91c24b2aee5d7bd6d14c8b688f1078cfcce3b9 (diff) | |
download | evol-tools-865c8e4bbf765e56852ec1aa74e7d9f7d8db63f5.tar.gz evol-tools-865c8e4bbf765e56852ec1aa74e7d9f7d8db63f5.tar.bz2 evol-tools-865c8e4bbf765e56852ec1aa74e7d9f7d8db63f5.tar.xz evol-tools-865c8e4bbf765e56852ec1aa74e7d9f7d8db63f5.zip |
servergreps: move all header manipulation code into python script.
Diffstat (limited to 'servergreps/hercules/src/hercules.py')
-rwxr-xr-x | servergreps/hercules/src/hercules.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/servergreps/hercules/src/hercules.py b/servergreps/hercules/src/hercules.py index ad82b4e..b910929 100755 --- a/servergreps/hercules/src/hercules.py +++ b/servergreps/hercules/src/hercules.py @@ -7,6 +7,8 @@ import os import re +from src.preproc import PreProc + filt = re.compile(".+[.](c|h)", re.IGNORECASE) class Hercules: @@ -167,3 +169,20 @@ class Hercules: self.collectInPackets(serverInPacketsHPath, serverLoginInPackets) self.sortInPackets() self.sortOutPackets() + + + def prepareTempFiles(self, codeDir, packetDir, packetVersion): + proc = PreProc() + proc.init(packetDir + "/src/hercules") + 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.run("map", "packets_struct.h"); + proc.run("char", "char.c"); + proc.run("login", "login.c"); + proc.run("map", "clif.c"); + proc.run("login", "lclif.p.h"); + proc.run("login", "lclif.c"); + proc.defines = "-DPACKETVER=" + packetVersion + " -Dpacket\\(id,size,...\\)=packet\\(id,size,__VA_ARGS__\\)" + proc.run("map", "packets.h"); |