Raised This Month: $32 Target: $400
 8% 

[ANY] Name Change Punisher (Updated 2011-07-13)


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Plugin ID:
2427
Plugin Version:
1.1
Plugin Category:
Server Management
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    If a user changes names too many many times within a certain amount of time of each other, kick or ban them.
    Old 07-05-2011 , 20:32   [ANY] Name Change Punisher (Updated 2011-07-13)
    Reply With Quote #1

    My servers have had an influx of spammers who use name changing scripts as of recently.

    Therefore, I wrote a quick script to help get rid of them.

    What it does is track name changes, and if X name changes happen within Y seconds of each other, it kicks or bans them.

    This plugin was tested on Team Fortress 2.

    On games that support sv_namechange_cooldown_seconds (HL2:DM, DoD:S, CS:S, TF2, and possibly others):
    You should adjust the ncp_detectiontime based on the values you use for sv_namechange_cooldown_seconds. For instance, if sv_namechange_cooldown_seconds is 20 (the default), ncp_detectiontime should be somewhere between 25 and 30.

    The above should be considered mandatory to block LMAOBox.

    Changelog:
    • 1.1 - SourceBans will now be used if present.
    • 1.0.2 - Fixed ban not working properly because of a mistake in the translation handling.
    • 1.0.1 - Added ban source of "ncp" so that the OnBanClient hook fires.
    • 1.0 - Initial release.
    Installation:
    1. Copy namechangepunisher.phrases.txt into addons/sourcemod/translations/ (possibly updated with translations later)
    2. Copy namechangepunisher.smx into addons/sourcemod/plugins/
    Configuration:

    This plugin creates a configuration file: cfg/sourcemod/namechangepunisher.cfg
    The following convars exist in this plugin:
    • ncp_detections [val] (min 3, max 20, def 5) - Number of detections before taking action
    • ncp_detectiontime [val] (min 5. max 60, def 10) - Max length of time in seconds between detections before counter resets
    • ncp_punishmode [0/1] (def 1) - 0 = Kick, 1 = Ban.
    • ncp_banlength [val] (def 60) - If ncp_punishmode is 1, how many minutes to ban for? 0 means indefinitely.
    • ncp_debug [0/1] (def 0) - Show debug information when names are changed. This may disappear in later versions, it's mainly present in case there are problems with the plugin, server admins can see what's going on and report any strange behavior they see.
    • ncp_version [val] (def 1.0) - Name Change Punisher version
    Commands: There are none.

    At present there is no cvar to disable the plugin.

    FAQ:
    Q. Why is it amount of time between detections and not the number of detections in a certain amount of time?
    A. That would add a lot of complexity to the plugin, mainly with having to track ncp_detections -1 timestamps for each user that has changed their names. For performance reasons, it's recommended in SourcePawn that you don't re-index arrays.

    Get Plugin link does not work because this plugin requires SourceBans include file sourcebans.inc.
    Attached Files
    File Type: txt namechangepunisher.phrases.txt (150 Bytes, 2556 views)
    File Type: sp Get Plugin or Get Source (namechangepunisher.sp - 2127 views - 4.8 KB)
    File Type: smx namechangepunisher.smx (4.3 KB, 2072 views)
    __________________
    Not currently working on SourceMod plugin development.

    Last edited by Powerlord; 06-17-2014 at 16:17. Reason: Updated to version 1.1
    Powerlord is offline
    Obsidian
    Senior Member
    Join Date: Jun 2011
    Old 07-05-2011 , 21:14   Re: [ANY] Name Change Punisher
    Reply With Quote #2

    Quote:
    ncp_detectiontime [val] (min 5. max 60, def 10) - Max length of time between detections before counter resets
    Min 5...what? 5 seconds? 5 minutes? Might help if you directly identified the time unit in use here. I can infer that it's in seconds myself, but someone else might not be able to figure that out themselves.

    Anyways, installing this myself; I heard about what happened on OCR from Gamemaster, and I'm glad you've made this to combat the problem.
    I'll report back with feedback if I find anything.
    Obsidian is offline
    Powerlord
    AlliedModders Donor
    Join Date: Jun 2008
    Location: Seduce Me!
    Old 07-05-2011 , 22:27   Re: [ANY] Name Change Punisher
    Reply With Quote #3

    Quote:
    Originally Posted by Obsidian View Post
    Min 5...what? 5 seconds? 5 minutes? Might help if you directly identified the time unit in use here. I can infer that it's in seconds myself, but someone else might not be able to figure that out themselves.
    Seconds. Sorry, I apparently dropped that from the description of that cvar at some point. Whoops.

    The cvar description in the plugin will be fixed in the next release as well.

    Quote:
    Originally Posted by Obsidian View Post
    Anyways, installing this myself; I heard about what happened on OCR from Gamemaster, and I'm glad you've made this to combat the problem.
    I'll report back with feedback if I find anything.
    It wasn't the first time this had happened. I thought about writing a plugin to detect when they use the same nick as someone else on the server, but I was under the impression that the server already supports that, so they are using non-printable characters in their names to pad it.
    __________________
    Not currently working on SourceMod plugin development.

    Last edited by Powerlord; 07-05-2011 at 22:31.
    Powerlord is offline
    Obsidian
    Senior Member
    Join Date: Jun 2011
    Old 07-05-2011 , 23:39   Re: [ANY] Name Change Punisher
    Reply With Quote #4

    Quote:
    Originally Posted by Powerlord View Post
    I thought about writing a plugin to detect when they use the same nick as someone else on the server, but I was under the impression that the server already supports that, so they are using non-printable characters in their names to pad it.
    The percent symbol trick, I take it?
    Obsidian is offline
    Obsidian
    Senior Member
    Join Date: Jun 2011
    Old 07-07-2011 , 19:18   Re: [Any] Name Change Punisher
    Reply With Quote #5

    Been running fine for some time now without running into any problems. Haven't hit it kicking anyone incorrectly as of yet.
    Obsidian is offline
    Powerlord
    AlliedModders Donor
    Join Date: Jun 2008
    Location: Seduce Me!
    Old 07-08-2011 , 10:22   Re: [Any] Name Change Punisher
    Reply With Quote #6

    I need to investigate the interaction between this plugin and SourceBans. I have a feeling SourceBans isn't catching bans set by this.
    __________________
    Not currently working on SourceMod plugin development.
    Powerlord is offline
    moxie2020
    Veteran Member
    Join Date: Aug 2011
    Old 09-28-2011 , 21:33   Re: [Any] Name Change Punisher
    Reply With Quote #7

    Quote:
    Originally Posted by Powerlord View Post
    I need to investigate the interaction between this plugin and SourceBans. I have a feeling SourceBans isn't catching bans set by this.
    I can verify that... Had a namechanger join it did say it banned him but nothing is reported in sourcebans.
    moxie2020 is offline
    Powerlord
    AlliedModders Donor
    Join Date: Jun 2008
    Location: Seduce Me!
    Old 09-28-2011 , 21:34   Re: [Any] Name Change Punisher
    Reply With Quote #8

    Quote:
    Originally Posted by moxie2020 View Post
    I can verify that... Had a namechanger join it did say it banned him but nothing is reported in sourcebans.
    That's strange, version 1.1 should be aware of SourceBans and use the SourceBans ban method instead of the server's ban method.

    Do the server logs say anything about the ban?
    __________________
    Not currently working on SourceMod plugin development.
    Powerlord is offline
    Powerlord
    AlliedModders Donor
    Join Date: Jun 2008
    Location: Seduce Me!
    Old 07-08-2011 , 10:50   Re: [Any] Name Change Punisher
    Reply With Quote #9

    Updated to version 1.0.1

    I updated the plugin to have a command source for bans.

    Unfortunately, my understanding of SourceBans is that it doesn't catch bans set using BanClient or BanIdentity. Sadly, this plugin uses BanClient.

    However, this update will make the OnBanClient hook work so other plugins can catch when this ban occurs.

    Edit: SourceBans expects plugins to send bans to it via its own native. Stupid, stupid, stupid. Then again, SourceBans is in desperate need of a rewrite now that nearly everything uses SourceMod 1.3 or newer.
    __________________
    Not currently working on SourceMod plugin development.

    Last edited by Powerlord; 07-08-2011 at 11:20.
    Powerlord is offline
    Powerlord
    AlliedModders Donor
    Join Date: Jun 2008
    Location: Seduce Me!
    Old 07-08-2011 , 11:30   Re: [ANY] Name Change Punisher (Updated 2011-07-08)
    Reply With Quote #10

    I've written a version that uses SourceBans if it's present, but I need to do some testing tonight to make sure it works.

    I've attached it to this post (it reports as version 1.1), but the main post won't be updated until I make sure it works.

    Also, it likely won't compile using the web compiler because it uses sourcebans.inc, so I also included the .smx file.
    Attached Files
    File Type: sp Get Plugin or Get Source (namechangepunisher.sp - 636 views - 4.8 KB)
    File Type: smx namechangepunisher.smx (4.3 KB, 579 views)
    __________________
    Not currently working on SourceMod plugin development.

    Last edited by Powerlord; 07-08-2011 at 11:34.
    Powerlord 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 22:03.


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