sapphonie / StAC-tf2

steph's anticheat (StAC). a built-from-scratch sourcemod based solution to cheating in Team Fortress 2.
https://sappho.io
GNU General Public License v3.0
120 stars 23 forks source link

interval duration of cvar checks #1

Closed skibz closed 5 years ago

skibz commented 5 years ago

i see that the plugin is programmed to check after fifteen seconds from the plugin's init, and then it begins checking at random intervals of one to five minutes.

is there a reason for making the subsequent intervals random? (like server performance concerns, or something?)

if not, perhaps it'd be better to make this interval more frequent and not random, like say every thirty seconds (or less even, if possible) as players could be using binds to change their rates for short periods of time.

sapphonie commented 5 years ago

This plugin was originally forked from integritf2. In that plugin, client cvars get checked every time a player spawns, which worked great except for the fact that it would absolutely crush a server's CPU (and sometimes crash the server) while soap dm was enabled because players die and respawn very quickly in soap dm and then would then have their cvars checked every single time they respawned.

integritf2 also had a random timer in it for cvar checking, but it was between 15 and 60 seconds. the reason it isn't still 15-60 seconds is that i'm worried about cpu usage on checking all clients that often. on an 18 person server it can get pretty intensive pretty quickly. what i'd LIKE to do is have a random timer per client at somewhere around every 30ish (maybe 15-45 seconds, so that the load would be randomly spread out on individual clients instead of happening all at once every 15-60 seconds on all clients at the same time. until then, i'd have to do some tests in pugs or something before i'd feel comfortable lowering it as low as 15 - 60 seconds.

skibz commented 5 years ago

your explanation now has me quite interested in possible methods for profiling srcds performance.

but yeah, that seems like a pretty reasonable strategy. i'm excited to see how you decide to write it! 😄

and for what it's worth, i'd be happy to assist in any way if you ever need a guinea pig or someone to help corroborate your findings. i'm operating my own server(s) for 6v6 play in the southern africa region.

sapphonie commented 4 years ago

implemented a couple commits ago