generated from AriasCreations/vsmodtemplate
Release v1.0.1
This commit is contained in:
parent
70664e91c4
commit
e561ced568
3 changed files with 35 additions and 18 deletions
|
@ -89,12 +89,23 @@ namespace AriasServerUtils
|
||||||
api.ChatCommands.Create("asu")
|
api.ChatCommands.Create("asu")
|
||||||
.RequiresPrivilege(Privilege.chat)
|
.RequiresPrivilege(Privilege.chat)
|
||||||
.BeginSubCommand("update")
|
.BeginSubCommand("update")
|
||||||
.RequiresPlayer()
|
.BeginSubCommand("maxhomes")
|
||||||
.RequiresPrivilege(Privilege.controlserver)
|
.RequiresPrivilege(Privilege.controlserver)
|
||||||
.WithArgs(
|
.WithArgs(
|
||||||
parsers.Int("maxHomes"),
|
parsers.Int("maxHomes")
|
||||||
parsers.Bool("adminsBypass"))
|
)
|
||||||
.HandleWith(Events.HandleUpdateASU)
|
.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")
|
.WithDescription("Updates the ASU mod configuration")
|
||||||
.EndSubCommand()
|
.EndSubCommand()
|
||||||
.BeginSubCommand("help")
|
.BeginSubCommand("help")
|
||||||
|
|
|
@ -185,25 +185,31 @@ namespace AriasServerUtils
|
||||||
return TextCommandResult.Success();
|
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.AdminsBypassMaxHomes = bypass;
|
||||||
ServerUtilities.config.MaxHomes = maxHomes;
|
|
||||||
if (args[1] is bool bypass)
|
|
||||||
{
|
|
||||||
ServerUtilities.config.AdminsBypassMaxHomes = bypass;
|
|
||||||
}
|
|
||||||
|
|
||||||
ServerUtilities.MarkDirty();
|
ServerUtilities.MarkDirty();
|
||||||
return TextCommandResult.Success(Lang.Get($"{ServerUtilities.MOD_ID}:updatedconfig"));
|
return TextCommandResult.Success(Lang.Get($"{ServerUtilities.MOD_ID}:updatedconfig"));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return TextCommandResult.Success();
|
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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -3,8 +3,8 @@
|
||||||
"modid": "ariasserverutils",
|
"modid": "ariasserverutils",
|
||||||
"name": "Aria's Server Utilities",
|
"name": "Aria's Server Utilities",
|
||||||
"authors": ["zontreck"],
|
"authors": ["zontreck"],
|
||||||
"description": "A collection of server utilities\n\nBuild Date: 01-18-2025 @ 02:46 PM",
|
"description": "A collection of server utilities\n\nBuild Date: 01-18-2025 @ 03:18 PM",
|
||||||
"version": "1.0.0-dev.10",
|
"version": "1.0.1",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"game": ""
|
"game": ""
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue