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

[ANY] Regex Name Filter


Post New Thread Reply   
 
Thread Tools Display Modes
Author
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Plugin ID:
4470
Plugin Version:
1.0.0
Plugin Category:
General Purpose
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Uses regex filters to replace characters in names, or swap in replacement names
    Old 12-30-2014 , 07:53   [ANY] Regex Name Filter
    Reply With Quote #1

    This is a simple plugin I made ages ago but never used. It should work.

    Commands:
    Code:
    sm_reloadnames - reloads the configuration file
    Configuration: namefilter.txt (place in sourcemod/configs)
    Code:
    "filters"
    {                                                                           // cvar: sv_namechange_cooldown_seconds X - will limit how often people can change names on your server
        "censor"    "*"                                                         // this is what the filtered characters are replaced by, do "" to just remove them
        "filter"    "[^A-Za-z0-9\s!@#$%^&*()_+=-`~\\\]\[{}|';:/.,?><]"         // regex expression for filtering, matches are replaced by the censor, here we are using a whitelist - this would strip unicode characters
        
        "banned"                                                                // series of regex expressions for names POST FILTER, matches will get replacement names
        {
            "1" "f+[a4]+g+[ao0]+t*"
            "2" "n[i!1]+gger*"
            "3" "anotherbadword"
        }
        
        "names"                                                                  // replacement names, granted by banned filter, or if the name is too short (<2)
        {
            "1" "Peggy"
            "2" "Kelly"
            "3" "Marcy"
            "4" "Steve"
            "5" "Jefferson"
        }
    }
    Attached Files
    File Type: sp Get Plugin or Get Source (namefilter.sp - 1258 views - 7.0 KB)
    __________________
    Profile - Plugins
    Add me on steam if you are seeking sp/map/model commissions.

    Last edited by friagram; 12-30-2014 at 10:52.
    friagram is offline
    Mitchell
    ~lick~
    Join Date: Mar 2010
    Old 12-30-2014 , 09:35   Re: [ANY] Regex Name Filter
    Reply With Quote #2

    "anotherbadword"
    to
    "3" "anotherbadword"
    or the config will blow up?
    edit: nvm read the code, it will just ignore it, right?

    Last edited by Mitchell; 12-30-2014 at 09:36.
    Mitchell is offline
    friagram
    Veteran Member
    Join Date: Sep 2012
    Location: Silicon Valley
    Old 12-30-2014 , 10:49   Re: [ANY] Regex Name Filter
    Reply With Quote #3

    Nope its a mistake for sure
    I just didn't want to post a litany of swears here...
    __________________
    Profile - Plugins
    Add me on steam if you are seeking sp/map/model commissions.

    Last edited by friagram; 12-30-2014 at 10:53.
    friagram is offline
    Nysho
    Junior Member
    Join Date: Nov 2014
    Old 01-14-2015 , 00:27   Re: [ANY] Regex Name Filter
    Reply With Quote #4

    it would be amazing if you could do, only english name is acceptable.
    Nysho is offline
    friagram
    Veteran Member
    Join Date: Sep 2012
    Location: Silicon Valley
    Old 01-14-2015 , 03:03   Re: [ANY] Regex Name Filter
    Reply With Quote #5

    Quote:
    Originally Posted by Nysho View Post
    it would be amazing if you could do, only english name is acceptable.
    No real way to do that other than by making some kind of whitelist and dictionary search, which is it practical.
    __________________
    Profile - Plugins
    Add me on steam if you are seeking sp/map/model commissions.
    friagram is offline
    Nysho
    Junior Member
    Join Date: Nov 2014
    Old 01-15-2015 , 20:58   Re: [ANY] Regex Name Filter
    Reply With Quote #6

    Quote:
    Originally Posted by friagram View Post
    No real way to do that other than by making some kind of whitelist and dictionary search, which is it practical.
    any idea how could i change names that doesn't have this in

    Code:
    "filter"    "[^A-Za-z0-9\s!@#$%^&*()_+=-`~\\\]\[{}|';:/.,?><]"
    to the one i decide

    because i realized that alot people try to get away from the ban by changing their name into
    Code:
    ?
    Code:
    #
    Code:
    %
    which is quite hard to ban them unless i find their "steamid"
    Nysho is offline
    friagram
    Veteran Member
    Join Date: Sep 2012
    Location: Silicon Valley
    Old 01-16-2015 , 13:31   Re: [ANY] Regex Name Filter
    Reply With Quote #7

    Try something like this, http://www.regextester.com
    Basically it uses a regular expression to filter the name. If you don't want them using special characters, use something like "[^A-Za-z0-9\s]", then they can use letters, numbers, and spaces only.
    __________________
    Profile - Plugins
    Add me on steam if you are seeking sp/map/model commissions.

    Last edited by friagram; 01-16-2015 at 13:31.
    friagram is offline
    Schpraaankiii
    Veteran Member
    Join Date: Dec 2009
    Location: Sweden Norrköping
    Old 02-17-2015 , 15:13   Re: [ANY] Regex Name Filter
    Reply With Quote #8

    What do I change the filter to if I want the players to be able to use unicode symbols?
    __________________
    CAOSK-ESPORTS.COM
    Schpraaankiii is offline
    Send a message via Skype™ to Schpraaankiii
    mikma
    Junior Member
    Join Date: Apr 2015
    Old 04-15-2015 , 07:46   Re: [ANY] Regex Name Filter
    Reply With Quote #9

    Doesn't seem to work that perfectly ...

    Code:
    L 04/15/2015 - 14:40:34: [namefilter.smx] Renaming "V Молотов"<905><STEAM_1:0:><> - from ("V Молотов") to (*V Молотов*)
    L 04/15/2015 - 14:40:34: ""V Молотов"<905><STEAM_1:0:><#Team_Unassigned>" changed name to "*V Молотов*"
    L 04/15/2015 - 14:40:34: "*V Молотов*<905><STEAM_1:0:><#Team_Unassigned>" joined team "#Team_Security"
    L 04/15/2015 - 14:40:34: [namefilter.smx] Renaming *V Молотов*<905><STEAM_1:0:><> - from (*V Молотов*) to (*V *олотов*)
    L 04/15/2015 - 14:40:34: "*V Молотов*<905><STEAM_1:0:><#Team_Security>" changed name to "*V *олотов*"
    L 04/15/2015 - 14:40:34: "*V *олотов*<905><STEAM_1:0:><>" entered the game
    L 04/15/2015 - 14:40:34: [namefilter.smx] Renaming *V *олотов*<905><STEAM_1:0:><> - from (*V *олотов*) to (*V **л*т*в*)
    L 04/15/2015 - 14:40:34: "*V *олотов*<905><STEAM_1:0:><#Team_Security>" changed name to "*V **л*т*в*"
    L 04/15/2015 - 14:40:34: [namefilter.smx] Renaming *V **л*т*в*<905><STEAM_1:0:><> - from (*V **л*т*в*) to (*V ****т*в*)
    L 04/15/2015 - 14:40:34: "*V **л*т*в*<905><STEAM_1:0:><#Team_Security>" changed name to "*V ****т*в*"
    L 04/15/2015 - 14:40:34: [namefilter.smx] Renaming *V ****т*в*<905><STEAM_1:0:><> - from (*V ****т*в*) to (*V ******в*)
    L 04/15/2015 - 14:40:34: "*V ****т*в*<905><STEAM_1:0:><#Team_Security>" changed name to "*V ******в*"
    L 04/15/2015 - 14:40:34: [namefilter.smx] Renaming *V ******в*<905><STEAM_1:0:><> - from (*V ******в*) to (*V ********)
    L 04/15/2015 - 14:40:34: "*V ******в*<905><STEAM_1:0:><#Team_Security>" changed name to "*V ********"
    mikma is offline
    friagram
    Veteran Member
    Join Date: Sep 2012
    Location: Silicon Valley
    Old 04-16-2015 , 03:41   Re: [ANY] Regex Name Filter
    Reply With Quote #10

    It might depend on the game, valve did recently change how names work so this could have broke, or it could just be that game
    __________________
    Profile - Plugins
    Add me on steam if you are seeking sp/map/model commissions.
    friagram 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 15:11.


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