about summary refs log tree commit diff
path: root/src/game/server
diff options
context:
space:
mode:
authoroy <Tom_Adams@web.de>2011-03-28 20:11:28 +0200
committeroy <Tom_Adams@web.de>2011-03-28 20:11:28 +0200
commit34a9ca20a75db36d63549a8a9dfe2cc5e21f338d (patch)
treec183c859ea5c61f332c01dc95fd29ddb6c900fe0 /src/game/server
parent63d2019b1913f6d467901022d460edfea62b2c6f (diff)
downloadzcatch-34a9ca20a75db36d63549a8a9dfe2cc5e21f338d.tar.gz
zcatch-34a9ca20a75db36d63549a8a9dfe2cc5e21f338d.zip
added ipv6 support from the old lua branch
Diffstat (limited to 'src/game/server')
-rw-r--r--src/game/server/gamecontext.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/game/server/gamecontext.cpp b/src/game/server/gamecontext.cpp
index 6a7cc1f9..d008787a 100644
--- a/src/game/server/gamecontext.cpp
+++ b/src/game/server/gamecontext.cpp
@@ -414,10 +414,10 @@ void CGameContext::OnTick()
 			if(m_VoteUpdate)
 			{
 				// count votes
-				char aaBuf[MAX_CLIENTS][64] = {{0}};
+				char aaBuf[MAX_CLIENTS][NETADDR_MAXSTRSIZE] = {{0}};
 				for(int i = 0; i < MAX_CLIENTS; i++)
 					if(m_apPlayers[i])
-						Server()->GetClientIP(i, aaBuf[i], 64);
+						Server()->GetClientAddr(i, aaBuf[i], NETADDR_MAXSTRSIZE);
 				bool aVoteChecked[MAX_CLIENTS] = {0};
 				for(int i = 0; i < MAX_CLIENTS; i++)
 				{
@@ -709,9 +709,10 @@ void CGameContext::OnMessage(int MsgID, CUnpacker *pUnpacker, int ClientID)
 				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 Banned by vote", aBuf, g_Config.m_SvVoteKickBantime);
+				char aAddrStr[NETADDR_MAXSTRSIZE] = {0};
+				Server()->GetClientAddr(KickID, aAddrStr, sizeof(aAddrStr));
+				str_format(aCmd, sizeof(aCmd), "ban %s %d Banned by vote", aAddrStr, g_Config.m_SvVoteKickBantime);
+				Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "server", aCmd);
 			}
 		}
 		else if(str_comp_nocase(pMsg->m_Type, "spectate") == 0)
@@ -1229,9 +1230,9 @@ void CGameContext::ConForceVote(IConsole::IResult *pResult, void *pUserData)
 		}
 		else
 		{
-			char aIP[64] = {0};
-			pSelf->Server()->GetClientIP(KickID, aIP, sizeof(aIP));
-			str_format(aBuf, sizeof(aBuf), "ban %s %d %s", aIP, g_Config.m_SvVoteKickBantime, pReason);
+			char aAddrStr[NETADDR_MAXSTRSIZE] = {0};
+			pSelf->Server()->GetClientAddr(KickID, aAddrStr, sizeof(aAddrStr));
+			str_format(aBuf, sizeof(aBuf), "ban %s %d %s", aAddrStr, g_Config.m_SvVoteKickBantime, pReason);
 			pSelf->Console()->ExecuteLine(aBuf);
 		}
 	}