mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-11-24 22:11:04 +00:00
Cleanly remove player after triggering rapidfire anticheat
Previously, the socket was killed but the player was still technically present.
This commit is contained in:
parent
8326ea6e26
commit
bb12a60e04
@ -74,8 +74,12 @@ static void pcAttackNpcs(CNSocket *sock, CNPacketData *data) {
|
||||
if (pkt->iNPCCnt > 3) // 3+ targets should never be possible
|
||||
plr->suspicionRating += 10000;
|
||||
|
||||
if (plr->suspicionRating > 10000) // kill the socket when the player is too suspicious
|
||||
if (plr->suspicionRating > 10000) { // kill the socket when the player is too suspicious
|
||||
sock->kill();
|
||||
CNShardServer::_killConnection(sock);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* IMPORTANT: This validates memory safety in addition to preventing
|
||||
@ -625,8 +629,11 @@ static void projectileHit(CNSocket* sock, CNPacketData* data) {
|
||||
|
||||
plr->lastShot = currTime;
|
||||
|
||||
if (plr->suspicionRating > 10000) // kill the socket when the player is too suspicious
|
||||
if (plr->suspicionRating > 10000) { // kill the socket when the player is too suspicious
|
||||
sock->kill();
|
||||
CNShardServer::_killConnection(sock);
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* initialize response struct
|
||||
|
Loading…
Reference in New Issue
Block a user