server picks random seed for world.SharedRandom

This commit is contained in:
Chris Forbes
2010-03-19 20:52:03 +13:00
parent 4dac5c0755
commit 47822a9612
3 changed files with 8 additions and 0 deletions

View File

@@ -43,6 +43,7 @@ namespace OpenRA.Server
static string Name;
static WebClient wc = new WebClient();
static int ExternalPort;
static int randomSeed;
const int DownloadChunkInterval = 20000;
const int DownloadChunkSize = 16384;
@@ -61,9 +62,11 @@ namespace OpenRA.Server
initialMods = mods;
Name = name;
ExternalPort = extport;
randomSeed = (int)DateTime.Now.ToBinary();
lobbyInfo = new Session();
lobbyInfo.GlobalSettings.Mods = mods;
lobbyInfo.GlobalSettings.RandomSeed = randomSeed;
Console.WriteLine("Initial mods: ");
foreach( var m in lobbyInfo.GlobalSettings.Mods )
@@ -548,6 +551,7 @@ namespace OpenRA.Server
inFlightFrames.Clear();
lobbyInfo = new Session();
lobbyInfo.GlobalSettings.Mods = initialMods;
lobbyInfo.GlobalSettings.RandomSeed = randomSeed;
GameStarted = false;
}