Add upgrade to SSC config so we don't overwrite ssc configs anymore
This commit is contained in:
parent
f7a95c7a9f
commit
53213345b0
1 changed files with 16 additions and 0 deletions
|
|
@ -83,6 +83,22 @@ namespace TShockAPI.Configuration
|
|||
/// </summary>
|
||||
public class ServerSideConfig : ConfigFile<SscSettings>
|
||||
{
|
||||
/// <summary>
|
||||
/// Upgrades the configuration file from the old format if required, then reads and returns the currently configured <see cref="SscSettings"/>
|
||||
/// </summary>
|
||||
/// <param name="json"></param>
|
||||
/// <param name="incompleteSettings"></param>
|
||||
/// <returns></returns>
|
||||
public override SscSettings ConvertJson(string json, out bool incompleteSettings)
|
||||
{
|
||||
var settings = FileTools.LoadConfigAndCheckForChanges<SscSettings>(json, out incompleteSettings);
|
||||
|
||||
Settings = settings;
|
||||
OnConfigRead?.Invoke(this);
|
||||
|
||||
return settings;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Dumps all configuration options to a text file in Markdown format
|
||||
/// </summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue