allow custom masterserver URL
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user