Raised This Month: $ Target: $400
 0% 

[TF2] Anti Server Lagger (net_chan_limit_msec from csgo)


Post New Thread Reply   
 
Thread Tools Display Modes
Author
backwards
AlliedModders Donor
Join Date: Feb 2014
Location: USA
Plugin ID:
8033
Plugin Version:
1.0
Plugin Category:
All
Plugin Game:
Team Fortress 2
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Adds a convar to set the max processing time on incoming player packets to prevent lag exploits in tf2.
    Old 04-19-2022 , 05:06   [TF2] Anti Server Lagger (net_chan_limit_msec from csgo)
    Reply With Quote #1

    Here's a plugin I wrote for team fortress 2 that introduces a function added to csgo a while ago. This plugin automatically kicks users that use excessive processing time on the server when processing their network packets. This is commonly used inside hacks that have various engine level exploits that can make the server lag/stutter while they are connected. This works well to block many current and undiscovered future exploits that will pop up over time or migrate from other source engine games.

    The convar to control the max allowed packet processing time is `net_chan_limit_msec` which defaults at 20 (20ms). This may be an aggressive start value and is probably fine to increase up to 150. It's possible based on how some plugins work that normal users can be falsely kicked just by invoking a poorly written function. Something like a mysql database connection that's single threaded when a user types a command to retreive stats. Since it's single threaded it would spend a lot of milliseconds waiting for the mysql server to respond. This could show up as a big spike and kick the user. If you have these types of conflicts then i would recommend increasing the value of `net_chan_limit_msec`to have a higher threshold or try to resolve the issue in the target plugin.

    THIS PLUGIN HAS NOT BEEN TESTED VERY WELL:
    I don't play tf2 at all, so if you guys run into any issues just leave feedback here for possible fixes.

    This plugin requires dhooks with detour support. I'm unaware if the current shipping dhooks (1.11.6820 and later) has detour support in it or not. Here's a link where you can get dhooks with detour support versions if the plugin fails to load.

    https://forums.alliedmods.net/showpo...&postcount=589

    (sappho may release a slightly different but very similar version as we collaborated a bit on this through discord and I just wanted a simplified light weight version release.)


    This plugin is no longer needed as valve added an official version of net_chan_limit_msec to TF2 on 7/7/2022
    Attached Files
    File Type: zip Anti Server Lagger [TF2] ready.zip (378.9 KB, 154 views)
    File Type: sp Get Plugin or Get Source (AntiServerLagger.sp - 159 views - 3.5 KB)
    File Type: txt AntiServerLagger.txt (1.2 KB, 143 views)

    Last edited by backwards; 07-07-2022 at 21:44.
    backwards is offline
    Old Bill
    Junior Member
    Join Date: Jun 2020
    Old 04-19-2022 , 05:36   Re: [TF2] Anti Server Lagger (net_chan_limit_msec from csgo)
    Reply With Quote #2

    Thank you for this wonderful plugin!
    Old Bill is offline
    USER555
    Member
    Join Date: Aug 2020
    Location: Thailand
    Old 08-01-2022 , 07:17   Re: [TF2] Anti Server Lagger (net_chan_limit_msec from csgo)
    Reply With Quote #3

    Thanks
    USER555 is offline
    JLmelenchon
    Senior Member
    Join Date: Mar 2019
    Old 08-01-2022 , 08:49   Re: [TF2] Anti Server Lagger (net_chan_limit_msec from csgo)
    Reply With Quote #4

    L4D2 version ?
    JLmelenchon is offline
    backwards
    AlliedModders Donor
    Join Date: Feb 2014
    Location: USA
    Old 08-01-2022 , 18:41   Re: [TF2] Anti Server Lagger (net_chan_limit_msec from csgo)
    Reply With Quote #5

    Quote:
    Originally Posted by JLmelenchon View Post
    L4D2 version ?
    Valve added the same feature to L4D2 already controlled under the convar net_chan_limit_msec
    __________________
    I highly recommend joining the SourceMod Discord Server for real time support.
    backwards is offline
    Mr. Man
    Veteran Member
    Join Date: Mar 2011
    Location: Huh?
    Old 08-01-2022 , 20:29   Re: [TF2] Anti Server Lagger (net_chan_limit_msec from csgo)
    Reply With Quote #6

    Quote:
    Originally Posted by backwards View Post
    Valve added the same feature to L4D2 already controlled under the convar net_chan_limit_msec
    Also for more info: https://developer.valvesoftware.com/...han_limit_msec

    Code:
    net_chan_limit_msec                      : 0        :                  : Netchannel processing is limited to so many milliseconds, abort connection if exceeding budget
    __________________
    Mr. Man is offline
    JLmelenchon
    Senior Member
    Join Date: Mar 2019
    Old 08-01-2022 , 22:20   Re: [TF2] Anti Server Lagger (net_chan_limit_msec from csgo)
    Reply With Quote #7

    0 is unlimited i suppose
    JLmelenchon is offline
    JLmelenchon
    Senior Member
    Join Date: Mar 2019
    Old 08-06-2022 , 21:31   Re: [TF2] Anti Server Lagger (net_chan_limit_msec from csgo)
    Reply With Quote #8

    Well 150 is not fine at all on L4D2, even much higher kick you.

    Last edited by JLmelenchon; 08-07-2022 at 05:38.
    JLmelenchon is offline
    JLmelenchon
    Senior Member
    Join Date: Mar 2019
    Old 10-10-2022 , 12:08   Re: [TF2] Anti Server Lagger (net_chan_limit_msec from csgo)
    Reply With Quote #9

    Is it usual that packet processing time is constantly 0.00 ?
    JLmelenchon is offline
    Reply



    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 21:32.


    Powered by vBulletin®
    Copyright ©2000 - 2024, vBulletin Solutions, Inc.
    Theme made by Freecode