stop casting auth state to bool

This commit is contained in:
eeeee 2017-06-08 12:58:41 -07:00
parent a1c1472c79
commit 0497cdd49d
5 changed files with 5 additions and 5 deletions

View file

@ -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;

View file

@ -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;
}

View file

@ -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);

View file

@ -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)

View file

@ -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)
{