From 3e6cdb3c717b86958559f71ae9a753710f22ddf2 Mon Sep 17 00:00:00 2001 From: Chris <2648373+QuiCM@users.noreply.github.com> Date: Sun, 29 Nov 2020 14:26:25 +1030 Subject: [PATCH] Remove ban immunity at the command level. Ban immunity will be managed when a ban is validated --- TShockAPI/Commands.cs | 14 ++++---------- TShockAPI/TSPlayer.cs | 8 ++++---- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs index e8751dbc..a8908ace 100644 --- a/TShockAPI/Commands.cs +++ b/TShockAPI/Commands.cs @@ -1452,12 +1452,6 @@ namespace TShockAPI var player = players[0]; - if (player.HasPermission(Permissions.immunetoban)) - { - args.Player.SendErrorMessage("That player is immune to bans."); - return; - } - string banReason = null; void DoBan(string ident) { @@ -1478,23 +1472,23 @@ namespace TShockAPI { if (player.Account != null) { - DoBan($"{Identifiers.Account}{player.Account.Name}"); + DoBan($"{Identifier.Account}{player.Account.Name}"); } } if (banUuid) { - DoBan($"{Identifiers.UUID}{player.UUID}"); + DoBan($"{Identifier.UUID}{player.UUID}"); } if (banName) { - DoBan($"{Identifiers.Name}{player.Name}"); + DoBan($"{Identifier.Name}{player.Name}"); } if (banIp) { - DoBan($"{Identifiers.IP}{player.IP}"); + DoBan($"{Identifier.IP}{player.IP}"); } //Using the ban reason to determine if a ban actually happened or not is messy, but it works diff --git a/TShockAPI/TSPlayer.cs b/TShockAPI/TSPlayer.cs index 923dc5af..c807229a 100644 --- a/TShockAPI/TSPlayer.cs +++ b/TShockAPI/TSPlayer.cs @@ -1636,13 +1636,13 @@ namespace TShockAPI { if (!ConnectionAlive) return true; - if (force || !HasPermission(Permissions.immunetoban)) + if (force) { - TShock.Bans.InsertBan($"{Identifiers.IP}{IP}", reason, adminUserName, DateTime.UtcNow, DateTime.MaxValue); - TShock.Bans.InsertBan($"{Identifiers.IP}{UUID}", reason, adminUserName, DateTime.UtcNow, DateTime.MaxValue); + TShock.Bans.InsertBan($"{Identifier.IP}{IP}", reason, adminUserName, DateTime.UtcNow, DateTime.MaxValue); + TShock.Bans.InsertBan($"{Identifier.IP}{UUID}", reason, adminUserName, DateTime.UtcNow, DateTime.MaxValue); if (Account != null) { - TShock.Bans.InsertBan($"{Identifiers.Account}{Account.Name}", reason, adminUserName, DateTime.UtcNow, DateTime.MaxValue); + TShock.Bans.InsertBan($"{Identifier.Account}{Account.Name}", reason, adminUserName, DateTime.UtcNow, DateTime.MaxValue); } Disconnect(string.Format("Banned: {0}", reason));