Author Topic: Wordlist Kicker - Prevent certain words in playernames  (Read 3895 times)

0 Members and 1 Guest are viewing this topic.

Offline Decicus

  • Hero Member
  • *****
  • Posts: 547
  • Karma: 79
    • Alex Thomassen - Home
Wordlist Kicker - Prevent certain words in playernames
« on: May 05, 2014, 12:13:01 PM »
Wordlist Kicker - V1.1 - May 16th 2014
I moved the backstory to just a normal pastebin, so it won't take up so much space: https://pastebin.com/WabLuKQ0

List of features:
  • Adding/removing words from the wordlist.
  • People get kicked if their name contains a blacklisted word on join or if they change their name to contain a blacklisted word.
  • Ability to blacklist strings like URLs that contain special characters (thanks to Megiddo's string-expertise).
  • Ability to whitelist Steam ID's and connected players.
  • Configuration settings located in <Garry's Mod server root>/data/wordlist_kicker/settings.txt/

Planned features: These are features I'm not too sure how I want them to be implemented yet. Don't you worry, they will come soon.
  • Ability to change where the wordlist is saved.
  • Whitelisting users/Steam ID's that will be ignored. -- Added in v1.1
  • Non-ULib/ULX support.

Configuration (settings.txt):
  • IgnoreAdmins - Set to "yes" to ignore admins + every group that inherits from admin (including superadmins)
  • IgnoreSuperadmins - Set to "yes" to ignore superadmins + every group that inherits from superadmin

List of commands: The commands will be displayed like this: "console command" or "chat command". As of right now, all commands are silently run.
  • "ulx addword" or "!addword" - Put the word/string after the command to add* a word to the wordlist. Example: ulx addword cookie
  • "ulx removeword" or "!removeword" - Put the word/string after the command to remove* a word from the wordlist. Example: ulx removeword cookie
  • "ulx whitelist" or "!whitelist" - Put a player name after the command to whitelist a player (connected to the server) to be immune from the Wordlist Kicker. Example: ulx whitelist Decicus
  • "ulx unwhitelist" or "!unwhitelist" - Put a player name after the command to remove a player (connected to the server) from the whitelist. Example: ulx unwhitelist Decicus
  • "ulx whitelistid" or "!whitelistid" - Put a Steam ID after the command to add a Steam ID (example: STEAM_0:1:18726919) to the whitelist. Works the same way as whitelisting a player, but this way the player doesn't have to be connected to the server. Example: ulx whitelistid STEAM_0:1:18726919
  • "ulx unwhitelistid or "!unwhitelistid" - Put a Steam ID after the command to remove a Steam ID from the whitelist. Useful for removing non-connected players from the whitelist. Example: ulx unwhitelistid STEAM_0:1:18726919
* You cannot add a word that already exists in the wordlist, nor can you remove words that don't exist in the wordlist.

Requirements:

What can you use this for?:
While my main idea for this was to prevent people from having curse words in their names, there are more ways this can be useful, even if you're not trying to use it the same way I originally intended it for.
If you use the whitelisting and "IgnoreAdmins" settings properly, you can prevent admin impersonators if you have a big clan server, for example. A lot of players look for a clan tag that matches the server to find an admin, and they could easily be fooled. If your clan members are admins, you could enable the "IgnoreAdmins" setting and blacklist your clan tag. That way non-clan members wouldn't be able to use the clan tag in their names and impersonate real ones.
Your clan members won't necessarily need to be admins either, you can whitelist connected players or a Steam ID so that they also will be able to use the clan tag. Although, that can be a hassle if you have many clan members without admin powers.

Of course, this is just another example I figured out. There are probably more situations where this is useful.

Other notes/FAQ (even though I haven't gotten any questions yet):
  • The default wordlist directory is in <Garry's Mod server root>/data/wordlist_kicker/words.txt/ - I do not recommend manually editing the file.
  • Default command-access is set to SUPERADMIN - Any group that inherits superadmin will get access
  • Be careful with what words/strings you blacklist. Let's use the example "low". Anyone with the name "low," "slow", "lower", "slower" (and more words that contain "low") will also get kicked.
  • Variants of words will bypass the blacklist. Example, if you blacklist "low" then "l0w", "1ow" & "lovv" will not be detected unless you blacklist them specifically.
  • I appreciate feedback and bug reports a lot. I'm still not completely comfortable with Lua, so if you find any mistake or something I can improve, then feel free to post about it. Requests are also welcome, but I will not guarantee that I can implement them myself.

Special thanks to:
  • MrPresident for being so helpful in the old thread.
  • Megiddo for the suggestion about the ULibNameChanged hook and string library help.
  • Storm for suggesting to make this into a full addon.
Downloads:
The latest version will be attached to the post, but if you one reason or another want an older version, then all versions will be archived on a few mirrors:
Dropbox
Google Drive
Decicus.com (My website)

Links:
Git Repository (GitHub)
« Last Edit: February 29, 2016, 10:41:53 AM by Decicus »
Contact information:
E-mail: alex@thomassen.xyz.
You can also send a PM.

Offline Stickly Man!

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 1266
  • Karma: 166
  • open(my $file, "<README") or die;
    • XGUI
Re: Wordlist Kicker - Prevent certain words in playernames
« Reply #1 on: May 17, 2014, 12:40:41 AM »
Nice work! :) I love seeing community contributions come together, and I'm glad our community could help you with your coding endeavors!  ;D
"The stupidity of an individual on the Internet is generally matched only the by size of their ego, unless the individual in question is unaware of both." - Me

Offline Decicus

  • Hero Member
  • *****
  • Posts: 547
  • Karma: 79
    • Alex Thomassen - Home
Re: Wordlist Kicker - Prevent certain words in playernames
« Reply #2 on: May 17, 2014, 01:48:29 AM »
Nice work! :) I love seeing community contributions come together, and I'm glad our community could help you with your coding endeavors!  ;D
Thanks, Stickly. Yes, the community has helped me a lot in the past, and probably more in the future. Happy to be part of it!
Contact information:
E-mail: alex@thomassen.xyz.
You can also send a PM.