From 34d39bd8d35e3cb21c7a94a1ab4ab3cfa6167d8a Mon Sep 17 00:00:00 2001 From: Lucas Nicodemus Date: Tue, 5 Jul 2011 00:58:06 -0600 Subject: [PATCH] Read hashes are now converted to uppercase when checked to preserve computability with php's sha512 hashing. --- TShockAPI/Commands.cs | 9 ++++++++- TShockAPI/TShock.cs | 5 ++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs index d2faceb2..6e65ded8 100755 --- a/TShockAPI/Commands.cs +++ b/TShockAPI/Commands.cs @@ -15,6 +15,13 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ +/* TShock wouldn't be possible without: + * Github + * Dreamspark + * Microsoft Visual Studio 2010 + * HostPenda + * And you, for your continued support and devotion to the evolution of TShock + */ using System; using System.Collections.Generic; using System.IO; @@ -302,7 +309,7 @@ namespace TShockAPI string encrPass = Tools.HashPassword(args.Parameters[1]); string[] exr = Tools.FetchHashedPasswordAndGroup(args.Parameters[0]); - if (exr[0] == encrPass) + if (exr[0].ToUpper() == encrPass.ToUpper()) { args.Player.Group = Tools.GetGroup(exr[1]); args.Player.SendMessage("Authenticated as " + args.Parameters[0] + " successfully.", Color.LimeGreen); diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs index 9b531eb1..2cd61ed6 100755 --- a/TShockAPI/TShock.cs +++ b/TShockAPI/TShock.cs @@ -279,6 +279,9 @@ namespace TShockAPI handler.Handled = true; return; } + + + if (!FileTools.OnWhitelist(player.IP)) { Tools.ForceKick(player, "Not on whitelist."); @@ -551,7 +554,7 @@ namespace TShockAPI private void OnSaveWorld(bool resettime, HandledEventArgs e) { - Tools.Broadcast("Saving world, might lag.", Color.Red); + Tools.Broadcast("Saving world. Momentary lag might result from this.", Color.Red); Thread SaveWorld = new Thread(Tools.SaveWorld); SaveWorld.Start(); e.Handled = true;