From 3b50b2766aeb09c9fc0ad0ea07426bb2187df3d7 Mon Sep 17 00:00:00 2001 From: est31 Date: Fri, 17 Jul 2015 16:40:41 +0200 Subject: Optional reconnect functionality Enable the server to request the client to reconnect. This can be done with the now extended minetest.request_shutdown([reason], [reconnect]) setting. --- src/script/lua_api/l_server.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/script/lua_api/l_server.cpp') diff --git a/src/script/lua_api/l_server.cpp b/src/script/lua_api/l_server.cpp index 558cc0885..96c0327df 100644 --- a/src/script/lua_api/l_server.cpp +++ b/src/script/lua_api/l_server.cpp @@ -30,7 +30,9 @@ with this program; if not, write to the Free Software Foundation, Inc., // request_shutdown() int ModApiServer::l_request_shutdown(lua_State *L) { - getServer(L)->requestShutdown(); + const char *msg = lua_tolstring(L, 1, NULL); + bool reconnect = lua_toboolean(L, 2); + getServer(L)->requestShutdown(msg ? msg : "", reconnect); return 0; } -- cgit v1.2.3