From 53213345b03d4cf025cf67297e584332d28894ce Mon Sep 17 00:00:00 2001 From: Chris <2648373+QuiCM@users.noreply.github.com> Date: Fri, 28 May 2021 18:13:37 +0930 Subject: [PATCH] Add upgrade to SSC config so we don't overwrite ssc configs anymore --- TShockAPI/Configuration/ServerSideConfig.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/TShockAPI/Configuration/ServerSideConfig.cs b/TShockAPI/Configuration/ServerSideConfig.cs index 8e777303..10cdd21e 100644 --- a/TShockAPI/Configuration/ServerSideConfig.cs +++ b/TShockAPI/Configuration/ServerSideConfig.cs @@ -83,6 +83,22 @@ namespace TShockAPI.Configuration /// public class ServerSideConfig : ConfigFile { + /// + /// Upgrades the configuration file from the old format if required, then reads and returns the currently configured + /// + /// + /// + /// + public override SscSettings ConvertJson(string json, out bool incompleteSettings) + { + var settings = FileTools.LoadConfigAndCheckForChanges(json, out incompleteSettings); + + Settings = settings; + OnConfigRead?.Invoke(this); + + return settings; + } + /// /// Dumps all configuration options to a text file in Markdown format ///