mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-11-17 03:20:06 +00:00
Get rid of player fire rate suspicion
This was super primitive & jank, and caused false positives. Will replace with a polished system later on.
This commit is contained in:
parent
85bb4d163e
commit
0e8a4742eb
@ -590,21 +590,6 @@ static void projectileHit(CNSocket* sock, CNPacketData* data) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// rapid fire anti-cheat
|
|
||||||
time_t currTime = getTime();
|
|
||||||
if (currTime - plr->lastShot < plr->fireRate * 80)
|
|
||||||
plr->suspicionRating += plr->fireRate * 100 + plr->lastShot - currTime; // gain suspicion for rapid firing
|
|
||||||
else if (currTime - plr->lastShot < plr->fireRate * 180 && plr->suspicionRating > 0)
|
|
||||||
plr->suspicionRating += plr->fireRate * 100 + plr->lastShot - currTime; // lose suspicion for delayed firing
|
|
||||||
|
|
||||||
plr->lastShot = currTime;
|
|
||||||
|
|
||||||
if (plr->suspicionRating > 10000) { // kill the socket when the player is too suspicious
|
|
||||||
sock->kill();
|
|
||||||
CNShardServer::_killConnection(sock);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* initialize response struct
|
* initialize response struct
|
||||||
* rocket style hit doesn't work properly, so we're always sending this one
|
* rocket style hit doesn't work properly, so we're always sending this one
|
||||||
|
Loading…
Reference in New Issue
Block a user