From 69098105195b9fe5de37bc62b66130f93e122f96 Mon Sep 17 00:00:00 2001 From: Shank Date: Sun, 5 Jun 2011 15:05:11 -0600 Subject: [PATCH 1/2] Forgot to close the StreamWriter. --- TShockAPI/Commands.cs | 1 + release-docs/changes.txt | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs index f01356d5..8efeff31 100644 --- a/TShockAPI/Commands.cs +++ b/TShockAPI/Commands.cs @@ -331,6 +331,7 @@ namespace TShockAPI tw.WriteLine(Tools.GetRealIP(Convert.ToString(Netplay.serverSock[args.PlayerID].tcpClient.Client.RemoteEndPoint)) + " superadmin"); Tools.SendMessage(args.PlayerID, "SuperAdmin authenticated. Please re-connect using the same IP."); ConfigurationManager.authToken = 0; + tw.Close(); } } diff --git a/release-docs/changes.txt b/release-docs/changes.txt index bc454cba..469b03b1 100644 --- a/release-docs/changes.txt +++ b/release-docs/changes.txt @@ -1,6 +1,10 @@ For the full list of changes, please take a look at GitHub: https://github.com/TShock/TShock/commits/master +Changes in API release 1.8.0.0: + - Added permissions system for managing different levels of admins + - Fixed spawnrate and max spawns + Changes in API release 1.6.0.0: - Added spawn protection - Fixed numerous bugs From 1429595c5b3561df66becead4b2731297f897c07 Mon Sep 17 00:00:00 2001 From: Shank Date: Sun, 5 Jun 2011 15:14:19 -0600 Subject: [PATCH 2/2] Now putting auth token in PostInit Closes #16 --- TShockAPI/TShock.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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)