summaryrefslogtreecommitdiff
path: root/src/login
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-07-03 17:56:41 +0300
committerAndrei Karas <akaras@inbox.ru>2016-07-03 17:56:41 +0300
commit1e07ec7b4d232902530f3457e7237353a40262f6 (patch)
tree636f73feb6b1d975251ca7eb0b22f50adf9717f1 /src/login
parentc96e3c44f59333378adb87d155884b1bea1a25d0 (diff)
downloadhercules-1e07ec7b4d232902530f3457e7237353a40262f6.tar.gz
hercules-1e07ec7b4d232902530f3457e7237353a40262f6.tar.bz2
hercules-1e07ec7b4d232902530f3457e7237353a40262f6.tar.xz
hercules-1e07ec7b4d232902530f3457e7237353a40262f6.zip
Add --run-once flag into login server.
Diffstat (limited to 'src/login')
-rw-r--r--src/login/login.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/login/login.c b/src/login/login.c
index d7c7321d8..49508d564 100644
--- a/src/login/login.c
+++ b/src/login/login.c
@@ -1671,6 +1671,19 @@ static CMDLINEARG(loginconfig)
login->LOGIN_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;
+}
+
/**
* --net-config handler
*
@@ -1688,6 +1701,7 @@ static CMDLINEARG(netconfig)
*/
void cmdline_args_init_local(void)
{
+ CMDLINEARG_DEF2(run-once, runonce, "Closes server after loading (testing).", CMDLINE_OPT_NORMAL);
CMDLINEARG_DEF2(login-config, loginconfig, "Alternative login-server configuration.", CMDLINE_OPT_PARAM);
CMDLINEARG_DEF2(net-config, netconfig, "Alternative subnet configuration.", CMDLINE_OPT_PARAM);
}