Begin to add the admin bypass cooldown option

This commit is contained in:
zontreck 2025-03-07 01:44:27 -07:00
parent f86030dc61
commit cd00e620c3
4 changed files with 24 additions and 3 deletions

View file

@ -124,6 +124,14 @@ namespace AriasServerUtils
.WithDescription("DANGER: This updates the flag allowing anybody to create warps, even non-admins. It is recommended to leave this alone. The default is true/on/yes")
.HandleWith(Events.HandleUpdateASUMgrWarps)
.EndSubCommand()
.BeginSubCommand("adminBypassCooldown")
.RequiresPrivilege(Privilege.controlserver)
.WithArgs(
parsers.Bool("bypass")
)
.WithDescription("This flag controls whether admins can or can not bypass the cooldown system")
.HandleWith(Events.HandleUpdateASUBypassCD)
.EndSubCommand()
.BeginSubCommand("maxback")
.RequiresPrivilege(Privilege.controlserver)
.WithArgs(

View file

@ -555,5 +555,17 @@ namespace AriasServerUtils
return TextCommandResult.Success(Lang.Get($"{ServerUtilities.MOD_ID}:config-value-reset"));
}
internal static TextCommandResult HandleUpdateASUBypassCD(TextCommandCallingArgs args)
{
if (args[0] is bool bypass)
{
// Update the bypass
ServerUtilities.config.AdminsBypassCooldowns = bypass;
ServerUtilities.MarkDirty();
return TextCommandResult.Success(Lang.Get($"{ServerUtilities.MOD_ID}:updatedconfig"));
}
else return TextCommandResult.Success();
}
}
}

View file

@ -22,13 +22,14 @@ namespace AriasServerUtils
{ CooldownType.RTP, "30s" },
{ CooldownType.Back, "5s" }
};
private static readonly int CURRENT_VERSION = 3;
private static readonly int CURRENT_VERSION = 4;
public int Version { get; set; } = 0;
public int MaxHomes { get; set; } = 20;
public bool AdminsBypassMaxHomes { get; set; } = true;
public bool onlyAdminsCreateWarps { get; set; } = true;
public bool AdminsBypassCooldowns { get; set; } = true;
public int MaxBackCache { get; set; } = 10;
public int PlayerSleepingPercentage { get; set; } = 50;
public int MaxRTPBlockDistance { get; set; } = 5000;

View file

@ -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 @ 1:28 AM MST",
"version": "1.0.5",
"description": "A collection of server utilities\n\nBuild Date: 03-07-2025 @ 1:44 AM MST",
"version": "1.0.6-dev.1",
"dependencies": {
"game": ""
}