summaryrefslogtreecommitdiff
path: root/src/elogin
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-08-10 01:03:32 +0300
committerAndrei Karas <akaras@inbox.ru>2016-08-10 01:03:32 +0300
commitcb10231838c918dbf380899a947599331818a4bc (patch)
tree7f92446dd65643a81d7ddf0419ff1c4c60be73be /src/elogin
parent725fb53014ab7d48d43d69f0c1ca21354ef8619c (diff)
downloadevol-hercules-cb10231838c918dbf380899a947599331818a4bc.tar.gz
evol-hercules-cb10231838c918dbf380899a947599331818a4bc.tar.bz2
evol-hercules-cb10231838c918dbf380899a947599331818a4bc.tar.xz
evol-hercules-cb10231838c918dbf380899a947599331818a4bc.zip
Add gm command for send restart events to all servers.
For now it support only one char and one map server. For support this actions need use hercules wrapper.
Diffstat (limited to 'src/elogin')
-rw-r--r--src/elogin/init.c1
-rw-r--r--src/elogin/parse.c17
-rw-r--r--src/elogin/parse.h1
3 files changed, 19 insertions, 0 deletions
diff --git a/src/elogin/init.c b/src/elogin/init.c
index af725a0..c3d3fb7 100644
--- a/src/elogin/init.c
+++ b/src/elogin/init.c
@@ -46,6 +46,7 @@ HPExport void plugin_init (void)
addPacket(0x7530, 22, login_parse_version, hpParse_Login);
addPacket(0x027c, 91, elogin_parse_client_login2, hpParse_Login);
addPacket(0x5000, 54, elogin_parse_change_paassword, hpParse_FromChar);
+ addPacket(0x5003, 4, elogin_parse_serverexit, hpParse_FromChar);
addHookPre(login, client_login, elogin_client_login_pre);
addHookPre(login, check_password, elogin_check_password_pre);
diff --git a/src/elogin/parse.c b/src/elogin/parse.c
index d9e644e..78b59c2 100644
--- a/src/elogin/parse.c
+++ b/src/elogin/parse.c
@@ -214,3 +214,20 @@ void elogin_parse_change_paassword(int fd)
}
send_char_password_change_ack(fd, accountId, status);
}
+
+void elogin_parse_serverexit(int fd)
+{
+ const int code = RFIFOW(fd, 2);
+ switch (code)
+ {
+ case 100: // all exit
+ case 101: // all restart
+ core->shutdown_callback();
+ break;
+ case 102: // restart char and map server
+ case 103: // restart map server
+ break;
+ default:
+ ShowWarning("Unknown termination code: %d\n", code);
+ }
+}
diff --git a/src/elogin/parse.h b/src/elogin/parse.h
index 07d2a3d..824a355 100644
--- a/src/elogin/parse.h
+++ b/src/elogin/parse.h
@@ -14,5 +14,6 @@ void elogin_parse_client_login2(int fd);
enum parsefunc_rcode elogin_parse_ping_pre(int *fd,
struct login_session_data **sdPtr);
void elogin_parse_change_paassword(int fd);
+void elogin_parse_serverexit(int fd);
#endif // EVOL_LOGIN_PARSE