Add a server config setting to allow or disallow /os rename

This commit is contained in:
Goodlyay 2025-08-20 23:02:01 -07:00
parent 19ac43a746
commit 69ef58fd9c
2 changed files with 8 additions and 1 deletions

View File

@ -473,6 +473,11 @@ namespace MCGalaxy.Commands.World {
"&H With <name>, renames to 'yourname[name]'.",
};
static void HandleRename(Player p, string args) {
if (!Server.Config.OSRenameAllowed) {
p.Message("This server does not allow renaming os realms.");
return;
}
if (args.Length > 0 && !Formatter.IsValidName(p, args, "os name", Player.USERNAME_ALPHABET)) {
return;
}

View File

@ -145,7 +145,9 @@ namespace MCGalaxy
[ConfigBool("allow-tp-to-higher-ranks", "Other", true)]
public bool HigherRankTP = true;
[ConfigPerm("os-perbuild-default", "Other", LevelPermission.Owner)]
public LevelPermission OSPerbuildDefault = LevelPermission.Owner;
public LevelPermission OSPerbuildDefault = LevelPermission.Owner;
[ConfigBool("os-rename-allowed", "Other", true)]
public bool OSRenameAllowed = true;
[ConfigBool("protect-staff-ips", "Other", true)]
public bool ProtectStaffIPs = true;
[ConfigBool("classicube-account-plus", "Other", false)]