Skip to content

Commit

Permalink
Prevent Windows Defender warnings in singleplayer (Bind singleplayer …
Browse files Browse the repository at this point in the history
…server to 127.0.0.1)
  • Loading branch information
rollerozxa authored and sfan5 committed Oct 27, 2023
1 parent 03ba937 commit 1a562ca
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/client/game.cpp
Expand Up @@ -1384,7 +1384,15 @@ bool Game::createSingleplayerServer(const std::string &map_dir,
{
showOverlayMessage(N_("Creating server..."), 0, 5);

std::string bind_str = g_settings->get("bind_address");
std::string bind_str;
if (simple_singleplayer_mode) {
// Make the simple singleplayer server only accept connections from localhost,
// which also makes Windows Defender not show a warning.
bind_str = "127.0.0.1";
} else {
bind_str = g_settings->get("bind_address");
}

Address bind_addr(0, 0, 0, 0, port);

if (g_settings->getBool("ipv6_server"))
Expand Down

0 comments on commit 1a562ca

Please sign in to comment.