From ee1e885da332d6103d1228bf21fedff762f84139 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 3 Jul 2016 18:03:11 +0300 Subject: Add --run-once flag into char server. --- src/char/char.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src') 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); -- cgit v1.2.3-60-g2f50