Merge pull request #780 from eeeee/fix_authed

stop casting auth state to bool
This commit is contained in:
Dennis Felsing 2017-06-08 22:40:28 +02:00 committed by GitHub
commit 1a9710ae5e
5 changed files with 5 additions and 5 deletions

View file

@ -154,7 +154,7 @@ public:
RCON_CID_VOTE=-2, RCON_CID_VOTE=-2,
}; };
virtual void SetRconCID(int ClientID) = 0; 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 Kick(int ClientID, const char *pReason) = 0;
virtual void DemoRecorder_HandleAutoStart() = 0; virtual void DemoRecorder_HandleAutoStart() = 0;

View file

@ -486,7 +486,7 @@ void CServer::SetRconCID(int ClientID)
m_RconClientID = ClientID; m_RconClientID = ClientID;
} }
bool CServer::IsAuthed(int ClientID) int CServer::GetAuthedState(int ClientID)
{ {
return m_aClients[ClientID].m_Authed; return m_aClients[ClientID].m_Authed;
} }

View file

@ -232,7 +232,7 @@ public:
int Init(); int Init();
void SetRconCID(int ClientID); void SetRconCID(int ClientID);
bool IsAuthed(int ClientID); int GetAuthedState(int ClientID);
int GetClientInfo(int ClientID, CClientInfo *pInfo); int GetClientInfo(int ClientID, CClientInfo *pInfo);
void GetClientAddr(int ClientID, char *pAddrStr, int Size); void GetClientAddr(int ClientID, char *pAddrStr, int Size);
const char *ClientName(int ClientID); const char *ClientName(int ClientID);

View file

@ -945,7 +945,7 @@ void CGameContext::OnClientEnter(int ClientID)
if(m_VoteCloseTime) if(m_VoteCloseTime)
SendVoteSet(ClientID); SendVoteSet(ClientID);
m_apPlayers[ClientID]->m_Authed = Server()->IsAuthed(ClientID); m_apPlayers[ClientID]->m_Authed = Server()->GetAuthedState(ClientID);
} }
void CGameContext::OnClientConnected(int ClientID) void CGameContext::OnClientConnected(int ClientID)

View file

@ -698,7 +698,7 @@ void IGameController::Tick()
break; break;
} }
#endif #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) if(Server()->Tick() > GameServer()->m_apPlayers[i]->m_LastActionTick+g_Config.m_SvInactiveKickTime*Server()->TickSpeed()*60)
{ {