diff options
| author | heinrich5991 <heinrich5991@gmail.com> | 2011-02-14 19:41:32 +0100 |
|---|---|---|
| committer | oy <Tom_Adams@web.de> | 2011-04-01 00:05:35 +0200 |
| commit | b6fa69cedb9d2b5117afe092b1c600f9f04c6a77 (patch) | |
| tree | 6601a9ca06a62762cad5d695e7c22b6824602ba3 /src/game/server/player.cpp | |
| parent | 8cd7dec1793a74dd922192a3f6a430208b8eb526 (diff) | |
| download | zcatch-b6fa69cedb9d2b5117afe092b1c600f9f04c6a77.tar.gz zcatch-b6fa69cedb9d2b5117afe092b1c600f9f04c6a77.zip | |
the server shows the disconnect reason of clients now
Diffstat (limited to 'src/game/server/player.cpp')
| -rw-r--r-- | src/game/server/player.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/game/server/player.cpp b/src/game/server/player.cpp index 6387cc9c..cf0e6683 100644 --- a/src/game/server/player.cpp +++ b/src/game/server/player.cpp @@ -140,14 +140,17 @@ void CPlayer::Snap(int SnappingClient) } } -void CPlayer::OnDisconnect() +void CPlayer::OnDisconnect(const char *pReason) { KillCharacter(); if(Server()->ClientIngame(m_ClientID)) { char aBuf[512]; - str_format(aBuf, sizeof(aBuf), "'%s' has left the game", Server()->ClientName(m_ClientID)); + if(pReason && *pReason) + str_format(aBuf, sizeof(aBuf), "'%s' has left the game (%s)", Server()->ClientName(m_ClientID), pReason); + else + str_format(aBuf, sizeof(aBuf), "'%s' has left the game", Server()->ClientName(m_ClientID)); GameServer()->SendChat(-1, CGameContext::CHAT_ALL, aBuf); str_format(aBuf, sizeof(aBuf), "leave player='%d:%s'", m_ClientID, Server()->ClientName(m_ClientID)); |