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

[Any?] Name Character Replacer


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Mitchell
~lick~
Join Date: Mar 2010
Plugin ID:
3387
Plugin Version:
1.0.0
Plugin Category:
Server Management
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Changes a player's name and replaces the invalid characters to valid characters via config.
    Unapprover:
    Reason for Unapproving:
    Author requested
    Old 11-26-2012 , 12:12   [Any?] Name Character Replacer
    Reply With Quote #1

    Character Replacer!
    Description: THis was made by request and i really wanted it too, it would deem useful with servers that like to enforce rules but rather not guess a client's name with special characters in his/her name.

    Cvars: sm_replacecharacters_version

    Commands: sm_reloadchar - refreshes the config (below)

    Config: (configs/charconfig.cfg)
    Code:
    "CharConfig"
    {
    	"†" //Character to Find
    	{
    		"replace"	"t" //Character to replace with
    	}
    	"∅"
    	{
    		"replace"	"o"
    	}
    	"®"
    	{
    		"replace"	"r"
    	}
    	"ü"
    	{
    		"replace"	"u"
    	}
    	"₤"
    	{
    		"replace"	"e"
    	}
    }
    The config will automatically choose the first match it finds, so if you have two '†' in the config it will replace with the first one, and the second one will be a waste of space.
    THE CONFIG MUST, MUST BE IN UTF-8, or it wont read the characters right.

    Release Notes:
    Code:
    [1.0.2] (11/26/12) - Added 'quote' to the config as an alias to "
    [1.0.2] (11/26/12) - Initial Release.
    Notes: I plan on adding a feature that if it is not "A-Z,a-z,0-9,!@#$%^&*()_-+=[]:;'"\|.,/?><{}" then it makes the character a 'flagged' character, if there are too many characters (Clients name size / cvar * 100 == 60%) then it will change the clients name to a random generic name.

    Also, if you would like to paste your config here to help out other server admins, then do so. all help is needed
    Attached Files
    File Type: cfg charconfig.cfg (806 Bytes, 306 views)
    File Type: sp Get Plugin or Get Source (ReplaceChar.sp - 892 views - 3.2 KB)

    Last edited by Mitchell; 11-26-2012 at 12:54.
    Mitchell is offline
    Huntereb
    >:) (:<
    Join Date: Jul 2012
    Old 11-26-2012 , 13:28   Re: [Any?] Name Character Replacer
    Reply With Quote #2

    I'll add this when it gets the ability to change every character that can't be used on the keyboard to one specific character, instead of having to define which ones are replaced.

    This looks like it will be great, thanks!
    Huntereb is offline
    Powerlord
    AlliedModders Donor
    Join Date: Jun 2008
    Location: Seduce Me!
    Old 11-26-2012 , 13:35   Re: [Any?] Name Character Replacer
    Reply With Quote #3

    Quote:
    Originally Posted by Mitchell View Post
    Character Replacer!
    Description: THis was made by request and i really wanted it too, it would deem useful with servers that like to enforce rules but rather not guess a client's name with special characters in his/her name.
    This is why the stock SourceMod commands and anything that uses ProcessTargetString accepts a userid (prefix it with #). You can get userids using the status command.

    For example, to rename Replay from whatever another admin named it to, I can do sm_rename #2 "Replay"
    __________________
    Not currently working on SourceMod plugin development.

    Last edited by Powerlord; 11-26-2012 at 13:36.
    Powerlord is offline
    Mitchell
    ~lick~
    Join Date: Mar 2010
    Old 11-26-2012 , 14:36   Re: [Any?] Name Character Replacer
    Reply With Quote #4

    Quote:
    Originally Posted by Powerlord View Post
    This is why the stock SourceMod commands and anything that uses ProcessTargetString accepts a userid (prefix it with #). You can get userids using the status command.

    For example, to rename Replay from whatever another admin named it to, I can do sm_rename #2 "Replay"
    What... i meant in general, not on commands, so you when you see a name in game sometimes it will have boxes as the characters, and on steam chat it will look fine, it could be used in that case. I know about the number sign to target players.. i've been using it for years, now i dont have to.

    I'm having a glitch with a command spam preventer (smac or sm, not sure which one) that kicks clients for to many name changes. Could be the broadcast of the event.

    Last edited by Mitchell; 11-26-2012 at 14:38.
    Mitchell is offline
    Aggamemnon
    SourceMod Donor
    Join Date: Dec 2011
    Location: Australia
    Old 11-27-2012 , 02:57   Re: [Any?] Name Character Replacer
    Reply With Quote #5

    I personally think this will be a great plugin. I have way too many players coming onto my servers
    with names that are very difficult to make any sense of.

    Looking forward to when it is finished.
    Aggamemnon is offline
    excalibur
    Junior Member
    Join Date: Mar 2010
    Old 11-27-2012 , 03:32   Re: [Any?] Name Character Replacer
    Reply With Quote #6

    I can see potential regarding prevention of SQL injection when logging stuff to the database by replacing the chars which matter the most
    excalibur is offline
    Skyy
    AlliedModders Donor
    Join Date: Jan 2010
    Location: Toronto, Canada
    Old 11-27-2012 , 04:13   Re: [Any?] Name Character Replacer
    Reply With Quote #7

    Quote:
    Originally Posted by excalibur View Post
    I can see potential regarding prevention of SQL injection when logging stuff to the database by replacing the chars which matter the most
    This is why SQL_EscapeString exists.
    Skyy is offline
    excalibur
    Junior Member
    Join Date: Mar 2010
    Old 11-27-2012 , 04:23   Re: [Any?] Name Character Replacer
    Reply With Quote #8

    I'm not familiar with sourcemod coding but thanks for the info.
    excalibur is offline
    Skyy
    AlliedModders Donor
    Join Date: Jan 2010
    Location: Toronto, Canada
    Old 11-27-2012 , 04:28   Re: [Any?] Name Character Replacer
    Reply With Quote #9

    When working with databases in general, you escape the strings as part of the precaution against injection attacks. In regards to custom characters, it just means setting a charset for the database to recognize as well.
    Skyy is offline
    Mitchell
    ~lick~
    Join Date: Mar 2010
    Old 11-27-2012 , 22:15   Re: [Any?] Name Character Replacer
    Reply With Quote #10

    Quote:
    Originally Posted by excalibur View Post
    I can see potential regarding prevention of SQL injection when logging stuff to the database by replacing the chars which matter the most
    I misread that in thinking that my plugin had sql.. i even looked at the source because i couldn't remember >.>
    Mitchell 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 04:15.


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