From e7ce9aa263bb2accc1623cf57e14a13a6e9fb3d5 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Tue, 26 Dec 2017 14:09:24 +0000 Subject: [PATCH] Unhardcode server ping/query URLs. --- OpenRA.Mods.Common/ServerTraits/MasterServerPinger.cs | 4 ++-- OpenRA.Mods.Common/WebServices.cs | 3 ++- OpenRA.Mods.Common/Widgets/Logic/MultiplayerLogic.cs | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/OpenRA.Mods.Common/ServerTraits/MasterServerPinger.cs b/OpenRA.Mods.Common/ServerTraits/MasterServerPinger.cs index f498d11395..cdd63913a6 100644 --- a/OpenRA.Mods.Common/ServerTraits/MasterServerPinger.cs +++ b/OpenRA.Mods.Common/ServerTraits/MasterServerPinger.cs @@ -108,11 +108,11 @@ namespace OpenRA.Mods.Common.Server { try { - var serverList = server.ModData.Manifest.Get().ServerList; + var endpoint = server.ModData.Manifest.Get().ServerAdvertise; using (var wc = new WebClient()) { wc.Proxy = null; - var masterResponseText = wc.UploadString(serverList + "ping", postData); + var masterResponseText = wc.UploadString(endpoint, postData); if (isInitialPing) { diff --git a/OpenRA.Mods.Common/WebServices.cs b/OpenRA.Mods.Common/WebServices.cs index f26075a3fc..4e90e51f91 100644 --- a/OpenRA.Mods.Common/WebServices.cs +++ b/OpenRA.Mods.Common/WebServices.cs @@ -15,7 +15,8 @@ namespace OpenRA { public class WebServices : IGlobalModData { - public readonly string ServerList = "http://master.openra.net/"; + public readonly string ServerList = "http://master.openra.net/games"; + public readonly string ServerAdvertise = "http://master.openra.net/ping"; public readonly string MapRepository = "http://resource.openra.net/map/"; public readonly string GameNews = "http://master.openra.net/gamenews"; } diff --git a/OpenRA.Mods.Common/Widgets/Logic/MultiplayerLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/MultiplayerLogic.cs index 1f893f733c..2d2866ced1 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/MultiplayerLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/MultiplayerLogic.cs @@ -348,7 +348,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic Game.RunAfterTick(() => RefreshServerListInner(games)); }; - var queryURL = services.ServerList + "games?protocol={0}&engine={1}&mod={2}&version={3}".F( + var queryURL = services.ServerList + "?protocol={0}&engine={1}&mod={2}&version={3}".F( GameServer.ProtocolVersion, Uri.EscapeUriString(Game.EngineVersion), Uri.EscapeUriString(Game.ModData.Manifest.Id),