Add setting to disable confirmation on new player registration (#8102)
authorMuhammad Rifqi Priyo Susanto <muhammadrifqipriyosusanto@gmail.com>
Sat, 26 Jan 2019 19:26:37 +0000 (02:26 +0700)
committerParamat <paramat@users.noreply.github.com>
Sat, 26 Jan 2019 19:26:37 +0000 (19:26 +0000)
builtin/settingtypes.txt
src/defaultsettings.cpp
src/network/clientpackethandler.cpp

index 40c249e718e6eef5d1af094fdf1722588e4d7655..aea1d8a5e48aae455ef3ee68b57d0ed4372aca1f 100644 (file)
@@ -912,6 +912,10 @@ serverlist_file (Serverlist file) string favoriteservers.txt
 #    0 to disable queueing and -1 to make the queue size unlimited.
 max_out_chat_queue_size (Maximum size of the out chat queue) int 20
 
+#    Enable register confirmation when connecting to server.
+#    If disabled, new account will be registered automatically.
+enable_register_confirmation (Enable register confirmation) bool true
+
 [*Advanced]
 
 #    Timeout for client to remove unused map data from memory.
index daa0159278497679fafbd7ab38e355cf4baff11f..64231c74cfdb5e3aae0a59593ee58e8a016f6256 100644 (file)
@@ -60,6 +60,7 @@ void set_default_settings(Settings *settings)
        settings->setDefault("enable_client_modding", "false");
        settings->setDefault("max_out_chat_queue_size", "20");
        settings->setDefault("pause_on_lost_focus", "false");
+       settings->setDefault("enable_register_confirmation", "true");
 
        // Keymap
        settings->setDefault("remote_port", "30000");
index 6c0b770faab97fc0b2bd400492fe977759cb7076..909d336ae8cac32b08be5988278663171f16e01e 100644 (file)
@@ -98,7 +98,8 @@ void Client::handleCommand_Hello(NetworkPacket* pkt)
        // Authenticate using that method, or abort if there wasn't any method found
        if (chosen_auth_mechanism != AUTH_MECHANISM_NONE) {
                if (chosen_auth_mechanism == AUTH_MECHANISM_FIRST_SRP
-                               && !m_simple_singleplayer_mode) {
+                               && !m_simple_singleplayer_mode
+                               && g_settings->getBool("enable_register_confirmation")) {
                        promptConfirmRegistration(chosen_auth_mechanism);
                } else {
                        startAuth(chosen_auth_mechanism);