Allow admins to bypass the max rtp distance

This commit is contained in:
zontreck 2025-03-07 11:53:57 -07:00
parent 700de94ffe
commit c5c605d057
4 changed files with 25 additions and 4 deletions

View file

@ -133,6 +133,14 @@ namespace AriasServerUtils
.WithDescription("This flag controls whether admins can or can not bypass the cooldown system")
.HandleWith(Events.HandleUpdateASUBypassCD)
.EndSubCommand()
.BeginSubCommand("adminsBypassRTPMaxDist")
.RequiresPrivilege(Privilege.controlserver)
.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")
.HandleWith(Events.HandleUpdateASUBypassRTPMaxDist)
.EndSubCommand()
.BeginSubCommand("maxback")
.RequiresPrivilege(Privilege.controlserver)
.WithArgs(

View file

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

View file

@ -22,7 +22,7 @@ namespace AriasServerUtils
{ CooldownType.RTP, "30s" },
{ CooldownType.Back, "5s" }
};
private static readonly int CURRENT_VERSION = 4;
private static readonly int CURRENT_VERSION = 5;
public int Version { get; set; } = 0;
@ -30,9 +30,10 @@ namespace AriasServerUtils
public bool AdminsBypassMaxHomes { get; set; } = true;
public bool onlyAdminsCreateWarps { get; set; } = true;
public bool AdminsBypassCooldowns { get; set; } = true;
public bool AdminsBypassRTPMaxDistance { get; set; } = false;
public int MaxBackCache { get; set; } = 10;
public int PlayerSleepingPercentage { get; set; } = 50;
public int MaxRTPBlockDistance { get; set; } = 5000;
public int MaxRTPBlockDistance { get; set; } = 50000;
public Dictionary<CooldownType, string> Cooldowns { get; set; } = new Dictionary<CooldownType, string>();
public Dictionary<CooldownType, string> GetDefaultCooldowns()

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 @ 11:49 AM MST",
"version": "1.0.6-dev.2",
"description": "A collection of server utilities\n\nBuild Date: 03-07-2025 @ 11:53 AM MST",
"version": "1.0.6-dev.3",
"dependencies": {
"game": ""
}