summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-07-03 18:03:11 +0300
committerAndrei Karas <akaras@inbox.ru>2016-07-03 18:03:11 +0300
commitee1e885da332d6103d1228bf21fedff762f84139 (patch)
treeb1d929e1fa091d1aff18b6c94d437be9e883fb82
parent1e07ec7b4d232902530f3457e7237353a40262f6 (diff)
downloadhercules-ee1e885da332d6103d1228bf21fedff762f84139.tar.gz
hercules-ee1e885da332d6103d1228bf21fedff762f84139.tar.bz2
hercules-ee1e885da332d6103d1228bf21fedff762f84139.tar.xz
hercules-ee1e885da332d6103d1228bf21fedff762f84139.zip
Add --run-once flag into char server.
-rw-r--r--src/char/char.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/char/char.c b/src/char/char.c
index cf2f7d87c..613a3deec 100644
--- a/src/char/char.c
+++ b/src/char/char.c
@@ -5758,11 +5758,25 @@ static CMDLINEARG(netconfig)
chr->NET_CONF_NAME = aStrdup(params);
return true;
}
+
+/**
+ * --run-once handler
+ *
+ * Causes the server to run its loop once, and shutdown. Useful for testing.
+ * @see cmdline->exec
+ */
+static CMDLINEARG(runonce)
+{
+ core->runflag = CORE_ST_STOP;
+ return true;
+}
+
/**
* Initializes the command line arguments handlers.
*/
void cmdline_args_init_local(void)
{
+ CMDLINEARG_DEF2(run-once, runonce, "Closes server after loading (testing).", CMDLINE_OPT_NORMAL);
CMDLINEARG_DEF2(char-config, charconfig, "Alternative char-server configuration.", CMDLINE_OPT_PARAM);
CMDLINEARG_DEF2(inter-config, interconfig, "Alternative inter-server configuration.", CMDLINE_OPT_PARAM);
CMDLINEARG_DEF2(net-config, netconfig, "Alternative network configuration.", CMDLINE_OPT_PARAM);