diff --git a/AriasServerUtils/ASUModSystem.cs b/AriasServerUtils/ASUModSystem.cs index 6da73de..c808b5a 100644 --- a/AriasServerUtils/ASUModSystem.cs +++ b/AriasServerUtils/ASUModSystem.cs @@ -130,7 +130,7 @@ namespace AriasServerUtils .WithArgs( parsers.Bool("bypass") ) - .WithDescription("This flag controls whether admins can or can not bypass the cooldown system") + .WithDescription("This flag controls whether admins can or can not bypass the cooldown system (Default: true)") .HandleWith(Events.HandleUpdateASUBypassCD) .EndSubCommand() .BeginSubCommand("adminsBypassRTPMaxDist") @@ -138,7 +138,7 @@ namespace AriasServerUtils .WithArgs( parsers.Bool("bypass") ) - .WithDescription("This flag would allow admins to go further than the max server RTP distance when manually specifying a distance to RTP") + .WithDescription("This flag would allow admins to go further than the max server RTP distance when manually specifying a distance to RTP (Default: false)") .HandleWith(Events.HandleUpdateASUBypassRTPMaxDist) .EndSubCommand() .BeginSubCommand("maxback") @@ -162,7 +162,7 @@ namespace AriasServerUtils .WithArgs( parsers.Int("maxDistance") ) - .WithDescription("Update RTP Max block distance. Plus and/or minus this distance from player current position") + .WithDescription("Update RTP Max block distance. Plus and/or minus this distance from player current position (Default is 50000)") .HandleWith(Events.HandleUpdateASURTPMax) .EndSubCommand() .BeginSubCommand("cooldowns") @@ -228,6 +228,8 @@ namespace AriasServerUtils api.ChatCommands.Create("back").RequiresPlayer().RequiresPrivilege(Privilege.chat).WithDescription("Returns you to the last location you were at").HandleWith(Events.HandleBack); api.ChatCommands.Create("rtp").RequiresPlayer().RequiresPrivilege(Privilege.chat).WithArgs(parsers.OptionalInt("maxDist", defaultValue: -1)).WithDescription("Seeks a position possibly thousands of blocks away to teleport to.").HandleWith(Events.HandleRTP); + + api.ChatCommands.Create("listcooldowns").RequiresPrivilege(Privilege.chat).WithDescription("Lists the cooldown settings on the server, as well as your own active cooldowns if applicable.").HandleWith(Events.HandleListCooldowns); } private void OnCheckPlayerCooldowns() diff --git a/AriasServerUtils/EventHandler.cs b/AriasServerUtils/EventHandler.cs index 4bc6020..0cfc261 100644 --- a/AriasServerUtils/EventHandler.cs +++ b/AriasServerUtils/EventHandler.cs @@ -14,7 +14,7 @@ namespace AriasServerUtils { internal static TextCommandResult HandleASU(TextCommandCallingArgs args) { - return TextCommandResult.Success(Lang.Get($"{ServerUtilities.MOD_ID}:help", ServerUtilities.config.MaxHomes, ServerUtilities.config.AdminsBypassMaxHomes, ServerUtilities.config.MaxBackCache, string.Join(", ", new string[] { "setspawn", "spawn", "delspawn", "sethome", "home", "delhome", "homes", "restoreinv", "asu", "warp", "setwarp", "delwarp", "warps", "back", "rtp" }))); + return TextCommandResult.Success(Lang.Get($"{ServerUtilities.MOD_ID}:help", ServerUtilities.config.MaxHomes, ServerUtilities.config.AdminsBypassMaxHomes, ServerUtilities.config.MaxBackCache, string.Join(", ", new string[] { "setspawn", "spawn", "delspawn", "sethome", "home", "delhome", "homes", "restoreinv", "asu", "warp", "setwarp", "delwarp", "warps", "back", "rtp", "listcooldowns" }))); } internal static TextCommandResult HandleBack(TextCommandCallingArgs args) @@ -579,5 +579,25 @@ namespace AriasServerUtils } else return TextCommandResult.Success(); } + + internal static TextCommandResult HandleListCooldowns(TextCommandCallingArgs args) + { + string sReturn = "SERVER COOLDOWN SETTINGS\n"; + foreach (var cd in ServerUtilities.config.Cooldowns) + { + sReturn += $"{cd.Key}: {cd.Value}\n"; + } + if (args.Caller.Player is IServerPlayer isp) + { + sReturn += "\nYour active cooldowns:"; + foreach (var cd in ServerUtilities.GetPlayerData(isp).ActiveCooldowns) + { + long remain = cd.Value - TimeUtil.GetUnixEpochTimestamp(); + string sCDVal = TimeUtil.EncodeTimeNotation(remain); + sReturn += $"{cd.Key}: {sCDVal}\n"; + } + } + return TextCommandResult.Success(sReturn); + } } } \ No newline at end of file diff --git a/AriasServerUtils/modinfo.json b/AriasServerUtils/modinfo.json index f4b8f54..c9e0d43 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: 03-07-2025 @ 11:53 AM MST", - "version": "1.0.6-dev.3", + "description": "A collection of server utilities\n\nBuild Date: 03-07-2025 @ 12:04 PM MST", + "version": "1.0.6-dev.4", "dependencies": { "game": "" }