diff --git a/AriasServerUtils/ASUModSystem.cs b/AriasServerUtils/ASUModSystem.cs index 5856252..7e0589b 100644 --- a/AriasServerUtils/ASUModSystem.cs +++ b/AriasServerUtils/ASUModSystem.cs @@ -89,12 +89,23 @@ namespace AriasServerUtils api.ChatCommands.Create("asu") .RequiresPrivilege(Privilege.chat) .BeginSubCommand("update") - .RequiresPlayer() - .RequiresPrivilege(Privilege.controlserver) - .WithArgs( - parsers.Int("maxHomes"), - parsers.Bool("adminsBypass")) - .HandleWith(Events.HandleUpdateASU) + .BeginSubCommand("maxhomes") + .RequiresPrivilege(Privilege.controlserver) + .WithArgs( + parsers.Int("maxHomes") + ) + .WithDescription("Updates the maximum number of homes") + .HandleWith(Events.HandleUpdateASUMaxHomes) + + .EndSubCommand() + .BeginSubCommand("adminhomes") + .RequiresPrivilege(Privilege.controlserver) + .WithArgs( + parsers.Bool("adminsBypass") + ) + .WithDescription("Updates the flag deciding whether admins can bypass max number of homes") + .HandleWith(Events.HandleUpdateASUBypass) + .EndSubCommand() .WithDescription("Updates the ASU mod configuration") .EndSubCommand() .BeginSubCommand("help") diff --git a/AriasServerUtils/EventHandler.cs b/AriasServerUtils/EventHandler.cs index 85e03d7..f378e84 100644 --- a/AriasServerUtils/EventHandler.cs +++ b/AriasServerUtils/EventHandler.cs @@ -185,25 +185,31 @@ namespace AriasServerUtils return TextCommandResult.Success(); } - internal static TextCommandResult HandleUpdateASU(TextCommandCallingArgs args) + internal static TextCommandResult HandleUpdateASUBypass(TextCommandCallingArgs args) { - if (args[0] is int maxHomes) + if (args[1] is bool bypass) { - - ServerUtilities.config.MaxHomes = maxHomes; - if (args[1] is bool bypass) - { - ServerUtilities.config.AdminsBypassMaxHomes = bypass; - } - + ServerUtilities.config.AdminsBypassMaxHomes = bypass; ServerUtilities.MarkDirty(); return TextCommandResult.Success(Lang.Get($"{ServerUtilities.MOD_ID}:updatedconfig")); - } return TextCommandResult.Success(); } + + internal static TextCommandResult HandleUpdateASUMaxHomes(TextCommandCallingArgs args) + { + if (args[0] is int maxHomes) + { + ServerUtilities.config.MaxHomes = maxHomes; + ServerUtilities.MarkDirty(); + + return TextCommandResult.Success(Lang.Get($"{ServerUtilities.MOD_ID}:updatedconfig")); + } + + return TextCommandResult.Success(); + } } } \ No newline at end of file diff --git a/AriasServerUtils/modinfo.json b/AriasServerUtils/modinfo.json index 72de391..5247ac9 100644 --- a/AriasServerUtils/modinfo.json +++ b/AriasServerUtils/modinfo.json @@ -3,8 +3,8 @@ "modid": "ariasserverutils", "name": "Aria's Server Utilities", "authors": ["zontreck"], - "description": "A collection of server utilities\n\nBuild Date: 01-18-2025 @ 02:46 PM", - "version": "1.0.0-dev.10", + "description": "A collection of server utilities\n\nBuild Date: 01-18-2025 @ 03:18 PM", + "version": "1.0.1", "dependencies": { "game": "" }