Finish setting up the ASU command for managing the server settings, and listing all available asu commands

This commit is contained in:
zontreck 2025-01-18 15:12:22 -07:00
parent bd28f36e00
commit 70664e91c4
4 changed files with 51 additions and 3 deletions

View file

@ -10,6 +10,11 @@ namespace AriasServerUtils
{
public class Events
{
internal static TextCommandResult HandleASU(TextCommandCallingArgs args)
{
return TextCommandResult.Success(Lang.Get($"{ServerUtilities.MOD_ID}:help", ServerUtilities.config.MaxHomes, ServerUtilities.config.AdminsBypassMaxHomes, string.Join(", ", new string[] { "setspawn", "spawn", "delspawn", "sethome", "home", "delhome", "homes", "restoreinv", "asu" })));
}
internal static TextCommandResult HandleClearSpawn(TextCommandCallingArgs args)
{
ServerUtilities.config.Spawn = null;
@ -179,5 +184,26 @@ namespace AriasServerUtils
return TextCommandResult.Success();
}
internal static TextCommandResult HandleUpdateASU(TextCommandCallingArgs args)
{
if (args[0] is int maxHomes)
{
ServerUtilities.config.MaxHomes = maxHomes;
if (args[1] is bool bypass)
{
ServerUtilities.config.AdminsBypassMaxHomes = bypass;
}
ServerUtilities.MarkDirty();
return TextCommandResult.Success(Lang.Get($"{ServerUtilities.MOD_ID}:updatedconfig"));
}
return TextCommandResult.Success();
}
}
}