From 7a20c313ee83de1619d329fd8ba0b6138a7eb4bc Mon Sep 17 00:00:00 2001 From: oy Date: Wed, 19 Jan 2011 15:39:04 +0100 Subject: [PATCH] made some output just show up on debug --- src/engine/server/server.cpp | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/src/engine/server/server.cpp b/src/engine/server/server.cpp index 299919ddf..95cb06bd2 100644 --- a/src/engine/server/server.cpp +++ b/src/engine/server/server.cpp @@ -845,22 +845,24 @@ void CServer::ProcessClientPacket(CNetChunk *pPacket) } else { - char aHex[] = "0123456789ABCDEF"; - char aBuf[512]; - - for(int b = 0; b < pPacket->m_DataSize && b < 32; b++) + if(g_Config.m_Debug) { - aBuf[b*3] = aHex[((const unsigned char *)pPacket->m_pData)[b]>>4]; - aBuf[b*3+1] = aHex[((const unsigned char *)pPacket->m_pData)[b]&0xf]; - aBuf[b*3+2] = ' '; - aBuf[b*3+3] = 0; - } + char aHex[] = "0123456789ABCDEF"; + char aBuf[512]; - char aBufMsg[256]; - str_format(aBufMsg, sizeof(aBufMsg), "strange message ClientId=%d msg=%d data_size=%d", ClientId, Msg, pPacket->m_DataSize); - Console()->Print(IConsole::OUTPUT_LEVEL_ADDINFO, "server", aBufMsg); - Console()->Print(IConsole::OUTPUT_LEVEL_ADDINFO, "server", aBuf); - + for(int b = 0; b < pPacket->m_DataSize && b < 32; b++) + { + aBuf[b*3] = aHex[((const unsigned char *)pPacket->m_pData)[b]>>4]; + aBuf[b*3+1] = aHex[((const unsigned char *)pPacket->m_pData)[b]&0xf]; + aBuf[b*3+2] = ' '; + aBuf[b*3+3] = 0; + } + + char aBufMsg[256]; + str_format(aBufMsg, sizeof(aBufMsg), "strange message ClientId=%d msg=%d data_size=%d", ClientId, Msg, pPacket->m_DataSize); + Console()->Print(IConsole::OUTPUT_LEVEL_DEBUG, "server", aBufMsg); + Console()->Print(IConsole::OUTPUT_LEVEL_DEBUG, "server", aBuf); + } } } else