summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-04-05 20:02:10 +0300
committerAndrei Karas <akaras@inbox.ru>2016-04-05 20:02:10 +0300
commitac54e8261d7707ff5b7f98dc2817b329cf6d275f (patch)
tree43102bb7e13cbae55b00cfb201fa9cdf735d5244
parentec73aec8c5610edb01d89bd6d92c3f31108c2b72 (diff)
downloadevol-tools-ac54e8261d7707ff5b7f98dc2817b329cf6d275f.tar.gz
evol-tools-ac54e8261d7707ff5b7f98dc2817b329cf6d275f.tar.bz2
evol-tools-ac54e8261d7707ff5b7f98dc2817b329cf6d275f.tar.xz
evol-tools-ac54e8261d7707ff5b7f98dc2817b329cf6d275f.zip
servergreps: parse with preprocessor also .c files.
-rwxr-xr-xservergreps/hercules/packets.py3
-rwxr-xr-xservergreps/hercules/update.sh22
2 files changed, 23 insertions, 2 deletions
diff --git a/servergreps/hercules/packets.py b/servergreps/hercules/packets.py
index d654490..559a1c7 100755
--- a/servergreps/hercules/packets.py
+++ b/servergreps/hercules/packets.py
@@ -258,7 +258,8 @@ packetDir = packetVersion
while len(packetDir) < 8:
packetDir = "0" + packetDir
-srcPath = "../../../server-code/src/"
+#srcPath = "../../../server-code/src/"
+srcPath = packetDir + "/src"
namedPacketsPath = packetDir + "/src/packets_struct.h"
manaplusPath = "../../../manaplus/src/"
protocolPath = manaplusPath + "net/eathena/packets"
diff --git a/servergreps/hercules/update.sh b/servergreps/hercules/update.sh
index 925e84a..6e48f25 100755
--- a/servergreps/hercules/update.sh
+++ b/servergreps/hercules/update.sh
@@ -1,14 +1,34 @@
#!/bin/bash
+function preproc {
+ cpp -DPACKETVER=$2 \
+ -DCOMMON_SOCKET_H \
+ "-DWFIFOW(fd,pos)=WFIFOW(fd,pos)" \
+ "-DWBUFW(p,pos)=WBUFW(p,pos)" \
+ -I../../../server-code/src -I../../../server-code/3rdparty \
+ ../../../server-code/src/$3/$4 \
+ $1/src/$4
+}
+
function genpackets {
+ if [ ! -d "$1/src" ]; then
+ mkdir -p "$1/src"
+ fi
cpp -DPACKETVER=$2 "-Dpacket(id,size,...)=packet(id,size,__VA_ARGS__)" ../../../server-code/src/map/packets.h $1/src/packets.h
- cpp -DPACKETVER=$2 -I../../../server-code/src ../../../server-code/src/map/packets_struct.h $1/src/packets_struct.h
+ preproc $1 $2 map packets_struct.h
+ preproc $1 $2 char char.c
+ preproc $1 $2 login login.c
+ preproc $1 $2 map clif.c
./packets.py $2
}
+genpackets 00000000 0
genpackets 00000007 7
+genpackets 20120700 20120700
genpackets 20130000 20130000
+genpackets 20130221 20130221
genpackets 20140000 20140000
+genpackets 20140403 20140403
genpackets 20141016 20141016
genpackets 20141022 20141022
genpackets 20150226 20150226