Fix ask_reconnect_on_crash option being ignored
authororwell96 <mono96.mml@gmail.com>
Fri, 11 Mar 2016 17:41:56 +0000 (18:41 +0100)
committerest31 <MTest31@outlook.com>
Fri, 11 Mar 2016 22:43:37 +0000 (23:43 +0100)
Since commit

3b50b2766aeb09c9fc0ad0ea07426bb2187df3d7 "Optional reconnect functionality"

there is a config option named ask_reconnect_on_crash.
It asks the client to reconnect to the server if the server crashed.
It has been implemeted and works, but due to a function parameter not
being passed it never showed effect. This patch adds the parameter
and fixes the bug.

Also fixes the `reconnect` option of minetest.request_shutdown being ignored.

src/server.cpp

index 75ca7448f1eacd774badc16bb2d6ead9e8b35a1b..2fa8c4cf8512f9f95a86d42259042eed0e0dfaae 100644 (file)
@@ -2568,7 +2568,7 @@ void Server::DenyAccessVerCompliant(u16 peer_id, u16 proto_ver, AccessDeniedCode
                const std::string &str_reason, bool reconnect)
 {
        if (proto_ver >= 25) {
-               SendAccessDenied(peer_id, reason, str_reason);
+               SendAccessDenied(peer_id, reason, str_reason, reconnect);
        } else {
                std::wstring wreason = utf8_to_wide(
                        reason == SERVER_ACCESSDENIED_CUSTOM_STRING ? str_reason :