Originally Posted by Peace-Maker
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.
void SetRate(int client, int forcerate)
Address netchannel = GetPlayerNetInfo(client);
if (netchannel == Address_Null) // Line #102, STOPS HERE AS Address_Null
Address rateaddr = netchannel + view_as<Address>(m_RateOffset);
if (LoadFromAddress(rateaddr, NumberType_Int32) != GetClientDataRate(client))
LogError("Rate offset might be wrong. Actual rate: %d, Rate at offset: %d", GetClientDataRate(client), LoadFromAddress(rateaddr, NumberType_Int32));
StoreToAddress(rateaddr, forcerate, NumberType_Int32);