diff --git a/OpenRA.Game/Game.cs b/OpenRA.Game/Game.cs index 1ec8a62193..a0a114a5f7 100644 --- a/OpenRA.Game/Game.cs +++ b/OpenRA.Game/Game.cs @@ -154,7 +154,7 @@ namespace OpenRA internal static void CreateServer() { // todo: LobbyInfo is the wrong place for this. - Server.Server.ServerMain(Settings.InternetServer, Settings.GameName, Settings.ListenPort, + Server.Server.ServerMain(Settings.InternetServer, Settings.MasterServer, Settings.GameName, Settings.ListenPort, Settings.ExternalPort, LobbyInfo.GlobalSettings.Mods); JoinServer(IPAddress.Loopback.ToString(), Settings.ListenPort); diff --git a/OpenRA.Game/GameRules/UserSettings.cs b/OpenRA.Game/GameRules/UserSettings.cs index 7f15e27712..b653d5eb0d 100644 --- a/OpenRA.Game/GameRules/UserSettings.cs +++ b/OpenRA.Game/GameRules/UserSettings.cs @@ -49,6 +49,7 @@ namespace OpenRA.GameRules public readonly int ListenPort = 1234; public readonly int ExternalPort = 1234; public readonly bool InternetServer = true; + public readonly string MasterServer = "http://open-ra.org/master/"; // Gameplay options // TODO: These need to die diff --git a/OpenRA.Game/Server/Server.cs b/OpenRA.Game/Server/Server.cs index f157f2210e..9cccd3e8c9 100644 --- a/OpenRA.Game/Server/Server.cs +++ b/OpenRA.Game/Server/Server.cs @@ -51,9 +51,11 @@ namespace OpenRA.Server // of leeway. static int lastPing = 0; static bool isInternetServer; + static string masterServerUrl; - public static void ServerMain(bool internetServer, string name, int port, int extport, string[] mods) + public static void ServerMain(bool internetServer, string masterServerUrl, string name, int port, int extport, string[] mods) { + Server.masterServerUrl = masterServerUrl; isInternetServer = internetServer; listener = new TcpListener(IPAddress.Any, port); initialMods = mods; @@ -561,7 +563,7 @@ namespace OpenRA.Server if (wc.IsBusy || !isInternetServer) return; wc.DownloadDataAsync(new Uri( - "http://open-ra.org/master/ping.php?port={0}&name={1}&state={2}&players={3}&mods={4}&map={5}".F( + masterServerUrl + "ping.php?port={0}&name={1}&state={2}&players={3}&mods={4}&map={5}".F( ExternalPort, Uri.EscapeUriString(Name), GameStarted ? 2 : 1, // todo: post-game states, etc. lobbyInfo.Clients.Count,