From 69ef58fd9c80340168043b985219af43a1a85c0b Mon Sep 17 00:00:00 2001 From: Goodlyay Date: Wed, 20 Aug 2025 23:02:01 -0700 Subject: [PATCH] Add a server config setting to allow or disallow /os rename --- MCGalaxy/Commands/Overseer.cs | 5 +++++ MCGalaxy/Server/ServerConfig.cs | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/MCGalaxy/Commands/Overseer.cs b/MCGalaxy/Commands/Overseer.cs index 9f08011e2..a0edd11f9 100644 --- a/MCGalaxy/Commands/Overseer.cs +++ b/MCGalaxy/Commands/Overseer.cs @@ -473,6 +473,11 @@ namespace MCGalaxy.Commands.World { "&H With , 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; } diff --git a/MCGalaxy/Server/ServerConfig.cs b/MCGalaxy/Server/ServerConfig.cs index 38c9bda89..df5c6d718 100644 --- a/MCGalaxy/Server/ServerConfig.cs +++ b/MCGalaxy/Server/ServerConfig.cs @@ -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)]