summaryrefslogtreecommitdiff
path: root/src/emap/atcommand.c
diff options
context:
space:
mode:
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;
}