killed InProcServer class; use ListenPort, ExternalPort, and GameName settings from settings.ini

This commit is contained in:
Chris Forbes
2010-03-13 12:46:19 +13:00
parent 8b80ae006a
commit be547479ce
3 changed files with 11 additions and 19 deletions

View File

@@ -156,13 +156,12 @@ namespace OpenRA
internal static void CreateServer() internal static void CreateServer()
{ {
// todo: LobbyInfo is the wrong place for this. // todo: LobbyInfo is the wrong place for this.
InprocServer.Start(Game.LobbyInfo.GlobalSettings.Mods); var mods = LobbyInfo.GlobalSettings.Mods;
JoinServer(IPAddress.Loopback.ToString(), 1234); var gameName = "{0} ({1})".F( Settings.GameName, string.Join( ",", mods ) );
}
Server.Server.ServerMain(gameName, Settings.ListenPort,
internal static void CloseServer() Settings.ExternalPort, mods);
{ JoinServer(IPAddress.Loopback.ToString(), Settings.ListenPort);
InprocServer.Stop();
} }
static int lastTime = Environment.TickCount; static int lastTime = Environment.TickCount;

View File

@@ -44,6 +44,10 @@ namespace OpenRA.GameRules
public readonly string Replay = ""; public readonly string Replay = "";
public readonly string PlayerName = ""; public readonly string PlayerName = "";
public readonly string[] InitialMods = { "ra" }; public readonly string[] InitialMods = { "ra" };
public readonly string GameName = "OpenRA Game";
public readonly int ListenPort = 1234;
public readonly int ExternalPort = 1234;
// Gameplay options // Gameplay options
// TODO: These need to die // TODO: These need to die

View File

@@ -26,8 +26,8 @@ using System.Linq;
using System.Net; using System.Net;
using System.Net.Sockets; using System.Net.Sockets;
using System.Security.Cryptography; using System.Security.Cryptography;
using OpenRA.FileFormats;
using System.Threading; using System.Threading;
using OpenRA.FileFormats;
namespace OpenRA.Server namespace OpenRA.Server
{ {
@@ -566,15 +566,4 @@ namespace OpenRA.Server
lastPing = Environment.TickCount; lastPing = Environment.TickCount;
} }
} }
// temporary threaded inproc server wrapper.
public static class InprocServer
{
public static void Start( string[] mods )
{
Server.ServerMain( "OpenRA Server", 1234, 1234, mods );
}
public static void Stop() { }
}
} }