From dc22007c24252a786d47a27de6404d866c3388fa Mon Sep 17 00:00:00 2001 From: heinrich5991 Date: Thu, 14 Oct 2010 00:35:54 +0200 Subject: [PATCH] fixed crash on dbg_msg on unauthed client trying rcon, fixed infinite loop (same event) --- src/engine/server/server.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/engine/server/server.cpp b/src/engine/server/server.cpp index 92cbf2d9c..5d880699f 100644 --- a/src/engine/server/server.cpp +++ b/src/engine/server/server.cpp @@ -812,11 +812,12 @@ void CServer::ProcessClientPacket(CNetChunk *pPacket) if(Unpacker.Error() == 0/* && m_aClients[ClientId].m_Authed*/) { - Console()->RegisterAlternativePrintCallback(0, 0); char aBuf[256]; if(m_aClients[ClientId].m_Authed >= 0) { + Console()->RegisterAlternativePrintCallback(0, 0); + str_format(aBuf, sizeof(aBuf), "'%s' ClientId=%d Level=%d Rcon='%s'", ClientName(ClientId), ClientId, m_aClients[ClientId].m_Authed, pCmd); Console()->Print(IConsole::OUTPUT_LEVEL_ADDINFO, "server", aBuf); @@ -833,7 +834,7 @@ void CServer::ProcessClientPacket(CNetChunk *pPacket) } else { - dbg_msg("server", "'%s' client tried rcon command ('pCmd') without permissions. Cid=%x ip=%d.%d.%d.%d", + dbg_msg("server", "'%s' client tried rcon command ('%s') without permissions. Cid=%x ip=%d.%d.%d.%d", ClientName(ClientId), pCmd, ClientId,