View Single Post
scorpius2k1
Senior Member
Join Date: Feb 2016
Old 09-16-2021 , 17:09   Re: [CSGO/ANY?] ForceRate
Reply With Quote #23

Quote:
Originally Posted by Peace-Maker View Post
Here's this MM:S plugin as a sourcemod plugin.
Thanks to Drifter's example for getting an engine interface.

This adds the same convar "net_forcerate" which defaults to "0" - disabled.

Edit: Added a check to verify the CNetChan::m_Rate offset is correct before trying to change it.
Great addon! I had stumbled across this post because I am having the same issues on a properly configured server and would like to enforce rates -- is it possible to use on other source engine games like CSS or even TF2? I have configured the 'net_forcerate.games.txt' properly to recognize both as a test (tf2 and css key instead of csgo), the plugin loads properly without any errors. However, it stops at at line #102 in the function SetRate. Do I maybe need different offsets, etc in the 'net_forcerate.games.txt' file to match something different? Not sure what to do otherwise.

Many thanks.

PHP Code:
void SetRate(int clientint forcerate)
{
    
Address netchannel GetPlayerNetInfo(client);
    if (
netchannel == Address_Null// Line #102, STOPS HERE AS Address_Null
        
return;

    
Address rateaddr netchannel view_as<Address>(m_RateOffset);
    if (
LoadFromAddress(rateaddrNumberType_Int32) != GetClientDataRate(client))
        
LogError("Rate offset might be wrong. Actual rate: %d, Rate at offset: %d"GetClientDataRate(client), LoadFromAddress(rateaddrNumberType_Int32));
    else
        
StoreToAddress(rateaddrforcerateNumberType_Int32);

__________________
{__ PIRATES COVE __} ● HIGH-KILL Community | Stats ●
Half-Life 2: Deathmatch
66.151.244.149:27016 => CONNECT
scorpius2k1 is offline