diff options
| author | oy <Tom_Adams@web.de> | 2011-03-20 15:33:49 +0100 |
|---|---|---|
| committer | oy <Tom_Adams@web.de> | 2011-03-20 15:33:49 +0100 |
| commit | 96808a11451f2ccf22346253bd22f8f559207ac8 (patch) | |
| tree | a91ecb0ea18cff36e8515f234c5028c6c1c1b628 /src/game/server | |
| parent | 2547bfa4fcc8916a47eceb9a929fe73c8a1d83b9 (diff) | |
| download | zcatch-96808a11451f2ccf22346253bd22f8f559207ac8.tar.gz zcatch-96808a11451f2ccf22346253bd22f8f559207ac8.zip | |
made it possible to just show the number of player slots of a server (instead of client ones). Closes #68
Diffstat (limited to 'src/game/server')
| -rw-r--r-- | src/game/server/gamecontext.cpp | 5 | ||||
| -rw-r--r-- | src/game/server/gamecontext.h | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/game/server/gamecontext.cpp b/src/game/server/gamecontext.cpp index 348b6735..1612ebec 100644 --- a/src/game/server/gamecontext.cpp +++ b/src/game/server/gamecontext.cpp @@ -1184,6 +1184,11 @@ bool CGameContext::IsClientReady(int ClientID) return m_apPlayers[ClientID] && m_apPlayers[ClientID]->m_IsReady ? true : false; } +bool CGameContext::IsClientPlayer(int ClientID) +{ + return m_apPlayers[ClientID] && m_apPlayers[ClientID]->GetTeam() == TEAM_SPECTATORS ? false : true; +} + const char *CGameContext::GameType() { return m_pController && m_pController->m_pGameType ? m_pController->m_pGameType : ""; } const char *CGameContext::Version() { return GAME_VERSION; } const char *CGameContext::NetVersion() { return GAME_NETVERSION; } diff --git a/src/game/server/gamecontext.h b/src/game/server/gamecontext.h index f64232a1..7379b74d 100644 --- a/src/game/server/gamecontext.h +++ b/src/game/server/gamecontext.h @@ -162,6 +162,7 @@ public: virtual void OnClientPredictedInput(int ClientID, void *pInput); virtual bool IsClientReady(int ClientID); + virtual bool IsClientPlayer(int ClientID); virtual const char *GameType(); virtual const char *Version(); |