AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [ANY] Name Change Punisher (Updated 2011-07-13) (https://forums.alliedmods.net/showthread.php?t=161320)

Powerlord 07-05-2011 20:32

[ANY] Name Change Punisher (Updated 2011-07-13)
 
6 Attachment(s)
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.

Obsidian 07-05-2011 21:14

Re: [ANY] Name Change Punisher
 
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.

Powerlord 07-05-2011 22:27

Re: [ANY] Name Change Punisher
 
Quote:

Originally Posted by Obsidian (Post 1504606)
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 (Post 1504606)
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.

Obsidian 07-05-2011 23:39

Re: [ANY] Name Change Punisher
 
Quote:

Originally Posted by Powerlord (Post 1504638)
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 07-07-2011 19:18

Re: [Any] Name Change Punisher
 
Been running fine for some time now without running into any problems. Haven't hit it kicking anyone incorrectly as of yet.

Powerlord 07-08-2011 10:22

Re: [Any] Name Change Punisher
 
I need to investigate the interaction between this plugin and SourceBans. I have a feeling SourceBans isn't catching bans set by this.

Powerlord 07-08-2011 10:50

Re: [Any] Name Change Punisher
 
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.

Powerlord 07-08-2011 11:30

Re: [ANY] Name Change Punisher (Updated 2011-07-08)
 
2 Attachment(s)
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.

uncivil 07-11-2011 17:41

Re: [ANY] Name Change Punisher (Updated 2011-07-08)
 
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.)

Powerlord 07-12-2011 00:41

Re: [ANY] Name Change Punisher (Updated 2011-07-08)
 
4 Attachment(s)
Quote:

Originally Posted by uncivil (Post 1508740)
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 (Post 1508740)
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 (Post 1508740)
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 (Post 1508740)
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 (Post 1508740)
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.


All times are GMT -4. The time now is 00:27.

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