Comply with suggestion to remove IPs announcing on ban or unban

This commit is contained in:
Ivan 2019-08-06 01:11:46 -04:00
parent 6187c9c068
commit c01c436d40
3 changed files with 17 additions and 8 deletions

View File

@ -7,7 +7,9 @@ import me.totalfreedom.totalfreedommod.punishments.Punishment;
import me.totalfreedom.totalfreedommod.punishments.PunishmentType;
import me.totalfreedom.totalfreedommod.rank.Rank;
import me.totalfreedom.totalfreedommod.util.FUtil;
import static me.totalfreedom.totalfreedommod.util.FUtil.playerMsg;
import net.pravian.aero.util.Ips;
import org.apache.commons.lang.StringUtils;
import org.bukkit.ChatColor;
import org.bukkit.GameMode;
import org.bukkit.command.Command;
@ -109,7 +111,8 @@ public class Command_doom extends FreedomCommand
public void run()
{
// message
FUtil.adminAction(sender.getName(), "Banning " + player.getName() + ", IP: " + ip, true);
FUtil.adminAction(sender.getName(), "Banning " + player.getName(), true);
playerMsg(sender, ChatColor.GRAY + player.getName() + " has been banned and IP is: " + ip);
// generate explosion
player.getWorld().createExplosion(player.getLocation(), 0F, false);

View File

@ -12,6 +12,8 @@ import org.apache.commons.lang.StringUtils;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.ChatColor;
import static me.totalfreedom.totalfreedommod.util.FUtil.playerMsg;
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH, blockHostConsole = true)
@ -94,7 +96,8 @@ public class Command_glist extends FreedomCommand
playerBan.addIp(ip);
playerBan.addIp(FUtil.getFuzzyIp(ip));
}
FUtil.adminAction(sender.getName(), "Banning " + username + " and IPs: " + StringUtils.join(ips, ", "), true);
FUtil.adminAction(sender.getName(), "Banning " + username, true);
playerMsg(sender, ChatColor.GRAY + username + " has been banned and IP is: " + StringUtils.join(ips, ", "));
plugin.bm.addBan(playerBan);
@ -113,7 +116,8 @@ public class Command_glist extends FreedomCommand
msg("Please specify a player, not an ip.");
return true;
}
FUtil.adminAction(sender.getName(), "Unbanning " + username + " and IPs: " + StringUtils.join(ips, ", "), true);
FUtil.adminAction(sender.getName(), "Unbanning " + username, true);
playerMsg(sender, ChatColor.GRAY + username + " has been unbanned and IP is: " + StringUtils.join(ips, ", "));
plugin.bm.removeBan(plugin.bm.getByUsername(username));
for (String ip : ips)
@ -169,7 +173,8 @@ public class Command_glist extends FreedomCommand
final String ipBanReason = args.length > 2 ? StringUtils.join(args, " ", 2, args.length) : null;
Ban ipBan = Ban.forPlayerIp(banIp, sender, null, ipBanReason);
plugin.bm.addBan(ipBan);
FUtil.adminAction(sender.getName(), "Banning IP: " + banIp, true);
FUtil.adminAction(sender.getName(), "Banned an IP", true);
playerMsg(sender, ChatColor.GRAY + "Banned IP: " + banIp);
return true;
case "unbanip":
case "pardonip":
@ -179,7 +184,8 @@ public class Command_glist extends FreedomCommand
return true;
}
FUtil.adminAction(sender.getName(), "Unbanning IP: " + banIp, true);
FUtil.adminAction(sender.getName(), "Unbanned an IP", true);
playerMsg(sender, ChatColor.GRAY + "Unbanned IP: " + banIp);
Ban ipUnban = plugin.bm.getByIp(banIp);
if (ipUnban != null)
{

View File

@ -10,6 +10,7 @@ import me.totalfreedom.totalfreedommod.punishments.Punishment;
import me.totalfreedom.totalfreedommod.punishments.PunishmentType;
import me.totalfreedom.totalfreedommod.rank.Rank;
import me.totalfreedom.totalfreedommod.util.FUtil;
import static me.totalfreedom.totalfreedommod.util.FUtil.playerMsg;
import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang.StringUtils;
import org.bukkit.ChatColor;
@ -139,9 +140,8 @@ public class Command_gtfo extends FreedomCommand
.append(sender.getName())
.append(" - ")
.append("Banning: ")
.append(username)
.append(", IPs: ")
.append(StringUtils.join(ips, ", "));
.append(username);
playerMsg(sender, ChatColor.GRAY + username + " has been banned and IP is: " + StringUtils.join(ips, ", "));
if (reason != null)
{
bcast.append(" - Reason: ").append(ChatColor.YELLOW).append(reason);