about summary refs log tree commit diff
path: root/src/game/server
diff options
context:
space:
mode:
authorNoxNebula <patrick.kl@live.de>2010-06-02 04:42:17 +0200
committerMagnus Auvinen <magnus.auvinen@gmail.com>2010-06-02 09:40:08 +0200
commit9a5a19e7c7b0d4364f32540b012bce970807f9b6 (patch)
tree4e1ba9fcc41e3a79e144dc25af4e87c5fd63cadc /src/game/server
parentf2920ea5d85ea54a8000fdf6b6f8ccba36ebfdfb (diff)
downloadzcatch-9a5a19e7c7b0d4364f32540b012bce970807f9b6.tar.gz
zcatch-9a5a19e7c7b0d4364f32540b012bce970807f9b6.zip
Admin-Kick-Protection
Add IsAuthed(int ClientID); function.
Add kickprotection for admins (Remote Console logged in players)
Add Anti-Self-Kick (minor)
Diffstat (limited to 'src/game/server')
-rw-r--r--src/game/server/gamecontext.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/game/server/gamecontext.cpp b/src/game/server/gamecontext.cpp
index 795bb65f..c04dd945 100644
--- a/src/game/server/gamecontext.cpp
+++ b/src/game/server/gamecontext.cpp
@@ -647,6 +647,19 @@ void CGameContext::OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientId)
 				SendChatTarget(ClientId, "Invalid client id to kick");
 				return;
 			}
+			if(KickId == ClientId)
+			{
+				SendChatTarget(ClientId, "You cant kick yourself");
+				return;
+			}
+			if(Server()->IsAuthed(KickId))
+			{
+				SendChatTarget(ClientId, "You cant kick admins");
+				char aBufKick[128];
+				str_format(aBufKick, sizeof(aBufKick), "%s called for vote to kick you", Server()->ClientName(ClientId));
+				SendChatTarget(KickId, aBufKick);
+				return;
+			}
 			
 			str_format(aChatmsg, sizeof(aChatmsg), "%s called for vote to kick '%s'", Server()->ClientName(ClientId), Server()->ClientName(KickId));
 			str_format(aDesc, sizeof(aDesc), "Kick '%s'", Server()->ClientName(KickId));