Release 1.0.3

Fix: Permissions on /homes
Add: /back
This commit is contained in:
zontreck 2025-01-18 21:23:21 -07:00
parent 1f43ffaa6c
commit 3e0896f5f9
5 changed files with 97 additions and 8 deletions

View file

@ -12,7 +12,23 @@ namespace AriasServerUtils
{
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", "warp", "setwarp", "delwarp", "warps" })));
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" })));
}
internal static TextCommandResult HandleBack(TextCommandCallingArgs args)
{
PlayerPosition pos = ServerUtilities.backCaches.ReadAndPopNewestPosition(args.Caller.Player.PlayerName);
if (pos == null)
{
return TextCommandResult.Success(Lang.Get($"{ServerUtilities.MOD_ID}:back-no"));
}
else
{
// Go back to old position
pos.Merge(args.Caller.Player.Entity);
return TextCommandResult.Success(Lang.Get($"{ServerUtilities.MOD_ID}:back"));
}
}
internal static TextCommandResult HandleClearSpawn(TextCommandCallingArgs args)
@ -63,6 +79,7 @@ namespace AriasServerUtils
PlayerStorage data = ServerUtilities.GetPlayerData(isp);
if (data.Homes.ContainsKey(homeName))
{
ServerUtilities.NewBackCacheForPlayer(isp);
data.Homes[homeName].Location.Merge(isp.Entity);
ServerUtilities.SendMessageTo(isp, Lang.Get($"{ServerUtilities.MOD_ID}:home-tp"));
@ -177,6 +194,7 @@ namespace AriasServerUtils
if (args.Caller.Player is IServerPlayer isp)
{
ServerUtilities.SendMessageTo(isp, Lang.Get($"{ServerUtilities.MOD_ID}:tp-spawn"));
ServerUtilities.NewBackCacheForPlayer(isp);
ServerUtilities.config.Spawn.Merge(args.Caller.Player.Entity);
}
@ -188,7 +206,7 @@ namespace AriasServerUtils
internal static TextCommandResult HandleUpdateASUBypass(TextCommandCallingArgs args)
{
if (args[1] is bool bypass)
if (args[0] is bool bypass)
{
ServerUtilities.config.AdminsBypassMaxHomes = bypass;
ServerUtilities.MarkDirty();
@ -199,6 +217,19 @@ namespace AriasServerUtils
}
internal static TextCommandResult HandleUpdateASUMaxBack(TextCommandCallingArgs args)
{
if (args[0] is int max)
{
ServerUtilities.config.MaxBackCache = max;
ServerUtilities.MarkDirty();
return TextCommandResult.Success(Lang.Get($"{ServerUtilities.MOD_ID}:updatedconfig"));
}
return TextCommandResult.Success();
}
internal static TextCommandResult HandleUpdateASUMaxHomes(TextCommandCallingArgs args)
{
if (args[0] is int maxHomes)
@ -231,7 +262,7 @@ namespace AriasServerUtils
{
if (ServerUtilities.serverWarps.warps.ContainsKey(name))
{
ServerUtilities.NewBackCacheForPlayer(isp);
ServerUtilities.serverWarps.warps[name].Location.Merge(isp.Entity);
ServerUtilities.SendMessageTo(isp, Lang.Get($"{ServerUtilities.MOD_ID}:warp-set", name));