feat: set max value of sv_network_fps

This commit is contained in:
Diavolo 2023-12-04 00:37:02 +01:00
parent c743b2f814
commit 3aebdde5c6

View File

@ -13,7 +13,7 @@ namespace dvars_patches
{
void patch_dvars()
{
(void)game::register_sessionmode_dvar_bool("com_pauseSupported", !game::is_server(), game::DVAR_SERVERINFO, "Whether is pause is ever supported by the game mode");
(void)game::register_sessionmode_dvar_bool("com_pauseSupported", !game::is_server(), game::DVAR_SERVERINFO, "Whether pause is supported by the game mode");
}
void patch_flags()
@ -59,14 +59,24 @@ namespace dvars_patches
scheduler::once(patch_dvars, scheduler::pipeline::main);
scheduler::once(patch_flags, scheduler::pipeline::main);
if (game::is_server())
{
return;
}
if (game::is_client()) this->patch_client();
else this->patch_server();
}
static void patch_client()
{
// toggle ADS dof based on r_dof_enable
utils::hook::jump(0x141116EBB_g, utils::hook::assemble(dof_enabled_stub));
}
static void patch_server()
{
// Set the max value of 'sv_network_fps'
utils::hook::set<uint32_t>(0x140534FE7_g, 1000);
// Set the flag of 'sv_network_fps'
utils::hook::set<uint32_t>(0x140534FD8_g, game::DVAR_NONE);
}
};
}