mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-22 03:55:18 -04:00
Only allow characters that are valid in usernames for os renames
This commit is contained in:
parent
4aa61f7623
commit
cec3a316ca
@ -443,6 +443,9 @@ namespace MCGalaxy.Commands.World {
|
||||
"&H With <name>, renames to 'yourname[name]'.",
|
||||
};
|
||||
static void HandleRename(Player p, string args) {
|
||||
if (args.Length > 0 && !Formatter.IsValidName(p, args, "os name", Player.USERNAME_ALPHABET)) {
|
||||
return;
|
||||
}
|
||||
UseCommand(p, "RenameLvl", p.level.name + " " + GetLevelName(p, args));
|
||||
}
|
||||
|
||||
|
@ -90,7 +90,7 @@ namespace MCGalaxy
|
||||
return IsValidName(p, name, "player", alphabet);
|
||||
}
|
||||
|
||||
static bool IsValidName(Player p, string name, string type, string alphabet) {
|
||||
public static bool IsValidName(Player p, string name, string type, string alphabet) {
|
||||
if (name.Length > 0 && name.ContainsAllIn(alphabet)) return true;
|
||||
p.Message("\"{0}\" is not a valid {1} name.", name, type);
|
||||
return false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user