summaryrefslogtreecommitdiff
path: root/src/emap/console.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/emap/console.c')
-rw-r--r--src/emap/console.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/emap/console.c b/src/emap/console.c
new file mode 100644
index 0000000..80dbab3
--- /dev/null
+++ b/src/emap/console.c
@@ -0,0 +1,31 @@
+// Copyright (c) Copyright (c) Hercules Dev Team, licensed under GNU GPL.
+// Copyright (c) 2014 - 2015 Evol developers
+
+#include "common/hercules.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "common/HPMi.h"
+#include "common/memmgr.h"
+#include "common/socket.h"
+#include "map/map.h"
+
+#include "emap/console.h"
+#include "emap/inter.h"
+
+CPCMD(serverExit)
+{
+ int code = 0;
+ if (!line || !*line || sscanf(line, "%5d", &code) < 1)
+ {
+ ShowError("Wrong parameter\n");
+ return;
+ }
+
+ send_char_exit(code);
+
+ map->retval = code;
+ map->do_shutdown();
+}