From 41d0860db47805c8c9adca983bfafb0fbd807a7c Mon Sep 17 00:00:00 2001 From: Igor Popov Date: Sun, 24 Mar 2013 19:35:44 +0400 Subject: [PATCH] option to disable bots on server + disable bots on any dedicated server due to #2540 --- OpenRA.Game/GameRules/Settings.cs | 2 ++ OpenRA.Mods.RA/ServerTraits/LobbyCommands.cs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/OpenRA.Game/GameRules/Settings.cs b/OpenRA.Game/GameRules/Settings.cs index aa2e97cec1..448220c73f 100644 --- a/OpenRA.Game/GameRules/Settings.cs +++ b/OpenRA.Game/GameRules/Settings.cs @@ -36,6 +36,7 @@ namespace OpenRA.GameRules public int TimeOut = 0; public bool Dedicated = false; public bool DedicatedLoop = true; + public bool LockBots = false; public ServerSettings() { } @@ -53,6 +54,7 @@ namespace OpenRA.GameRules TimeOut = other.TimeOut; Dedicated = other.Dedicated; DedicatedLoop = other.DedicatedLoop; + LockBots = other.LockBots; } } diff --git a/OpenRA.Mods.RA/ServerTraits/LobbyCommands.cs b/OpenRA.Mods.RA/ServerTraits/LobbyCommands.cs index 11dcbe635a..fa94b7977d 100644 --- a/OpenRA.Mods.RA/ServerTraits/LobbyCommands.cs +++ b/OpenRA.Mods.RA/ServerTraits/LobbyCommands.cs @@ -546,6 +546,8 @@ namespace OpenRA.Mods.RA.Server static Session.Slot MakeSlotFromPlayerReference(PlayerReference pr) { if (!pr.Playable) return null; + if (Game.Settings.Server.LockBots || Game.Settings.Server.Dedicated) + pr.AllowBots = false; return new Session.Slot { PlayerReference = pr.Name,