dedicated: drop DEV_VERSION

This commit is contained in:
Igor Popov
2012-06-07 18:39:13 +04:00
committed by Chris Forbes
parent 1fbd8f6cc6
commit 21b002ce22
2 changed files with 6 additions and 1 deletions

View File

@@ -77,6 +77,7 @@ namespace OpenRA.Network
public int RandomSeed = 0; public int RandomSeed = 0;
public bool LockTeams = true; // don't allow team changes after game start. public bool LockTeams = true; // don't allow team changes after game start.
public bool AllowCheats = false; public bool AllowCheats = false;
public bool Dedicated;
} }
public Session(string[] mods) public Session(string[] mods)

View File

@@ -118,6 +118,7 @@ namespace OpenRA.Server
lobbyInfo.GlobalSettings.Map = settings.Map; lobbyInfo.GlobalSettings.Map = settings.Map;
lobbyInfo.GlobalSettings.ServerName = settings.Name; lobbyInfo.GlobalSettings.ServerName = settings.Name;
lobbyInfo.GlobalSettings.Ban = settings.Ban; lobbyInfo.GlobalSettings.Ban = settings.Ban;
lobbyInfo.GlobalSettings.Dedicated = settings.Dedicated;
foreach (var t in ServerTraits.WithInterface<INotifyServerStart>()) foreach (var t in ServerTraits.WithInterface<INotifyServerStart>())
t.ServerStarted(this); t.ServerStarted(this);
@@ -263,7 +264,10 @@ namespace OpenRA.Server
mods.Count() == Game.CurrentMods.Count() && //same number mods.Count() == Game.CurrentMods.Count() && //same number
mods.Select( m => Pair.New(m.Split('@')[0], m.Split('@')[1])).All(kv => Game.CurrentMods.ContainsKey(kv.First) && mods.Select( m => Pair.New(m.Split('@')[0], m.Split('@')[1])).All(kv => Game.CurrentMods.ContainsKey(kv.First) &&
(kv.Second == "{DEV_VERSION}" || Game.CurrentMods[kv.First].Version == "{DEV_VERSION}" || kv.Second == Game.CurrentMods[kv.First].Version)); (kv.Second == "{DEV_VERSION}" || Game.CurrentMods[kv.First].Version == "{DEV_VERSION}" || kv.Second == Game.CurrentMods[kv.First].Version));
// Drop DEV_VERSION if it's a Dedicated
if ( lobbyInfo.GlobalSettings.Dedicated && mods.Any(m => m.Contains("{DEV_VERSION}"))) { valid = false; }
if (!valid) if (!valid)
{ {
Log.Write("server", "Rejected connection from {0}; mods do not match.", Log.Write("server", "Rejected connection from {0}; mods do not match.",