aboutsummaryrefslogtreecommitdiff
path: root/src/script/lua_api
diff options
context:
space:
mode:
authorLoïc Blot <nerzhul@users.noreply.github.com>2017-04-15 23:19:18 +0200
committerGitHub <noreply@github.com>2017-04-15 23:19:18 +0200
commit34d32ce55ae4f3f29d7b645075dc8efacb2c96d2 (patch)
tree6e21a37780352412b853fd242b6177eff2afd0fd /src/script/lua_api
parent0f955bf7fa7a1376acdbc06a617c0f15f9fad467 (diff)
downloadminetest-34d32ce55ae4f3f29d7b645075dc8efacb2c96d2.tar.gz
minetest-34d32ce55ae4f3f29d7b645075dc8efacb2c96d2.tar.bz2
minetest-34d32ce55ae4f3f29d7b645075dc8efacb2c96d2.zip
Implement delayed server shutdown with cancelation (#4664)
Diffstat (limited to 'src/script/lua_api')
-rw-r--r--src/script/lua_api/l_server.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/script/lua_api/l_server.cpp b/src/script/lua_api/l_server.cpp
index b6d44e0ff..343d11b7e 100644
--- a/src/script/lua_api/l_server.cpp
+++ b/src/script/lua_api/l_server.cpp
@@ -33,7 +33,8 @@ int ModApiServer::l_request_shutdown(lua_State *L)
NO_MAP_LOCK_REQUIRED;
const char *msg = lua_tolstring(L, 1, NULL);
bool reconnect = lua_toboolean(L, 2);
- getServer(L)->requestShutdown(msg ? msg : "", reconnect);
+ float seconds_before_shutdown = lua_tonumber(L, 3);
+ getServer(L)->requestShutdown(msg ? msg : "", reconnect, seconds_before_shutdown);
return 0;
}