From faeef00bb63623089d706c0c5b411b344d92bd9e Mon Sep 17 00:00:00 2001 From: Aki Date: Thu, 3 Feb 2022 22:57:49 +0100 Subject: Added hostname to the server configuration This is in order to avoid default lookup for local address, which usually caused the game to bind to a LAN address hence effectively disallowing any other traffic in. For now there is no option in GUI to configure the hostname. Menus definitions are in the game files, so I should avoid any changes that can cause the binary to be incompatible with currently available resource packs. --- Stars45/NetLobbyServer.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Stars45/NetLobbyServer.cpp') diff --git a/Stars45/NetLobbyServer.cpp b/Stars45/NetLobbyServer.cpp index 90ee02b..c3817c8 100644 --- a/Stars45/NetLobbyServer.cpp +++ b/Stars45/NetLobbyServer.cpp @@ -51,6 +51,7 @@ #include "StarServer.h" #include "ShipDesign.h" #include "Sim.h" +#include "Text.h" #include "ModConfig.h" #include "ModInfo.h" @@ -83,17 +84,19 @@ NetLobbyServer::NetLobbyServer() selected_mission = 0; + Text hostname = "0.0.0.0"; WORD server_port = 11100; server_config = NetServerConfig::GetInstance(); if (server_config) { + hostname = server_config->Hostname(); server_name = server_config->Name(); server_port = server_config->GetLobbyPort(); server_mission = server_config->GetMission(); NetAuth::SetAuthLevel(server_config->GetAuthLevel()); - server_addr = NetAddr(NetHost().Address().IPAddr(), server_port); + server_addr = NetAddr(hostname.data(), server_port); link = new(__FILE__,__LINE__) NetLink(server_addr); } -- cgit v1.1