about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--data/languages/french.txt8
-rw-r--r--src/engine/server/server.cpp2
-rw-r--r--src/game/client/components/menus_ingame.cpp11
-rw-r--r--src/game/client/components/voting.cpp13
-rw-r--r--src/game/client/components/voting.h4
-rw-r--r--src/game/server/gamecontext.cpp13
6 files changed, 29 insertions, 22 deletions
diff --git a/data/languages/french.txt b/data/languages/french.txt
index d028cc17..eaaa09da 100644
--- a/data/languages/french.txt
+++ b/data/languages/french.txt
@@ -209,7 +209,7 @@ File
 == Fichier
 
 Filename:
-== Nom du fichier :
+== Nom du fichier:
 
 Filter
 == Filtre
@@ -236,7 +236,7 @@ Game type
 == Type de jeu
 
 Game types:
-== Types de jeu :
+== Types de jeu:
 
 General
 == Général
@@ -335,7 +335,7 @@ Map
 == Carte
 
 Maximum ping:
-== Ping maximum :
+== Ping maximum:
 
 Miscellaneous
 == Divers
@@ -371,7 +371,7 @@ Nickname
 == Pseudonyme
 
 Name:
-== Nom :
+== Nom:
 
 No
 == Non
diff --git a/src/engine/server/server.cpp b/src/engine/server/server.cpp
index fc8ad411..3b8771e4 100644
--- a/src/engine/server/server.cpp
+++ b/src/engine/server/server.cpp
@@ -634,7 +634,7 @@ void CServer::ProcessClientPacket(CNetChunk *pPacket)
 			{
 				// OH FUCK! wrong version, drop him
 				char aReason[256];
-				str_format(aReason, sizeof(aReason), "Wrong version : server is running \"%s\" and client \"%s\"", GameServer()->NetVersion(), aVersion);
+				str_format(aReason, sizeof(aReason), "Wrong version. Server is running '%s' and client '%s'", GameServer()->NetVersion(), aVersion);
 				m_NetServer.Drop(ClientId, aReason);
 				return;
 			}
diff --git a/src/game/client/components/menus_ingame.cpp b/src/game/client/components/menus_ingame.cpp
index 972b1f59..236a25dc 100644
--- a/src/game/client/components/menus_ingame.cpp
+++ b/src/game/client/components/menus_ingame.cpp
@@ -425,13 +425,13 @@ void CMenus::RenderServerControl(CUIRect MainView)
 		if(s_ControlPage == 1)
 		{
 			CUIRect Reason;
-			Bottom.VSplitRight(140.0f, &Bottom, &Reason);
-			Bottom.VSplitRight(200.0f, &Bottom, &Reason);
+			Bottom.VSplitRight(40.0f, &Bottom, 0);
+			Bottom.VSplitRight(160.0f, &Bottom, &Reason);
+			Reason.HSplitTop(5.0f, 0, &Reason);
 			const char *pLabel = Localize("Reason:");
 			UI()->DoLabel(&Reason, pLabel, 14.0f, -1);
 			float w = TextRender()->TextWidth(0, 14.0f, pLabel, -1);
-			Reason.VSplitLeft(w, 0, &Reason);
-			Reason.VSplitLeft(10.0f, 0, &Reason);
+			Reason.VSplitLeft(w+10.0f, 0, &Reason);
 			static float s_Offset = 0.0f;
 			DoEditBox(&m_aCallvoteReason, &Reason, m_aCallvoteReason, sizeof(m_aCallvoteReason), 14.0f, &s_Offset, false, CUI::CORNER_ALL);
 		}
@@ -453,7 +453,8 @@ void CMenus::RenderServerControl(CUIRect MainView)
 					if(m_CallvoteSelectedPlayer >= 0 && m_CallvoteSelectedPlayer < MAX_CLIENTS &&
 						m_pClient->m_Snap.m_paPlayerInfos[m_CallvoteSelectedPlayer])
 					{
-						m_pClient->m_pVoting->ForcevoteKick(m_CallvoteSelectedPlayer);
+						m_pClient->m_pVoting->ForcevoteKick(m_CallvoteSelectedPlayer, m_aCallvoteReason);
+						m_aCallvoteReason[0] = 0;
 						SetActive(false);
 					}
 				}
diff --git a/src/game/client/components/voting.cpp b/src/game/client/components/voting.cpp
index c5e6a56c..8a98e1b0 100644
--- a/src/game/client/components/voting.cpp
+++ b/src/game/client/components/voting.cpp
@@ -29,7 +29,7 @@ void CVoting::Callvote(const char *pType, const char *pValue)
 	Client()->SendPackMsg(&Msg, MSGFLAG_VITAL);
 }
 
-void CVoting::CallvoteKick(int ClientId, char *pReason)
+void CVoting::CallvoteKick(int ClientId, const char *pReason)
 {
 	char aBuf[32];
 	if(pReason[0])
@@ -55,11 +55,14 @@ void CVoting::CallvoteOption(int OptionId)
 	}
 }
 
-void CVoting::ForcevoteKick(int ClientId)
+void CVoting::ForcevoteKick(int ClientId, const char *pReason)
 {
-	char Buf[32];
-	str_format(Buf, sizeof(Buf), "kick %d", ClientId);
-	Client()->Rcon(Buf);
+	char aBuf[32];
+	if(pReason[0])
+		str_format(aBuf, sizeof(aBuf), "kick %d \"%s\"", ClientId, pReason);
+	else
+		str_format(aBuf, sizeof(aBuf), "kick %d", ClientId);
+	Client()->Rcon(aBuf);
 }
 
 void CVoting::ForcevoteOption(int OptionId)
diff --git a/src/game/client/components/voting.h b/src/game/client/components/voting.h
index 1fc2aa53..ff982640 100644
--- a/src/game/client/components/voting.h
+++ b/src/game/client/components/voting.h
@@ -39,9 +39,9 @@ public:
 	
 	void RenderBars(CUIRect Bars, bool Text);
 	
-	void CallvoteKick(int ClientId, char *pReason);
+	void CallvoteKick(int ClientId, const char *pReason);
 	void CallvoteOption(int Option);
-	void ForcevoteKick(int ClientId);
+	void ForcevoteKick(int ClientId, const char *pReason);
 	void ForcevoteOption(int Option);
 	
 	void Vote(int v); // -1 = no, 1 = yes
diff --git a/src/game/server/gamecontext.cpp b/src/game/server/gamecontext.cpp
index 95a7e558..0faba6fc 100644
--- a/src/game/server/gamecontext.cpp
+++ b/src/game/server/gamecontext.cpp
@@ -670,21 +670,24 @@ void CGameContext::OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientId)
 			}
 			
 			const char *pReason = "No reason given";
-			for(int i = 0; i < str_length(pMsg->m_Value)-1; i++)
+			for(const char *p = pMsg->m_Value; *p; ++p)
 			{
-				if(pMsg->m_Value[i] == ' ')
-					pReason = &pMsg->m_Value[i+1];
+				if(*p == ' ')
+				{
+					pReason = p+1;
+					break;
+				}
 			}
 			
 			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 %s", KickId, pReason);
+				str_format(aCmd, sizeof(aCmd), "kick %d \"Kicked by vote\"", KickId);
 			else
 			{
 				char aBuf[64] = {0};
 				Server()->GetClientIP(KickId, aBuf, sizeof(aBuf));
-				str_format(aCmd, sizeof(aCmd), "ban %s %d %s", aBuf, g_Config.m_SvVoteKickBantime, pReason);
+				str_format(aCmd, sizeof(aCmd), "ban %s %d \"Banned by vote\"", aBuf, g_Config.m_SvVoteKickBantime);
 			}
 		}