Fixed json config file changes made while server is running lost if reload is not performed before restart
Fixed unban not saving to file until server shutdown
This commit is contained in:
parent
bc18550a3f
commit
07d607a9b6
3 changed files with 5 additions and 9 deletions
|
|
@ -74,6 +74,7 @@ namespace TShockAPI
|
|||
public void RemoveBan(Ban ban)
|
||||
{
|
||||
Bans.Remove(ban);
|
||||
SaveBans();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
|
|
@ -66,6 +66,8 @@ namespace TShockAPI
|
|||
if (File.Exists(ConfigPath))
|
||||
{
|
||||
ConfigurationManager.ReadJsonConfiguration();
|
||||
// Add all the missing config properties in the json file
|
||||
ConfigurationManager.WriteJsonConfiguration();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -139,14 +139,8 @@ namespace TShockAPI
|
|||
|
||||
public override void Initialize()
|
||||
{
|
||||
try
|
||||
{
|
||||
FileTools.SetupConfig();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine(ex.ToString());
|
||||
}
|
||||
FileTools.SetupConfig();
|
||||
|
||||
string version = string.Format("TShock Version {0} ({1}) now running.", Version, VersionCodename);
|
||||
Console.WriteLine(version);
|
||||
|
||||
|
|
@ -179,7 +173,6 @@ namespace TShockAPI
|
|||
public override void DeInitialize()
|
||||
{
|
||||
Bans.SaveBans();
|
||||
ConfigurationManager.WriteJsonConfiguration();
|
||||
GameHooks.PostInitialize -= OnPostInit;
|
||||
GameHooks.Update -= OnUpdate;
|
||||
ServerHooks.Chat -= OnChat;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue