dedicated: drop DEV_VERSION
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
@@ -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.",
|
||||||
|
|||||||
Reference in New Issue
Block a user