Pryaxis/TSAPI

Server Deleting Config file Occasionally

Closed this issue · 1 comments

This issue results in this:

[06/18/16 12:42:06] [Server API] Error: Startup aborted due to an exception in the Server API initialization:
System.InvalidOperationException: Plugin "TShock" has thrown an exception during initialization. ---> System.Exception: Fatal TShock initialization exception. See inner exception for details. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at TShockAPI.FileTools.SetupConfig()
at TShockAPI.TShock.Initialize()
--- End of inner exception stack trace ---
at TShockAPI.TShock.Initialize()
at TerrariaApi.Server.ServerApi.LoadPlugins()
--- End of inner exception stack trace ---
at TerrariaApi.Server.ServerApi.LoadPlugins()
at TerrariaApi.Server.ServerApi.Initialize(String[] commandLi

The cause? No idea, How to replicate it? No idea. I shut down my server sometimes, using [X] and once in a while it either wipes the config.json file, or the sscconfig.json file clean, making it empty. The result? This error, the result of this is frustration for any user trying to figure out why this is happening...

So for those trying to mess around, stop, Back up SSCConfig, and Config in a RAR file and keep it there in case tShock decided to wipe it for god knows why. This is the 5th time this has happened, and needs some investigation what causes it?

In win32 there is no kernel support for signals, and pressing the X will cause the process to terminate without warning. In Windows forms it's a bit different since clicking the X in child windows will cause a WM_MESSAGE allowing for confirm dialogs, but that isn't the case with console apps.

Windows gives us no opportunity to clean up before an X press, so we cant fix it even if we wanted to. We can't even remove the X button in the console since windows won't let us.

We cant fix this.

Use /quit to exit a server. You're playing with fire by killing the process.