summaryrefslogtreecommitdiff
path: root/src/elogin
diff options
context:
space:
mode:
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