mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Merge pull request #780 from eeeee/fix_authed
stop casting auth state to bool
This commit is contained in:
commit
1a9710ae5e
|
@ -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;
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
||||||
|
|
|
@ -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)
|
||||||
|
|
|
@ -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)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue