diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs index 1c12cda2..b975f512 100644 --- a/TShockAPI/TShock.cs +++ b/TShockAPI/TShock.cs @@ -112,14 +112,6 @@ namespace TShockAPI Console.WriteLine(ex.ToString()); } Console.WriteLine("TShock Version " + Version.Major + "." + Version.Minor + "." + Version.Build + "." + Version.Revision + " (" + VersionCodename + ") now running."); - if (!System.IO.File.Exists(FileTools.SaveDir + "auth.lck")) - { - Random r = new Random((int)System.DateTime.Now.ToBinary()); - ConfigurationManager.authToken = r.Next(100000, 10000000); - Console.WriteLine("TShock Notice: To become SuperAdmin, join the game and type /auth " + ConfigurationManager.authToken); - Console.WriteLine("This token will only display ONCE."); - FileTools.CreateFile(FileTools.SaveDir + "auth.lck"); - } Log.Initialize(FileTools.SaveDir + "log.txt", LogLevel.All, true); Log.Info("Starting..."); GameHooks.OnPreInitialize += OnPreInit; @@ -487,6 +479,14 @@ namespace TShockAPI void OnPostInit() { + if (!System.IO.File.Exists(FileTools.SaveDir + "auth.lck")) + { + Random r = new Random((int)System.DateTime.Now.ToBinary()); + ConfigurationManager.authToken = r.Next(100000, 10000000); + Console.WriteLine("TShock Notice: To become SuperAdmin, join the game and type /auth " + ConfigurationManager.authToken); + Console.WriteLine("This token will only display ONCE."); + FileTools.CreateFile(FileTools.SaveDir + "auth.lck"); + } } void OnUpdate(GameTime time)