From a1b1fddeb8ea277f67d5e100fa89dfa64d02cf6f Mon Sep 17 00:00:00 2001 From: Jens van de Wiel Date: Sat, 11 Nov 2023 23:09:18 +0100 Subject: [PATCH 1/2] fixed delete duplicate problem --- server/game.go | 4 +--- server/gus.go | 5 ++--- server/helpers.go | 6 ++++++ 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/server/game.go b/server/game.go index 4fa0910..1f69b77 100644 --- a/server/game.go +++ b/server/game.go @@ -277,9 +277,7 @@ func (s *Server) SaveGameIni() error { return err } - gIni := ini.Empty() - - gIni, err := ini.Load(filepath.Join(s.ServerPath, "ShooterGame\\Saved\\Config\\WindowsServer\\Game.ini")) + gIni, err := ini.LoadSources(iniOpts, filepath.Join(s.ServerPath, "ShooterGame\\Saved\\Config\\WindowsServer\\Game.ini")) if err != nil { return err } diff --git a/server/gus.go b/server/gus.go index 9fde82d..43bd9a7 100644 --- a/server/gus.go +++ b/server/gus.go @@ -3,6 +3,7 @@ package server import ( "github.com/go-ini/ini" "github.com/wailsapp/wails/v2/pkg/runtime" + "os" "path/filepath" ) @@ -428,9 +429,7 @@ func (s *Server) SaveGameUserSettingsIni() error { return err } - gusIni := ini.Empty() - - gusIni, err := ini.Load(filepath.Join(s.ServerPath, "ShooterGame\\Saved\\Config\\WindowsServer\\GameUserSettings.ini")) + gusIni, err := ini.LoadSources(iniOpts, filepath.Join(s.ServerPath, "ShooterGame\\Saved\\Config\\WindowsServer\\GameUserSettings.ini")) if err != nil { return err } diff --git a/server/helpers.go b/server/helpers.go index b35d923..2061e07 100644 --- a/server/helpers.go +++ b/server/helpers.go @@ -3,6 +3,7 @@ package server import ( "fmt" "github.com/JensvandeWiel/ArkAscendedServerManager/helpers" + "github.com/go-ini/ini" "github.com/sethvargo/go-password/password" "github.com/wailsapp/wails/v2/pkg/runtime" "io" @@ -217,3 +218,8 @@ func (c *ServerController) GetServerDir() string { } //endregion + +var iniOpts = ini.LoadOptions{ + AllowShadows: true, + AllowDuplicateShadowValues: true, +} From e6c07a39ff62ccfeaacc5f66bf052f98ae47431a Mon Sep 17 00:00:00 2001 From: Jens van de Wiel <85284773+JensvandeWiel@users.noreply.github.com> Date: Sat, 11 Nov 2023 23:12:41 +0100 Subject: [PATCH 2/2] Update gus.go --- server/gus.go | 1 - 1 file changed, 1 deletion(-) diff --git a/server/gus.go b/server/gus.go index 43bd9a7..2d07628 100644 --- a/server/gus.go +++ b/server/gus.go @@ -3,7 +3,6 @@ package server import ( "github.com/go-ini/ini" "github.com/wailsapp/wails/v2/pkg/runtime" - "os" "path/filepath" )