Name restriction plugin request?

Jakkee

Retired Staff
Retired Staff
Plugin Developer
Jul 28, 2014
1,465
932
113
Australia
What if instead of rejecting a player,
Grab the player name and scan for illegal characters and replace them with nothing.
Then set their name to the fixed name.
Only reject a player if a player name has all illegal characters.
^Just an idea.

replace = Player.Name.Replace('F***', '').replace('&', '').replace('$$$', '')
Player.Name = replace
If Player.Name == "":
Kick(Reason)
 

Louis

Member
Member
Oct 11, 2014
33
3
8
36
Parts Unknown
What if instead of rejecting a player,
Grab the player name and scan for illegal characters and replace them with nothing.
Then set their name to the fixed name.
Only reject a player if a player name has all illegal characters.
^Just an idea.

replace = Player.Name.Replace('F***', '').replace('&', '').replace('$$$', '')
Player.Name = replace
If Player.Name == "":
Kick(Reason)
I like that idea, it'd probably be easier to make than a plugin that has to scan for every illegal character.
 

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,093
4,784
113
At your house.
github.com
I like that idea, it'd probably be easier to make than a plugin that has to scan for every illegal character.
Not at all.

What if instead of rejecting a player,
Grab the player name and scan for illegal characters and replace them with nothing.
Then set their name to the fixed name.
Only reject a player if a player name has all illegal characters.
^Just an idea.

replace = Player.Name.Replace('F***', '').replace('&', '').replace('$$$', '')
Player.Name = replace
If Player.Name == "":
Kick(Reason)
Atm the plugin uses regex to allow UTF8 chars, tho idk why can't we get the ASCII thing working, while it shouldn't even be working.

Checkin the player name's length is a bit better.