killed InProcServer class; use ListenPort, ExternalPort, and GameName settings from settings.ini
This commit is contained in:
@@ -156,13 +156,12 @@ namespace OpenRA
|
||||
internal static void CreateServer()
|
||||
{
|
||||
// todo: LobbyInfo is the wrong place for this.
|
||||
InprocServer.Start(Game.LobbyInfo.GlobalSettings.Mods);
|
||||
JoinServer(IPAddress.Loopback.ToString(), 1234);
|
||||
}
|
||||
var mods = LobbyInfo.GlobalSettings.Mods;
|
||||
var gameName = "{0} ({1})".F( Settings.GameName, string.Join( ",", mods ) );
|
||||
|
||||
internal static void CloseServer()
|
||||
{
|
||||
InprocServer.Stop();
|
||||
Server.Server.ServerMain(gameName, Settings.ListenPort,
|
||||
Settings.ExternalPort, mods);
|
||||
JoinServer(IPAddress.Loopback.ToString(), Settings.ListenPort);
|
||||
}
|
||||
|
||||
static int lastTime = Environment.TickCount;
|
||||
|
||||
@@ -45,6 +45,10 @@ namespace OpenRA.GameRules
|
||||
public readonly string PlayerName = "";
|
||||
public readonly string[] InitialMods = { "ra" };
|
||||
|
||||
public readonly string GameName = "OpenRA Game";
|
||||
public readonly int ListenPort = 1234;
|
||||
public readonly int ExternalPort = 1234;
|
||||
|
||||
// Gameplay options
|
||||
// TODO: These need to die
|
||||
public readonly bool RepairRequiresConyard = true;
|
||||
|
||||
@@ -26,8 +26,8 @@ using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using System.Security.Cryptography;
|
||||
using OpenRA.FileFormats;
|
||||
using System.Threading;
|
||||
using OpenRA.FileFormats;
|
||||
|
||||
namespace OpenRA.Server
|
||||
{
|
||||
@@ -566,15 +566,4 @@ namespace OpenRA.Server
|
||||
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() { }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user