rehlds
rehlds copied to clipboard
client fps limiter
hello masters of rehlds, is it possible to add a client fps limiter to rehlds? here is a very primitive example:
void SV_RunCmd(usercmd_t *ucmd, int random_seed)
{
usercmd_t cmd = *ucmd;
...
if ((1.0 / ((double)ucmd->msec * 0.001) > 100.0)) {
// bail out if more than 100 fps
return;
}
similar to the spam block in void SV_FullUpdate_f(void)
- is that a reasonable way of detecting fps? worked for my tests
- where is the best place to put this block?
SV_RunCmd
is called byPF_RunPlayerMove_I
- from my tests all actions are blocked if > 100 fps, would it be possible to process only a up to limit of 100 fps and drop the overload?
Of course, it will be a great addition.
Best addition will be to prevent users having too powerful hardware and who can handle +200 FPS all the time, to ... join servers! But, "that-is-not-great" huh! So, me, I play with "fps_max" to "200", because I want a more fluid game, but you will not allow me to huh?! You sadist!
Just code a plugin (with hook of "pfnUpdateClientData", or/and, with CVars "fps_override" & "fps_max" queries) for such vicious thing!
Just code a plugin (with hook of "pfnUpdateClientData", or/and, with CVars "fps_override" & "fps_max" queries) for such vicious thing!
the values of the cvars can be spoofed, are not reliable, I want to control only from the server side. We also limit rate and updaterate, cmdrate, is that sadistic too? Its only logical to limit client fps as well. It is relevant on servers with multi jumps, parachute, etc. that allow high fps players to move faster, cause their code runs more often
idiots block protectors, cl_filterstuffcmd and fps! leave cs!!
idiots block protectors, cl_filterstuffcmd and fps! leave cs!!
wtf are you rambling idiot?
Just code a plugin (with hook of "pfnUpdateClientData", or/and, with CVars "fps_override" & "fps_max" queries) for such vicious thing!
the values of the cvars can be spoofed, are not reliable, I want to control only from the server side. We also limit rate and updaterate, cmdrate, is that sadistic too? Its only logical to limit client fps as well. It is relevant on servers with multi jumps, parachute, etc. that allow high fps players to move faster, cause their code runs more often
get_uc(uc_handle, UC_Msec); gives an accurate framerate, see https://forums.alliedmods.net/showthread.php?t=123302
from my tests all actions are blocked if > 100 fps, would it be possible to process only a up to limit of 100 fps and drop the overload?
Technically? Yes.
Actually? No, client prediction will break.
Instead you could just zero out movement and notify the user.
For this reason (no clean fix on the server side), this is absolutely not something ReHLDS should be doing. Just write a module for it.