From 99342322afd5736c42e29e9e6302da1d0330712d Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Fri, 5 Feb 2010 17:50:59 +1300 Subject: [PATCH] added default mod(s) support to server. --- OpenRA.Server/Server.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/OpenRA.Server/Server.cs b/OpenRA.Server/Server.cs index 8ee723288f..eb8ba243ec 100644 --- a/OpenRA.Server/Server.cs +++ b/OpenRA.Server/Server.cs @@ -17,14 +17,19 @@ namespace OpenRA.Server static TcpListener listener = new TcpListener(IPAddress.Any, 1234); static Dictionary> inFlightFrames = new Dictionary>(); - static Session lobbyInfo = new Session(); + static Session lobbyInfo; static bool GameStarted = false; + static string[] defaultMods = new string[] { "ra" }; const int DownloadChunkInterval = 20000; const int DownloadChunkSize = 16384; public static void Main(string[] args) { + if (args.Length > 0) defaultMods = args; + lobbyInfo = new Session(); + lobbyInfo.GlobalSettings.Mods = defaultMods; + listener.Start(); Console.WriteLine("Server started."); @@ -463,6 +468,7 @@ namespace OpenRA.Server Console.WriteLine("Server emptied out; doing a bit of housekeeping to prepare for next game.."); inFlightFrames.Clear(); lobbyInfo = new Session(); + lobbyInfo.GlobalSettings.Mods = defaultMods; GameStarted = false; }