From 395aa0fc10c3faec53c70d9243cc577af3de050b Mon Sep 17 00:00:00 2001 From: Igor Popov Date: Sun, 6 Jan 2013 19:00:36 +0400 Subject: [PATCH] dedicated: never let Bot become an admin --- OpenRA.Game/Server/Server.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OpenRA.Game/Server/Server.cs b/OpenRA.Game/Server/Server.cs index 4fc81d1449..91f3670ba6 100644 --- a/OpenRA.Game/Server/Server.cs +++ b/OpenRA.Game/Server/Server.cs @@ -314,7 +314,7 @@ namespace OpenRA.Server lobbyInfo.Clients.Add(client); //Assume that first validated client is server admin - if(lobbyInfo.Clients.Count==1) + if(lobbyInfo.Clients.Where(c1 => c1.Bot == null).Count()==1) client.IsAdmin=true; OpenRA.Network.Session.Client clientAdmin = lobbyInfo.Clients.Where(c1 => c1.IsAdmin).Single(); @@ -506,10 +506,10 @@ namespace OpenRA.Server // reassign admin if necessary if ( lobbyInfo.GlobalSettings.Dedicated && dropClient.IsAdmin && !GameStarted) { - if (lobbyInfo.Clients.Count() > 0) + if (lobbyInfo.Clients.Where(c1 => c1.Bot == null).Count() > 0) { // client was not alone on the server but he was admin: set admin to the last connected client - OpenRA.Network.Session.Client lastClient = lobbyInfo.Clients.Last(); + OpenRA.Network.Session.Client lastClient = lobbyInfo.Clients.Where(c1 => c1.Bot == null).Last(); lastClient.IsAdmin = true; SendChat(toDrop, "Admin left! {0} is a new admin now!".F(lastClient.Name)); }