about summary refs log tree commit diff
path: root/src/game/server
diff options
context:
space:
mode:
authorChoupom <andycootlapin@hotmail.fr>2010-10-09 20:34:17 +0200
committeroy <Tom_Adams@web.de>2010-10-11 00:31:21 +0200
commit61201fea1311b62bd5390a3f1684695073315290 (patch)
tree88cf384c78c01ceb7fbd2218148e3fce2f701d2b /src/game/server
parent7aefbca742c20206ce18a64bc83322331ee67b39 (diff)
downloadzcatch-61201fea1311b62bd5390a3f1684695073315290.tar.gz
zcatch-61201fea1311b62bd5390a3f1684695073315290.zip
added reason to kick a player in the callvote tab
Diffstat (limited to 'src/game/server')
-rw-r--r--src/game/server/gamecontext.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/game/server/gamecontext.cpp b/src/game/server/gamecontext.cpp
index 4300bc2e..95a7e558 100644
--- a/src/game/server/gamecontext.cpp
+++ b/src/game/server/gamecontext.cpp
@@ -669,15 +669,22 @@ void CGameContext::OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientId)
 				return;
 			}
 			
-			str_format(aChatmsg, sizeof(aChatmsg), "'%s' called for vote to kick '%s'", Server()->ClientName(ClientId), Server()->ClientName(KickId));
+			const char *pReason = "No reason given";
+			for(int i = 0; i < str_length(pMsg->m_Value)-1; i++)
+			{
+				if(pMsg->m_Value[i] == ' ')
+					pReason = &pMsg->m_Value[i+1];
+			}
+			
+			str_format(aChatmsg, sizeof(aChatmsg), "'%s' called for vote to kick '%s' (%s)", Server()->ClientName(ClientId), Server()->ClientName(KickId), pReason);
 			str_format(aDesc, sizeof(aDesc), "Kick '%s'", Server()->ClientName(KickId));
 			if (!g_Config.m_SvVoteKickBantime)
-				str_format(aCmd, sizeof(aCmd), "kick %d", KickId);
+				str_format(aCmd, sizeof(aCmd), "kick %d %s", KickId, pReason);
 			else
 			{
 				char aBuf[64] = {0};
 				Server()->GetClientIP(KickId, aBuf, sizeof(aBuf));
-				str_format(aCmd, sizeof(aCmd), "ban %s %d", aBuf, g_Config.m_SvVoteKickBantime);
+				str_format(aCmd, sizeof(aCmd), "ban %s %d %s", aBuf, g_Config.m_SvVoteKickBantime, pReason);
 			}
 		}