Configuration File now adds missing entries thanks to how JSON works and how default values work.
This commit is contained in:
parent
feea5700ac
commit
b7f0112acd
3 changed files with 30 additions and 27 deletions
|
|
@ -92,8 +92,15 @@ namespace TShockAPI
|
|||
sw.Write(Resources.users);
|
||||
sw.Close();
|
||||
}
|
||||
ConfigurationManager.WriteJsonConfiguration();
|
||||
ConfigurationManager.ReadJsonConfiguration();
|
||||
if (File.Exists(FileTools.SaveDir + "config.json"))
|
||||
{
|
||||
ConfigurationManager.ReadJsonConfiguration();
|
||||
} else
|
||||
{
|
||||
ConfigurationManager.WriteJsonConfiguration();
|
||||
ConfigurationManager.ReadJsonConfiguration();
|
||||
}
|
||||
|
||||
Netplay.serverPort = ConfigurationManager.serverPort;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue