1128: Remove superfluous parameter from `CServer::NewClientNoAuthCallback` r=Learath2 a=heinrich5991

The `Reset` parameter was only ever set to true, at the only call site.

Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
This commit is contained in:
bors[bot] 2018-05-12 15:47:29 +00:00
commit eca23e45b7
4 changed files with 13 additions and 16 deletions

View file

@ -769,24 +769,21 @@ int CServer::ClientRejoinCallback(int ClientID, void *pUser)
return 0;
}
int CServer::NewClientNoAuthCallback(int ClientID, bool Reset, void *pUser)
int CServer::NewClientNoAuthCallback(int ClientID, void *pUser)
{
CServer *pThis = (CServer *)pUser;
pThis->m_aClients[ClientID].m_DnsblState = CClient::DNSBL_STATE_NONE;
if (Reset)
{
pThis->m_aClients[ClientID].m_State = CClient::STATE_CONNECTING;
pThis->m_aClients[ClientID].m_aName[0] = 0;
pThis->m_aClients[ClientID].m_aClan[0] = 0;
pThis->m_aClients[ClientID].m_Country = -1;
pThis->m_aClients[ClientID].m_Authed = AUTHED_NO;
pThis->m_aClients[ClientID].m_AuthKey = -1;
pThis->m_aClients[ClientID].m_AuthTries = 0;
pThis->m_aClients[ClientID].m_pRconCmdToSend = 0;
pThis->m_aClients[ClientID].Reset();
}
pThis->m_aClients[ClientID].m_State = CClient::STATE_CONNECTING;
pThis->m_aClients[ClientID].m_aName[0] = 0;
pThis->m_aClients[ClientID].m_aClan[0] = 0;
pThis->m_aClients[ClientID].m_Country = -1;
pThis->m_aClients[ClientID].m_Authed = AUTHED_NO;
pThis->m_aClients[ClientID].m_AuthKey = -1;
pThis->m_aClients[ClientID].m_AuthTries = 0;
pThis->m_aClients[ClientID].m_pRconCmdToSend = 0;
pThis->m_aClients[ClientID].Reset();
pThis->SendMap(ClientID);
#if defined(CONF_FAMILY_UNIX)

View file

@ -261,7 +261,7 @@ public:
void DoSnapshot();
static int NewClientCallback(int ClientID, void *pUser);
static int NewClientNoAuthCallback(int ClientID, bool Reset, void *pUser);
static int NewClientNoAuthCallback(int ClientID, void *pUser);
static int DelClientCallback(int ClientID, const char *pReason, void *pUser);
static int ClientRejoinCallback(int ClientID, void *pUser);

View file

@ -101,7 +101,7 @@ enum
typedef int (*NETFUNC_DELCLIENT)(int ClientID, const char *pReason, void *pUser);
typedef int (*NETFUNC_NEWCLIENT)(int ClientID, void *pUser);
typedef int (*NETFUNC_NEWCLIENT_NOAUTH)(int ClientID, bool Reset, void *pUser);
typedef int (*NETFUNC_NEWCLIENT_NOAUTH)(int ClientID, void *pUser);
typedef int (*NETFUNC_CLIENTREJOIN)(int ClientID, void *pUser);
struct CNetChunk

View file

@ -280,7 +280,7 @@ int CNetServer::TryAcceptClient(NETADDR &Addr, SECURITY_TOKEN SecurityToken, boo
if (VanillaAuth)
m_pfnNewClientNoAuth(Slot, true, m_UserPtr);
m_pfnNewClientNoAuth(Slot, m_UserPtr);
else
m_pfnNewClient(Slot, m_UserPtr);