From 767651124af900cf341f29ba52fcd9295583cc4d Mon Sep 17 00:00:00 2001 From: Benau Date: Sun, 30 Sep 2018 01:08:46 +0800 Subject: [PATCH] Always specify --server-password so that empty password can disable private server --- src/states_screens/online/create_server_screen.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/states_screens/online/create_server_screen.cpp b/src/states_screens/online/create_server_screen.cpp index b58257476..61e64f408 100644 --- a/src/states_screens/online/create_server_screen.cpp +++ b/src/states_screens/online/create_server_screen.cpp @@ -258,9 +258,9 @@ void CreateServerScreen::createServer() return; } + const bool private_server = !password.empty(); ServerConfig::m_private_server_password = password; - if (!password.empty()) - password = std::string(" --server-password=") + password; + password = std::string(" --server-password=") + password; TransportAddress server_address(0x7f000001, stk_config->m_server_discovery_port); @@ -268,7 +268,7 @@ void CreateServerScreen::createServer() auto server = std::make_shared(0/*server_id*/, name, max_players, /*current_player*/0, (RaceManager::Difficulty) difficulty_widget->getSelection(PLAYER_ID_GAME_MASTER), - 0, server_address, !password.empty(), false); + 0, server_address, private_server, false); #undef USE_GRAPHICS_SERVER #ifdef USE_GRAPHICS_SERVER