View Single Post
Author Message
Liam
SourceMod Developer
Join Date: Jan 2008
Location: Atlanta, GA
Old 04-24-2008 , 14:26   High Ping Kicker
Reply With Quote #1

/* Notes */
This plugin was written to enable server admins to enforce a maximum ping that players can have. It takes the players cmdrate and the servers tickrate into account when doing this. It will not check players who are currently connecting or are not on a team.

Server Config Information: http://forums.srcds.com/viewtopic/1094 -- Thanks to |GsX| GrimReaper for finding that article.

This plugin has been compiled and tested on both non-orange box and the orange box servers, and requires SM 1.0.x or 1.1.x. Those can be downloaded at: http://www.sourcemod.net/snapshots.php

Thanks to BAILOPAN, k41m, Tsunami, Teame06, and EKS for their help in this.

/* Installation */
Compile the file attached and put it in the addons\sourcemod\plugins folder. Then go to your rcon and type sm plugins load hpk or simply change the map.

Make sure that you edit the config file in <mod>/cfg/sourcemod/hpk.cfg to set the max ping you want. The default is 150. This file is auto-generated the first time you run the plugin.

CVars:
sm_checkping "1" -- Check players ping. 1 = on, 0 = off.
sm_checkchoke "1" -- Check players choke. 1 = on, 0 = off.
sm_checkloss "1" -- Check players loss. 1 = on, 0 = off.
sm_checkpackets "1" -- Check players packets. 1 = on. 0 = off.

sm_maxping "150" -- This is the max ping clients are allowed.
sm_maxchoke "30.0" -- Max choke allowed by clients.
sm_maxloss "30.0" -- Max loss allowed by clients.
sm_minpacketin "30.0" -- Minimum packets in allowed by clients.
sm_minpacketout "55.0" -- Minimum packets out allowed by clients.

sm_ping_admins_immune "1" -- Admins are immune? 1 = Yes, 2 = No


/* Changelog */
1.0 - Initial Release
1.1 - Added logging about who was kicked to the SM Logs.
- Added a better delay timer for joining people.
- Adjusted extension code to give a more accurate ping.
2.0 - Total rewrite
- Added tracking cvar.
- Removed the extension and ported to native SourceMod
- Reconfigured kick messages to show current ping and max ping.
2.1
- Corrected an issue with the timer that was causing it to run multiple times after a series of map changes. This was causing almost instantaneous kicks for people who's ping spiked even a single time.
- Made the code a bit more efficient in dealing with map changes and delay.
2.2
- Fixed an exploit in the mis-calculation of players ping if they were spoofing their cmdrate to ultra-low levels.
2.4
- Added support for HL2DM
- Added the beginnings of the choke/loss/rates system (Currently disabled)
- Added sm_rates command (sm_rates | sm_rates <target>)
2.5
- Added the translation file to OnPluginStart to fix issues with TargetClient.
- Fixed a bug in the sm_maxping cvar not being used properly.
2.6
- Added support for Choke, Loss, Packets In, and Packets Out
- Cleaned the code up for efficiency
- Added in new cVars to configure Ping, Choke, Loss, Min. Packets In, and Min. Packets Out.
2.7
- Added 4 new cVars to enable/disable each function of the plugin.
- Suggestion is to remove hpk.cfg and generate a new one on a clean restart of the server to generate the new options.
2.8
- Changed the output formatting from int variables to float variables in their appropriate places.
2.9
- Fixed a bug in the code that handles checking and then kicking players. Thanks for finding this Flyflo.
Attached Files
File Type: sp Get Plugin or Get Source (hpk.sp - 8586 views - 12.1 KB)

Last edited by Liam; 10-17-2008 at 14:23.
Liam is offline