mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
NetworkSystem: fix network address comparisons
Network addresses should always be stored as base only (without their port numbers), since all additional data can change on reconnects which will make comparisons impossible.
This commit is contained in:
parent
5584c2a87f
commit
a5bd66513a
@ -324,7 +324,7 @@ void CBanSystem::AuthorPlayerByName(const char* playerName, const bool shouldBan
|
|||||||
{
|
{
|
||||||
if (strcmp(playerName, pNetChan->GetName()) == NULL) // Our wanted name?
|
if (strcmp(playerName, pNetChan->GetName()) == NULL) // Our wanted name?
|
||||||
{
|
{
|
||||||
if (shouldBan && AddEntry(pNetChan->GetAddress(), pClient->GetNucleusID()) && !bSave)
|
if (shouldBan && AddEntry(pNetChan->GetAddress(true), pClient->GetNucleusID()) && !bSave)
|
||||||
bSave = true;
|
bSave = true;
|
||||||
|
|
||||||
pClient->Disconnect(REP_MARK_BAD, reason);
|
pClient->Disconnect(REP_MARK_BAD, reason);
|
||||||
@ -389,7 +389,7 @@ void CBanSystem::AuthorPlayerById(const char* playerHandle, const bool shouldBan
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (shouldBan && AddEntry(pNetChan->GetAddress(), pClient->GetNucleusID()) && !bSave)
|
if (shouldBan && AddEntry(pNetChan->GetAddress(true), pClient->GetNucleusID()) && !bSave)
|
||||||
bSave = true;
|
bSave = true;
|
||||||
|
|
||||||
pClient->Disconnect(REP_MARK_BAD, reason);
|
pClient->Disconnect(REP_MARK_BAD, reason);
|
||||||
@ -397,10 +397,12 @@ void CBanSystem::AuthorPlayerById(const char* playerHandle, const bool shouldBan
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (strcmp(playerHandle, pNetChan->GetAddress()) != NULL)
|
const char* const chanAddr = pNetChan->GetAddress(true);
|
||||||
|
|
||||||
|
if (strcmp(playerHandle, chanAddr) != NULL)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (shouldBan && AddEntry(pNetChan->GetAddress(), pClient->GetNucleusID()) && !bSave)
|
if (shouldBan && AddEntry(chanAddr, pClient->GetNucleusID()) && !bSave)
|
||||||
bSave = true;
|
bSave = true;
|
||||||
|
|
||||||
pClient->Disconnect(REP_MARK_BAD, reason);
|
pClient->Disconnect(REP_MARK_BAD, reason);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user