Disable 1 human versus bots games

Changed the Server.LockBots setting to Server.DisableSinglePlayer.

If the setting is enabled, and there is only one client in the server,
the game won't start.
This commit is contained in:
Alexandre Oliveira
2016-02-01 11:38:50 -02:00
parent ac2455824c
commit 989bf4f807
5 changed files with 22 additions and 10 deletions

View File

@@ -148,7 +148,8 @@ namespace OpenRA.Server
RandomSeed = randomSeed,
Map = settings.Map,
ServerName = settings.Name,
Dedicated = settings.Dedicated
Dedicated = settings.Dedicated,
DisableSingleplayer = settings.DisableSinglePlayer,
}
};
@@ -395,8 +396,8 @@ namespace OpenRA.Server
if (Map.RuleDefinitions.Any() && !LobbyInfo.IsSinglePlayer)
SendOrderTo(newConn, "Message", "This map contains custom rules. Game experience may change.");
if (Settings.LockBots)
SendOrderTo(newConn, "Message", "Bots have been disabled on this server.");
if (Settings.DisableSinglePlayer)
SendOrderTo(newConn, "Message", "Singleplayer games have been disabled on this server.");
else if (MapPlayers.Players.Where(p => p.Value.Playable).All(p => !p.Value.AllowBots))
SendOrderTo(newConn, "Message", "Bots have been disabled on this map.");