about summary refs log tree commit diff
path: root/src/game/server/gamemodes/ctf.cpp
diff options
context:
space:
mode:
authoroy <Tom_Adams@web.de>2010-08-18 00:06:00 +0200
committeroy <Tom_Adams@web.de>2010-08-18 00:06:00 +0200
commitcabecb7fa937b5e4efa859ea62722468f91a5089 (patch)
treed9da92814dd049dfef7bdcfa9069955504341b8c /src/game/server/gamemodes/ctf.cpp
parent16f201794de61e237b4a7644d28f043dc1b987bb (diff)
downloadzcatch-cabecb7fa937b5e4efa859ea62722468f91a5089.tar.gz
zcatch-cabecb7fa937b5e4efa859ea62722468f91a5089.zip
added output level for console print function, categorised the debug messages and merged them into the new functionality. Closes #8
Diffstat (limited to 'src/game/server/gamemodes/ctf.cpp')
-rw-r--r--src/game/server/gamemodes/ctf.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/game/server/gamemodes/ctf.cpp b/src/game/server/gamemodes/ctf.cpp
index 3c052a91..4b25fc47 100644
--- a/src/game/server/gamemodes/ctf.cpp
+++ b/src/game/server/gamemodes/ctf.cpp
@@ -111,21 +111,22 @@ void CGameControllerCTF::Tick()
 					m_aTeamscore[fi^1] += 100;
 					F->m_pCarryingCharacter->GetPlayer()->m_Score += 5;
 
-					dbg_msg("game", "flag_capture player='%d:%s'",
+					char aBuf[512];
+					str_format(aBuf, sizeof(aBuf), "flag_capture player='%d:%s'",
 						F->m_pCarryingCharacter->GetPlayer()->GetCID(),
 						Server()->ClientName(F->m_pCarryingCharacter->GetPlayer()->GetCID()));
+					GameServer()->Console()->Print(IConsole::OUTPUT_LEVEL_DEBUG, "game", aBuf);
 
-					char Buf[512];
 					float CaptureTime = (Server()->Tick() - F->m_GrabTick)/(float)Server()->TickSpeed();
 					if(CaptureTime <= 60)
 					{
-						str_format(Buf, sizeof(Buf), "The %s flag was captured by %s (%d.%s%d seconds)", fi ? "blue" : "red", Server()->ClientName(F->m_pCarryingCharacter->GetPlayer()->GetCID()), (int)CaptureTime%60, ((int)(CaptureTime*100)%100)<10?"0":"", (int)(CaptureTime*100)%100);
+						str_format(aBuf, sizeof(aBuf), "The %s flag was captured by %s (%d.%s%d seconds)", fi ? "blue" : "red", Server()->ClientName(F->m_pCarryingCharacter->GetPlayer()->GetCID()), (int)CaptureTime%60, ((int)(CaptureTime*100)%100)<10?"0":"", (int)(CaptureTime*100)%100);
 					}
 					else
 					{
-						str_format(Buf, sizeof(Buf), "The %s flag was captured by %s", fi ? "blue" : "red", Server()->ClientName(F->m_pCarryingCharacter->GetPlayer()->GetCID()));
+						str_format(aBuf, sizeof(aBuf), "The %s flag was captured by %s", fi ? "blue" : "red", Server()->ClientName(F->m_pCarryingCharacter->GetPlayer()->GetCID()));
 					}
-					GameServer()->SendChat(-1, -2, Buf);
+					GameServer()->SendChat(-1, -2, aBuf);
 					for(int i = 0; i < 2; i++)
 						m_apFlags[i]->Reset();
 					
@@ -150,9 +151,11 @@ void CGameControllerCTF::Tick()
 						CCharacter *pChr = apCloseCCharacters[i];
 						pChr->GetPlayer()->m_Score += 1;
 
-						dbg_msg("game", "flag_return player='%d:%s'",
+						char aBuf[256];
+						str_format(aBuf, sizeof(aBuf), "flag_return player='%d:%s'",
 							pChr->GetPlayer()->GetCID(),
 							Server()->ClientName(pChr->GetPlayer()->GetCID()));
+						GameServer()->Console()->Print(IConsole::OUTPUT_LEVEL_DEBUG, "game", aBuf);
 
 						GameServer()->CreateSoundGlobal(SOUND_CTF_RETURN);
 						F->Reset();
@@ -171,9 +174,11 @@ void CGameControllerCTF::Tick()
 					F->m_pCarryingCharacter = apCloseCCharacters[i];
 					F->m_pCarryingCharacter->GetPlayer()->m_Score += 1;
 
-					dbg_msg("game", "flag_grab player='%d:%s'",
+					char aBuf[256];
+					str_format(aBuf, sizeof(aBuf), "flag_grab player='%d:%s'",
 						F->m_pCarryingCharacter->GetPlayer()->GetCID(),
 						Server()->ClientName(F->m_pCarryingCharacter->GetPlayer()->GetCID()));
+					GameServer()->Console()->Print(IConsole::OUTPUT_LEVEL_DEBUG, "game", aBuf);
 					
 					for(int c = 0; c < MAX_CLIENTS; c++)
 					{