summaryrefslogtreecommitdiff
path: root/src/emap/atcommand.c
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/emap/atcommand.c
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/emap/atcommand.c')
-rw-r--r--src/emap/atcommand.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/emap/atcommand.c b/src/emap/atcommand.c
index 7c3f345..1928620 100644
--- a/src/emap/atcommand.c
+++ b/src/emap/atcommand.c
@@ -23,6 +23,7 @@
#include "emap/atcommand.h"
#include "emap/lang.h"
+#include "emap/inter.h"
const char* eatcommand_msgsd_pre(struct map_session_data **sdPtr,
int *msgPtr)
@@ -132,11 +133,29 @@ ACMD2(slide)
ACMD1(mapExit)
{
+ int code = 1;
+ if (!*message || sscanf(message, "%5d", &code) < 1)
+ code = 1;
+
+ map->retval = code;
+ map->do_shutdown();
+ return true;
+}
+
+// 100 - terminate all servers
+// 101 - restart all servers
+// 102 - restart char and map servers
+// 103 - restart map server
+ACMD1(serverExit)
+{
int code = 0;
if (!*message || sscanf(message, "%5d", &code) < 1)
- code = 0;
+ return false;
+
+ send_char_exit(code);
map->retval = code;
map->do_shutdown();
+
return true;
}