diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile.am | 4 | ||||
-rw-r--r-- | src/login/init.c | 4 | ||||
-rw-r--r-- | src/login/parse.c | 29 | ||||
-rw-r--r-- | src/login/parse.h | 9 |
4 files changed, 45 insertions, 1 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index 4295fe5..8ef119e 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,7 +2,9 @@ AUTOMAKE_OPTIONS = subdir-objects CHAR_SRC = char/init.c -LOGIN_SRC = login/init.c +LOGIN_SRC = login/init.c \ + login/parse.c \ + login/parse.h MAP_SRC = map/dummy.c \ map/dummy.h \ diff --git a/src/login/init.c b/src/login/init.c index e729ac8..7ccea44 100644 --- a/src/login/init.c +++ b/src/login/init.c @@ -12,6 +12,8 @@ #include "../../../common/strlib.h" #include "../../../login/login.h" +#include "login/parse.h" + #include "../../../common/HPMDataCheck.h" /* should always be the last file included! (if you don't make it last, it'll intentionally break compile time) */ HPExport struct hplugin_info pinfo = @@ -26,6 +28,8 @@ HPExport struct hplugin_info pinfo = HPExport void plugin_init (void) { /* core interfaces */ iMalloc = GET_SYMBOL("iMalloc"); + + addPacket(0x7530, 22, login_parse_version, hpParse_Login); } HPExport void server_preinit (void) { diff --git a/src/login/parse.c b/src/login/parse.c new file mode 100644 index 0000000..b50f52e --- /dev/null +++ b/src/login/parse.c @@ -0,0 +1,29 @@ +// Copyright (c) Copyright (c) Hercules Dev Team, licensed under GNU GPL. +// Copyright (c) 2014 Evol developers + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#include "../../../common/HPMi.h" +#include "../../../common/malloc.h" +#include "../../../common/mmo.h" +#include "../../../common/socket.h" +#include "../../../common/strlib.h" +#include "../../../login/login.h" + +#include "login/parse.h" + +void login_parse_version(int fd) +{ + struct login_session_data* sd = (struct login_session_data*)session[fd]->session_data; + if (!sd) + return; + + WFIFOHEAD(fd, 4 + 8); + WFIFOW(fd, 0) = 0x7531; + WFIFOW(fd, 2) = 4 + 8; + WFIFOL(fd, 4) = 0; // unused + WFIFOL(fd, 8) = 1; // server version + WFIFOSET(fd, WFIFOW(fd,2)); +} diff --git a/src/login/parse.h b/src/login/parse.h new file mode 100644 index 0000000..8595bd1 --- /dev/null +++ b/src/login/parse.h @@ -0,0 +1,9 @@ +// Copyright (c) Copyright (c) Hercules Dev Team, licensed under GNU GPL. +// Copyright (c) 2014 Evol developers + +#ifndef EVOL_LOGIN_PARSE +#define EVOL_LOGIN_PARSE + +void login_parse_version(int fd); + +#endif // EVOL_LOGIN_PARSE |