Raised This Month: $204 Target: $400
 51% 

[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:
    1 
    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 , 21: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, 2189 views)
    File Type: sp Get Plugin or Get Source (namechangepunisher.sp - 1730 views - 4.8 KB)
    File Type: smx namechangepunisher.smx (4.3 KB, 1737 views)
    __________________
    Am I back? Well, we'll see.

    Last edited by Powerlord; 06-17-2014 at 17:17. Reason: Updated to version 1.1
    Powerlord is offline
    Obsidian
    Senior Member
    Join Date: Jun 2011
    Old 07-05-2011 , 22: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 , 23: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.
    __________________
    Am I back? Well, we'll see.

    Last edited by Powerlord; 07-05-2011 at 23:31.
    Powerlord is offline
    Obsidian
    Senior Member
    Join Date: Jun 2011
    Old 07-06-2011 , 00: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 , 20: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 , 11: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.
    __________________
    Am I back? Well, we'll see.
    Powerlord is offline
    Powerlord
    AlliedModders Donor
    Join Date: Jun 2008
    Location: Seduce Me!
    Old 07-08-2011 , 11:50   Re: [Any] Name Change Punisher
    Reply With Quote #7

    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.
    __________________
    Am I back? Well, we'll see.

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

    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 - 429 views - 4.8 KB)
    File Type: smx namechangepunisher.smx (4.3 KB, 356 views)
    __________________
    Am I back? Well, we'll see.

    Last edited by Powerlord; 07-08-2011 at 12:34.
    Powerlord is offline
    uncivil
    Junior Member
    Join Date: Aug 2009
    Old 07-11-2011 , 18:41   Re: [ANY] Name Change Punisher (Updated 2011-07-08)
    Reply With Quote #9

    OK, I tested the SourceBans version post #8 (1.1) and I get the following errors:

    1. No Ban
    2. Spams the client console & chat with: #Name_change_limit_exceded
    3. Reports as version: "Name Change Punisher" (1.0.1) by Powerlord - (Not Version 1.1)
    4. Sourcemod error log:
    PHP Code:
    L 07/11/2011 17:21:51: [SMPlugin encountered error 4Invalid parameter or parameter type
    L 07
    /11/2011 17:21:51: [SMNative "Format" reportedTranslation failedinvalid client index 544104770
    L 07
    /11/2011 17:21:51: [SMDisplaying call stack trace for plugin "namechangepunisher.smx":
    L 07/11/2011 17:21:51: [SM]   [0]  Line 112,  D:\Projects\SourceMod\svn\namechangepunisher\addons\sourcemod\scripting\namechangepunisher.sp::OnNameChange() 
    Running:
    Metamod:Source version 1.9.0-dev - Build ID: 758:caf7d6dd8b80-dev
    SourceMod Version: 1.4.0-dev - Build ID: 3307:88825dc19d2b-dev

    This plugin will be very useful to us. Let me know if you need any other info, testing or help.

    Request: Can you have it warn the player after X times before ban? (We do have some pubbers who like to change their names a lot.)
    uncivil is offline
    Powerlord
    AlliedModders Donor
    Join Date: Jun 2008
    Location: Seduce Me!
    Old 07-12-2011 , 01:41   Re: [ANY] Name Change Punisher (Updated 2011-07-08)
    Reply With Quote #10

    Quote:
    Originally Posted by uncivil View Post
    OK, I tested the SourceBans version post #8 (1.1) and I get the following errors:

    1. No Ban
    Hmm, not good. I think it's related to #4.

    Quote:
    Originally Posted by uncivil View Post
    2. Spams the client console & chat with: #Name_change_limit_exceded
    That's actually part of TF2 itself. TF2 refers to its translation phrases as #TranslationPhrase in various messages.

    Unfortunately, as you can see, TF2 isn't actually translating that message. It could (in theory) be caused by me hooking the name change event. I'll have to test it on a server without my plugin loaded to find out.

    Quote:
    Originally Posted by uncivil View Post
    3. Reports as version: "Name Change Punisher" (1.0.1) by Powerlord - (Not Version 1.1)
    That's my fault. I meant to update the version number and didn't.

    Quote:
    Originally Posted by uncivil View Post
    4. Sourcemod error log:
    PHP Code:
    L 07/11/2011 17:21:51: [SMPlugin encountered error 4Invalid parameter or parameter type
    L 07
    /11/2011 17:21:51: [SMNative "Format" reportedTranslation failedinvalid client index 544104770
    L 07
    /11/2011 17:21:51: [SMDisplaying call stack trace for plugin "namechangepunisher.smx":
    L 07/11/2011 17:21:51: [SM]   [0]  Line 112,  D:\Projects\SourceMod\svn\namechangepunisher\addons\sourcemod\scripting\namechangepunisher.sp::OnNameChange() 
    This is likely the cause of #1 above.

    I had to check the SourceMod translations wiki to see what was wrong with it. Turns out I had the last two arguments backwards. I've attached a new version that should be fixed (and actually report as 1.1).

    Quote:
    Originally Posted by uncivil View Post
    Request: Can you have it warn the player after X times before ban? (We do have some pubbers who like to change their names a lot.)
    One of the reasons I didn't do this initially is because I thought the spammers would just disable their name change script, or just use it less, rather than being dealt with.
    Attached Files
    File Type: sp Get Plugin or Get Source (namechangepunisher.sp - 307 views - 4.8 KB)
    File Type: smx namechangepunisher.smx (4.3 KB, 414 views)
    __________________
    Am I back? Well, we'll see.

    Last edited by Powerlord; 07-12-2011 at 01:46.
    Powerlord is offline
    Reply


    Thread Tools
    Display Modes

    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:52.


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