Fix unban

Fix DisableBeforeJoin when server has a password.
This commit is contained in:
Zack Piispanen 2012-05-17 19:36:33 -04:00
parent 50d9cb602d
commit 08d06c023e
2 changed files with 2 additions and 2 deletions

View file

@ -879,7 +879,7 @@ namespace TShockAPI
var ban = TShock.Bans.GetBanByName(plStr);
if (ban != null)
{
if (TShock.Bans.RemoveBan(ban.IP, true))
if (TShock.Bans.RemoveBan(ban.Name, true))
args.Player.SendMessage(string.Format("Unbanned {0} ({1})!", ban.Name, ban.IP), Color.Red);
else
args.Player.SendMessage(string.Format("Failed to unban {0} ({1})!", ban.Name, ban.IP), Color.Red);

View file

@ -1336,7 +1336,7 @@ namespace TShockAPI
string password = Encoding.UTF8.GetString(args.Data.ReadBytes((int) (args.Data.Length - args.Data.Position - 1)));
var user = TShock.Users.GetUserByName(args.Player.Name);
if (user != null)
if (user != null && !TShock.Config.DisableLoginBeforeJoin)
{
string encrPass = TShock.Utils.HashPassword(password);
if (user.Password.ToUpper() == encrPass.ToUpper())