mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Minor refactoring of GetClientInfo
and SetClientDDNetVersion
This commit is contained in:
parent
24b30434da
commit
ee339ebe30
|
@ -643,8 +643,8 @@ const char *CServer::GetAuthName(int ClientID) const
|
|||
|
||||
bool CServer::GetClientInfo(int ClientID, CClientInfo *pInfo) const
|
||||
{
|
||||
dbg_assert(ClientID >= 0 && ClientID < MAX_CLIENTS, "client_id is not valid");
|
||||
dbg_assert(pInfo != 0, "info can not be null");
|
||||
dbg_assert(ClientID >= 0 && ClientID < MAX_CLIENTS, "ClientID is not valid");
|
||||
dbg_assert(pInfo != nullptr, "pInfo cannot be null");
|
||||
|
||||
if(m_aClients[ClientID].m_State == CClient::STATE_INGAME)
|
||||
{
|
||||
|
@ -659,8 +659,8 @@ bool CServer::GetClientInfo(int ClientID, CClientInfo *pInfo) const
|
|||
}
|
||||
else
|
||||
{
|
||||
pInfo->m_pConnectionID = 0;
|
||||
pInfo->m_pDDNetVersionStr = 0;
|
||||
pInfo->m_pConnectionID = nullptr;
|
||||
pInfo->m_pDDNetVersionStr = nullptr;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -669,7 +669,7 @@ bool CServer::GetClientInfo(int ClientID, CClientInfo *pInfo) const
|
|||
|
||||
void CServer::SetClientDDNetVersion(int ClientID, int DDNetVersion)
|
||||
{
|
||||
dbg_assert(ClientID >= 0 && ClientID < MAX_CLIENTS, "client_id is not valid");
|
||||
dbg_assert(ClientID >= 0 && ClientID < MAX_CLIENTS, "ClientID is not valid");
|
||||
|
||||
if(m_aClients[ClientID].m_State == CClient::STATE_INGAME)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue