From 0497cdd49ded0331bade2d1b5161d0ecb5a56e52 Mon Sep 17 00:00:00 2001 From: eeeee Date: Thu, 8 Jun 2017 12:58:41 -0700 Subject: [PATCH] stop casting auth state to bool --- src/engine/server.h | 2 +- src/engine/server/server.cpp | 2 +- src/engine/server/server.h | 2 +- src/game/server/gamecontext.cpp | 2 +- src/game/server/gamecontroller.cpp | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/engine/server.h b/src/engine/server.h index 0f6d4a894..8e0a1791e 100644 --- a/src/engine/server.h +++ b/src/engine/server.h @@ -154,7 +154,7 @@ public: RCON_CID_VOTE=-2, }; virtual void SetRconCID(int ClientID) = 0; - virtual bool IsAuthed(int ClientID) = 0; + virtual int GetAuthedState(int ClientID) = 0; virtual void Kick(int ClientID, const char *pReason) = 0; virtual void DemoRecorder_HandleAutoStart() = 0; diff --git a/src/engine/server/server.cpp b/src/engine/server/server.cpp index 4a6e42076..e5c5203d4 100644 --- a/src/engine/server/server.cpp +++ b/src/engine/server/server.cpp @@ -486,7 +486,7 @@ void CServer::SetRconCID(int ClientID) m_RconClientID = ClientID; } -bool CServer::IsAuthed(int ClientID) +int CServer::GetAuthedState(int ClientID) { return m_aClients[ClientID].m_Authed; } diff --git a/src/engine/server/server.h b/src/engine/server/server.h index 439266abd..aa572ec7c 100644 --- a/src/engine/server/server.h +++ b/src/engine/server/server.h @@ -232,7 +232,7 @@ public: int Init(); void SetRconCID(int ClientID); - bool IsAuthed(int ClientID); + int GetAuthedState(int ClientID); int GetClientInfo(int ClientID, CClientInfo *pInfo); void GetClientAddr(int ClientID, char *pAddrStr, int Size); const char *ClientName(int ClientID); diff --git a/src/game/server/gamecontext.cpp b/src/game/server/gamecontext.cpp index 4bae6d2de..8d3c174b3 100644 --- a/src/game/server/gamecontext.cpp +++ b/src/game/server/gamecontext.cpp @@ -945,7 +945,7 @@ void CGameContext::OnClientEnter(int ClientID) if(m_VoteCloseTime) SendVoteSet(ClientID); - m_apPlayers[ClientID]->m_Authed = Server()->IsAuthed(ClientID); + m_apPlayers[ClientID]->m_Authed = Server()->GetAuthedState(ClientID); } void CGameContext::OnClientConnected(int ClientID) diff --git a/src/game/server/gamecontroller.cpp b/src/game/server/gamecontroller.cpp index 2b74f7a7b..685657ab1 100644 --- a/src/game/server/gamecontroller.cpp +++ b/src/game/server/gamecontroller.cpp @@ -698,7 +698,7 @@ void IGameController::Tick() break; } #endif - if(GameServer()->m_apPlayers[i] && GameServer()->m_apPlayers[i]->GetTeam() != TEAM_SPECTATORS && !Server()->IsAuthed(i)) + if(GameServer()->m_apPlayers[i] && GameServer()->m_apPlayers[i]->GetTeam() != TEAM_SPECTATORS && Server()->GetAuthedState(i) == IServer::AUTHED_NO) { if(Server()->Tick() > GameServer()->m_apPlayers[i]->m_LastActionTick+g_Config.m_SvInactiveKickTime*Server()->TickSpeed()*60) {