allow custom masterserver URL

This commit is contained in:
Chris Forbes
2010-03-15 15:49:42 +13:00
parent fd23407792
commit 845bbf0f39
3 changed files with 6 additions and 3 deletions

View File

@@ -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,