diff options
| author | oy <Tom_Adams@web.de> | 2010-08-18 00:06:00 +0200 |
|---|---|---|
| committer | oy <Tom_Adams@web.de> | 2010-08-18 00:06:00 +0200 |
| commit | cabecb7fa937b5e4efa859ea62722468f91a5089 (patch) | |
| tree | d9da92814dd049dfef7bdcfa9069955504341b8c /src/game/server/player.cpp | |
| parent | 16f201794de61e237b4a7644d28f043dc1b987bb (diff) | |
| download | zcatch-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/player.cpp')
| -rw-r--r-- | src/game/server/player.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/game/server/player.cpp b/src/game/server/player.cpp index 2d5d244f..cc89c11d 100644 --- a/src/game/server/player.cpp +++ b/src/game/server/player.cpp @@ -95,11 +95,12 @@ void CPlayer::OnDisconnect() if(Server()->ClientIngame(m_ClientID)) { - char Buf[512]; - str_format(Buf, sizeof(Buf), "%s has left the game", Server()->ClientName(m_ClientID)); - GameServer()->SendChat(-1, CGameContext::CHAT_ALL, Buf); + char aBuf[512]; + str_format(aBuf, sizeof(aBuf), "%s has left the game", Server()->ClientName(m_ClientID)); + GameServer()->SendChat(-1, CGameContext::CHAT_ALL, aBuf); - dbg_msg("game", "leave player='%d:%s'", m_ClientID, Server()->ClientName(m_ClientID)); + str_format(aBuf, sizeof(aBuf), "leave player='%d:%s'", m_ClientID, Server()->ClientName(m_ClientID)); + GameServer()->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "game", aBuf); } } @@ -151,16 +152,17 @@ void CPlayer::SetTeam(int Team) if(m_Team == Team) return; - char Buf[512]; - str_format(Buf, sizeof(Buf), "%s joined the %s", Server()->ClientName(m_ClientID), GameServer()->m_pController->GetTeamName(Team)); - GameServer()->SendChat(-1, CGameContext::CHAT_ALL, Buf); + char aBuf[512]; + str_format(aBuf, sizeof(aBuf), "%s joined the %s", Server()->ClientName(m_ClientID), GameServer()->m_pController->GetTeamName(Team)); + GameServer()->SendChat(-1, CGameContext::CHAT_ALL, aBuf); KillCharacter(); m_Team = Team; // we got to wait 0.5 secs before respawning m_RespawnTick = Server()->Tick()+Server()->TickSpeed()/2; - dbg_msg("game", "team_join player='%d:%s' m_Team=%d", m_ClientID, Server()->ClientName(m_ClientID), m_Team); + str_format(aBuf, sizeof(aBuf), "team_join player='%d:%s' m_Team=%d", m_ClientID, Server()->ClientName(m_ClientID), m_Team); + GameServer()->Console()->Print(IConsole::OUTPUT_LEVEL_DEBUG, "game", aBuf); GameServer()->m_pController->OnPlayerInfoChange(GameServer()->m_apPlayers[m_ClientID]); } |