summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-01-05 18:59:42 +0300
committerAndrei Karas <akaras@inbox.ru>2018-01-05 21:23:59 +0300
commita49ea3708ce03d82b759c0d01d29aca6c5b3cc00 (patch)
treecd51a65f204ba78277226342bb53bf0f420deeb2
parent60e318493b2fc59306cc5e6b2bf9390ca98777f3 (diff)
downloadplugin-a49ea3708ce03d82b759c0d01d29aca6c5b3cc00.tar.gz
plugin-a49ea3708ce03d82b759c0d01d29aca6c5b3cc00.tar.bz2
plugin-a49ea3708ce03d82b759c0d01d29aca6c5b3cc00.tar.xz
plugin-a49ea3708ce03d82b759c0d01d29aca6c5b3cc00.zip
Add packet types flag into version packet (0x7531).s20180116
Current support flags: 1 - for RE packets. 2 - for Zero packets.
-rw-r--r--src/Makefile.am3
-rw-r--r--src/elogin/send.c15
2 files changed, 14 insertions, 4 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 86cd2a1..4c47003 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -135,7 +135,8 @@ MAP_SRC = emap/atcommand.c \
# need remove -Wno-unused
SHARED_CFLAGS = ${CFLAGS} -O3 -pipe -ffast-math -std=c99 -Wall -Wextra -Wno-sign-compare -Wno-unused -fno-omit-frame-pointer \
- -DPCRE_SUPPORT -I../../.. -I../../../../3rdparty -DPACKETVER=20150513 \
+ -DPCRE_SUPPORT -I../../.. -I../../../../3rdparty \
+ -DPACKETVER=20150513 \
-DevolPacketOffset=0
SHARED_LDFLAGS = -avoid-version -Wl,--no-undefined
diff --git a/src/elogin/send.c b/src/elogin/send.c
index f91cd84..8324ebe 100644
--- a/src/elogin/send.c
+++ b/src/elogin/send.c
@@ -20,13 +20,22 @@
void send_server_version(int fd)
{
- WFIFOHEAD(fd, 4 + 8);
+ const int sz = 20;
+ WFIFOHEAD(fd, sz);
WFIFOW(fd, 0) = 0x7531;
- WFIFOW(fd, 2) = 18;
+ WFIFOW(fd, 2) = sz;
WFIFOL(fd, 4) = 0; // unused
- WFIFOL(fd, 8) = 19; // plugin version
+ WFIFOL(fd, 8) = 20; // plugin version
WFIFOL(fd, 12) = serverPacketVersion; // server packet version
WFIFOW(fd, 16) = evolPacketOffset; // packet id offset
+ int flags = 0;
+#ifdef PACKETVER_RE
+ flag |= 1;
+#endif
+#ifdef PACKETVER_ZERO
+ flag |= 2;
+#endif
+ WFIFOW(fd, 18) = flags;
WFIFOSET(fd, WFIFOW(fd,2));
}