mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Do proper checks if Client Instance is valid
This commit is contained in:
parent
ac55e6c142
commit
0463647268
@ -170,18 +170,16 @@ void CBanSystem::BanListCheck(void)
|
||||
{
|
||||
for (int c = 0; c < MAX_PLAYERS; c++) // Loop through all possible client instances.
|
||||
{
|
||||
CClient* pClient = g_pClient->GetClient(c);
|
||||
CNetChan* pNetChan = pClient->GetNetChan();
|
||||
|
||||
if (!pClient || !pNetChan)
|
||||
{
|
||||
CClient* pClient = g_pClient->GetClient(i);
|
||||
if (!pClient)
|
||||
continue;
|
||||
|
||||
CNetChan* pNetChan = pClient->GetNetChan();
|
||||
if (!pNetChan)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (pClient->GetOriginID() != m_vRefuseList[i].second)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
string svIpAddress = pNetChan->GetAddress();
|
||||
|
||||
|
@ -80,11 +80,12 @@ void Host_Kick_f(const CCommand& args)
|
||||
for (int i = 0; i < MAX_PLAYERS; i++)
|
||||
{
|
||||
CClient* pClient = g_pClient->GetClient(i);
|
||||
CNetChan* pNetChan = pClient->GetNetChan();
|
||||
if (!pClient || !pNetChan)
|
||||
{
|
||||
if (!pClient)
|
||||
continue;
|
||||
|
||||
CNetChan* pNetChan = pClient->GetNetChan();
|
||||
if (!pNetChan)
|
||||
continue;
|
||||
}
|
||||
|
||||
string svClientName = pNetChan->GetName(); // Get full name.
|
||||
|
||||
@ -120,12 +121,12 @@ void Host_KickID_f(const CCommand& args)
|
||||
for (int i = 0; i < MAX_PLAYERS; i++)
|
||||
{
|
||||
CClient* pClient = g_pClient->GetClient(i);
|
||||
CNetChan* pNetChan = pClient->GetNetChan();
|
||||
|
||||
if (!pClient || !pNetChan)
|
||||
{
|
||||
if (!pClient)
|
||||
continue;
|
||||
|
||||
CNetChan* pNetChan = pClient->GetNetChan();
|
||||
if (!pNetChan)
|
||||
continue;
|
||||
}
|
||||
|
||||
string svIpAddress = pNetChan->GetAddress(); // If this stays null they modified the packet somehow.
|
||||
|
||||
@ -184,12 +185,12 @@ void Host_Ban_f(const CCommand& args)
|
||||
for (int i = 0; i < MAX_PLAYERS; i++)
|
||||
{
|
||||
CClient* pClient = g_pClient->GetClient(i);
|
||||
CNetChan* pNetChan = pClient->GetNetChan();
|
||||
|
||||
if (!pClient || !pNetChan)
|
||||
{
|
||||
if (!pClient)
|
||||
continue;
|
||||
|
||||
CNetChan* pNetChan = pClient->GetNetChan();
|
||||
if (!pNetChan)
|
||||
continue;
|
||||
}
|
||||
|
||||
string svClientName = pNetChan->GetName(); // Get full name.
|
||||
|
||||
@ -229,12 +230,12 @@ void Host_BanID_f(const CCommand& args)
|
||||
for (int i = 0; i < MAX_PLAYERS; i++)
|
||||
{
|
||||
CClient* pClient = g_pClient->GetClient(i);
|
||||
CNetChan* pNetChan = pClient->GetNetChan();
|
||||
|
||||
if (!pClient || !pNetChan)
|
||||
{
|
||||
if (!pClient)
|
||||
continue;
|
||||
|
||||
CNetChan* pNetChan = pClient->GetNetChan();
|
||||
if (!pNetChan)
|
||||
continue;
|
||||
}
|
||||
|
||||
string svIpAddress = pNetChan->GetAddress(); // If this stays empty they modified the packet somehow.
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user