Fix setting/going/deleting home without name argument

This commit is contained in:
zontreck 2025-01-18 14:22:20 -07:00
parent d35d888386
commit 9522b6d941
4 changed files with 10 additions and 9 deletions

View file

@ -192,7 +192,7 @@ namespace AriasServerUtils
public void SaveGlobalConfig() public void SaveGlobalConfig()
{ {
API.StoreModConfig<ASUModConfig>(config, GetConfigurationFile("", ModConfigType.Global)); API.StoreModConfig<ASUModConfig>(config, GetConfigurationFile("global", ModConfigType.Global));
} }
private void OnGameReady() private void OnGameReady()
@ -200,7 +200,7 @@ namespace AriasServerUtils
// Mod Setup Info // // Mod Setup Info //
// -> Step 1. Load Mod Global Config <- // -> Step 1. Load Mod Global Config <-
config = API.LoadModConfig<ASUModConfig>(GetConfigurationFile("", ModConfigType.Global)); config = API.LoadModConfig<ASUModConfig>(GetConfigurationFile("global", ModConfigType.Global));
if (config == null) config = new ASUModConfig(); if (config == null) config = new ASUModConfig();
} }
@ -208,7 +208,7 @@ namespace AriasServerUtils
{ {
if (type == ModConfigType.Global) if (type == ModConfigType.Global)
{ {
return "ariaserverconfig/global.json"; return $"ariaserverconfig/{sName}.json";
} }
else if (type == ModConfigType.World) else if (type == ModConfigType.World)
{ {

View file

@ -20,7 +20,7 @@ namespace AriasServerUtils
string homeName = "default"; string homeName = "default";
if (args.ArgCount > 0) if (args.ArgCount > 0)
{ {
homeName = args[0] as string; homeName = args[0] as string ?? "default";
} }
if (args.Caller.Player is IServerPlayer isp) if (args.Caller.Player is IServerPlayer isp)
@ -47,7 +47,7 @@ namespace AriasServerUtils
string homeName = "default"; string homeName = "default";
if (args.ArgCount > 0) if (args.ArgCount > 0)
{ {
homeName = args[0] as string; homeName = args[0] as string ?? "default";
} }
if (args.Caller.Player is IServerPlayer isp) if (args.Caller.Player is IServerPlayer isp)
@ -96,7 +96,7 @@ namespace AriasServerUtils
string homeName = "default"; string homeName = "default";
if (args.ArgCount > 0) if (args.ArgCount > 0)
{ {
homeName = args[0] as string; homeName = args[0] as string ?? "default";
} }
if (args.Caller.Player is IServerPlayer isp) if (args.Caller.Player is IServerPlayer isp)

View file

@ -14,5 +14,6 @@
"home-tp": "You have teleported home", "home-tp": "You have teleported home",
"home-no": "No such home exists", "home-no": "No such home exists",
"home-max": "You have reached your max number of homes", "home-max": "You have reached your max number of homes",
"home-set": "Home saved" "home-set": "Home saved",
"home-del": "Home deleted"
} }

View file

@ -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:06 PM", "description": "A collection of server utilities\n\nBuild Date: 01-18-2025 @ 02:17 PM",
"version": "1.0.0-dev.5", "version": "1.0.0-dev.6",
"dependencies": { "dependencies": {
"game": "" "game": ""
} }