From 5ec03c8e082a800abc128b754bb36d2331f69621 Mon Sep 17 00:00:00 2001 From: Lucas Nicodemus Date: Sat, 30 Jul 2011 20:59:10 -0600 Subject: [PATCH] Fixed /unban not working with BanOnUsernames disabled. --- TShockAPI/Commands.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs index d1d0abdb..6daaf9c0 100644 --- a/TShockAPI/Commands.cs +++ b/TShockAPI/Commands.cs @@ -706,6 +706,14 @@ namespace TShockAPI else args.Player.SendMessage(string.Format("Failed to Unbanned {0} ({1})!", ban.Name, ban.IP), Color.Red); } + else if (!TShock.Config.EnableBanOnUsernames) + { + ban = TShock.Bans.GetBanByIp(plStr); + if (TShock.Bans.RemoveBan(ban.IP)) + args.Player.SendMessage(string.Format("Unbanned {0} ({1})!", ban.Name, ban.IP), Color.Red); + else + args.Player.SendMessage(string.Format("Failed to Unbanned {0} ({1})!", ban.Name, ban.IP), Color.Red); + } else { args.Player.SendMessage("Invalid player!", Color.Red);