From 09b99b7109475d341250971ae11941cbc46bcbca Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 9 Sep 2015 22:15:54 +0300 Subject: Change server version to 8. Send packet version to client. --- src/Makefile.am | 9 ++++++--- src/ecommon/serverversion.h | 11 +++++++++++ src/elogin/send.c | 7 +++++-- 3 files changed, 22 insertions(+), 5 deletions(-) create mode 100644 src/ecommon/serverversion.h diff --git a/src/Makefile.am b/src/Makefile.am index f17f16a..97cda9b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -8,7 +8,8 @@ CHAR_SRC = echar/char.c \ ecommon/config.c \ ecommon/config.h \ ecommon/init.c \ - ecommon/init.h + ecommon/init.h \ + ecommon/serverversion.h LOGIN_SRC = elogin/config.c \ elogin/config.h \ @@ -26,7 +27,8 @@ LOGIN_SRC = elogin/config.c \ ecommon/config.c \ ecommon/config.h \ ecommon/init.c \ - ecommon/init.h + ecommon/init.h \ + ecommon/serverversion.h MAP_SRC = emap/atcommand.c \ emap/atcommand.h \ @@ -81,7 +83,8 @@ MAP_SRC = emap/atcommand.c \ ecommon/config.c \ ecommon/config.h \ ecommon/init.c \ - ecommon/init.h + ecommon/init.h \ + ecommon/serverversion.h # need remove -Wno-unused diff --git a/src/ecommon/serverversion.h b/src/ecommon/serverversion.h new file mode 100644 index 0000000..f516515 --- /dev/null +++ b/src/ecommon/serverversion.h @@ -0,0 +1,11 @@ +// Copyright (c) Copyright (c) Hercules Dev Team, licensed under GNU GPL. +// Copyright (c) 2014 Evol developers + +#ifndef EVOL_COMMON_SERVERVERSION +#define EVOL_COMMON_SERVERVERSION + +// must be same with version from server build + +const int serverPacketVersion = 20150000; + +#endif // EVOL_COMMON_SERVERVERSION diff --git a/src/elogin/send.c b/src/elogin/send.c index 021d40f..d19dc6b 100644 --- a/src/elogin/send.c +++ b/src/elogin/send.c @@ -14,6 +14,7 @@ #include "common/strlib.h" #include "login/login.h" +#include "ecommon/serverversion.h" #include "elogin/config.h" #include "elogin/send.h" @@ -21,9 +22,11 @@ void send_server_version(int fd) { WFIFOHEAD(fd, 4 + 8); WFIFOW(fd, 0) = 0x7531; - WFIFOW(fd, 2) = 4 + 8; + WFIFOW(fd, 2) = 16; WFIFOL(fd, 4) = 0; // unused - WFIFOL(fd, 8) = 7; // server version + WFIFOL(fd, 8) = 8; // plugin version + WFIFOL(fd, 12) = serverPacketVersion; // server packet version + WFIFOSET(fd, WFIFOW(fd,2)); } -- cgit v1.2.3-70-g09d2