Merge pull request #237 from speedxx/development

revamp vanish
This commit is contained in:
super 2020-07-22 18:04:36 -04:00 committed by GitHub
commit 30085a7a52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 183 additions and 60 deletions

View File

@ -31,7 +31,7 @@ public class LoginProcess extends FreedomService
public static final Pattern USERNAME_REGEX = Pattern.compile("^[\\w\\d_]{3,20}$"); public static final Pattern USERNAME_REGEX = Pattern.compile("^[\\w\\d_]{3,20}$");
public List<String> TELEPORT_ON_JOIN = new ArrayList<>(); public List<String> TELEPORT_ON_JOIN = new ArrayList<>();
public List<String> CLEAR_ON_JOIN = new ArrayList<>(); public List<String> CLEAR_ON_JOIN = new ArrayList<>();
//
@Getter @Getter
@Setter @Setter
private static boolean lockdownEnabled = false; private static boolean lockdownEnabled = false;
@ -188,7 +188,7 @@ public class LoginProcess extends FreedomService
final Player player = event.getPlayer(); final Player player = event.getPlayer();
final FPlayer fPlayer = plugin.pl.getPlayer(player); final FPlayer fPlayer = plugin.pl.getPlayer(player);
final PlayerData playerData = plugin.pl.getData(player); final PlayerData playerData = plugin.pl.getData(player);
player.sendTitle(FUtil.colorize(ConfigEntry.SERVER_LOGIN_TITLE.getString()), FUtil.colorize(ConfigEntry.SERVER_LOGIN_SUBTITLE.getString()), 20, 100, 60); player.sendTitle(FUtil.colorize(ConfigEntry.SERVER_LOGIN_TITLE.getString()), FUtil.colorize(ConfigEntry.SERVER_LOGIN_SUBTITLE.getString()), 20, 100, 60);
player.setOp(true); player.setOp(true);
@ -226,14 +226,6 @@ public class LoginProcess extends FreedomService
player.setPlayerListFooter(FUtil.colorize(ConfigEntry.SERVER_TABLIST_FOOTER.getString()).replace("\\n", "\n")); player.setPlayerListFooter(FUtil.colorize(ConfigEntry.SERVER_TABLIST_FOOTER.getString()).replace("\\n", "\n"));
} }
for (Player p : plugin.al.vanished)
{
if (!plugin.al.isAdmin(player))
{
player.hidePlayer(plugin, p);
}
}
if (!plugin.al.isAdmin(player)) if (!plugin.al.isAdmin(player))
{ {
String tag = playerData.getTag(); String tag = playerData.getTag();
@ -241,6 +233,7 @@ public class LoginProcess extends FreedomService
{ {
fPlayer.setTag(FUtil.colorize(tag)); fPlayer.setTag(FUtil.colorize(tag));
} }
int noteCount = playerData.getNotes().size(); int noteCount = playerData.getNotes().size();
if (noteCount != 0) if (noteCount != 0)
{ {
@ -274,7 +267,6 @@ public class LoginProcess extends FreedomService
FUtil.playerMsg(player, "Warning: Server is currenty in lockdown-mode, new players will not be able to join!", ChatColor.RED); FUtil.playerMsg(player, "Warning: Server is currenty in lockdown-mode, new players will not be able to join!", ChatColor.RED);
} }
} }
}.runTaskLater(plugin, 20L * 1L); }.runTaskLater(plugin, 20L);
} }
}
}

View File

@ -135,6 +135,7 @@ public class TotalFreedomMod extends JavaPlugin
public SignBlocker snp; public SignBlocker snp;
public EntityWiper ew; public EntityWiper ew;
public Sitter st; public Sitter st;
public VanishHandler vh;
//public HubWorldRestrictions hwr; //public HubWorldRestrictions hwr;
// //
@ -243,6 +244,7 @@ public class TotalFreedomMod extends JavaPlugin
snp = new SignBlocker(); snp = new SignBlocker();
ew = new EntityWiper(); ew = new EntityWiper();
st = new Sitter(); st = new Sitter();
vh = new VanishHandler();
// Single admin utils // Single admin utils
cs = new CommandSpy(); cs = new CommandSpy();

View File

@ -0,0 +1,83 @@
package me.totalfreedom.totalfreedommod;
import me.totalfreedom.totalfreedommod.util.FLog;
import net.md_5.bungee.api.ChatMessageType;
import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.scheduler.BukkitRunnable;
public class VanishHandler extends FreedomService
{
@Override
public void onStart()
{
}
@Override
public void onStop()
{
}
@EventHandler(priority = EventPriority.HIGH)
public void onPlayerJoin(PlayerJoinEvent event)
{
Player player = event.getPlayer();
for (Player p : server.getOnlinePlayers())
{
if (!plugin.al.isAdmin(player) && plugin.al.isVanished(p.getName()))
{
player.hidePlayer(plugin, p);
}
}
for (Player p : server.getOnlinePlayers())
{
if (!plugin.al.isAdmin(p) && plugin.al.isVanished(player.getName()))
{
p.hidePlayer(plugin, player);
}
}
if (plugin.al.isVanished(player.getName()))
{
plugin.esb.setVanished(player.getName(), true);
FLog.info(player.getName() + " joined while still vanished.");
plugin.al.messageAllAdmins(ChatColor.YELLOW + player.getName() + " has joined silently.");
event.setJoinMessage(null);
new BukkitRunnable()
{
@Override
public void run()
{
if (!plugin.al.isVanished(player.getName()))
{
this.cancel();
}
player.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(ChatColor.GOLD + "You are hidden from other players."));
}
}.runTaskTimer(plugin, 0L, 4L);
}
}
@EventHandler
public void onPlayerLeave(PlayerQuitEvent event)
{
Player player = event.getPlayer();
if (plugin.al.isVanished(player.getName()))
{
event.setQuitMessage(null);
FLog.info(player.getName() + " left while still vanished.");
plugin.al.messageAllAdmins(ChatColor.YELLOW + player.getName() + " has left silently.");
}
}
}

View File

@ -31,7 +31,7 @@ public class AdminList extends FreedomService
private final Map<String, Admin> ipTable = Maps.newHashMap(); private final Map<String, Admin> ipTable = Maps.newHashMap();
public final List<String> verifiedNoAdmins = new ArrayList<>(); public final List<String> verifiedNoAdmins = new ArrayList<>();
public final Map<String, List<String>> verifiedNoAdminIps = Maps.newHashMap(); public final Map<String, List<String>> verifiedNoAdminIps = Maps.newHashMap();
public static ArrayList<Player> vanished = new ArrayList<>(); public static List<String> vanished = new ArrayList<>();
@Override @Override
public void onStart() public void onStart()
@ -362,4 +362,9 @@ public class AdminList extends FreedomService
updateTables(); updateTables();
} }
}
public boolean isVanished(String player)
{
return vanished.contains(player);
}
}

View File

@ -36,7 +36,7 @@ public class Command_deop extends FreedomCommand
if (player.getName().toLowerCase().contains(targetName) || player.getDisplayName().toLowerCase().contains(targetName) if (player.getName().toLowerCase().contains(targetName) || player.getDisplayName().toLowerCase().contains(targetName)
|| player.getName().contains(targetName) || player.getDisplayName().contains(targetName)) || player.getName().contains(targetName) || player.getDisplayName().contains(targetName))
{ {
if (player.isOp() && !AdminList.vanished.contains(player)) if (player.isOp() && !AdminList.vanished.contains(player.getName()))
{ {
matchedPlayerNames.add(player.getName()); matchedPlayerNames.add(player.getName());
player.setOp(false); player.setOp(false);
@ -59,4 +59,4 @@ public class Command_deop extends FreedomCommand
return true; return true;
} }
} }

View File

@ -16,6 +16,7 @@ import org.bukkit.potion.PotionEffectType;
@CommandParameters(description = "Shows (optionally clears) invisible players", usage = "/<command> [clear]") @CommandParameters(description = "Shows (optionally clears) invisible players", usage = "/<command> [clear]")
public class Command_invis extends FreedomCommand public class Command_invis extends FreedomCommand
{ {
@Override @Override
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
{ {
@ -42,7 +43,7 @@ public class Command_invis extends FreedomCommand
for (Player player : server.getOnlinePlayers()) for (Player player : server.getOnlinePlayers())
{ {
if (player.hasPotionEffect(PotionEffectType.INVISIBILITY) && !plugin.al.vanished.contains(player)) if (player.hasPotionEffect(PotionEffectType.INVISIBILITY) && !plugin.al.isVanished(player.getName()))
{ {
players.add(player.getName()); players.add(player.getName());
if (clear && !plugin.al.isAdmin(player)) if (clear && !plugin.al.isAdmin(player))
@ -75,4 +76,4 @@ public class Command_invis extends FreedomCommand
return Collections.emptyList(); return Collections.emptyList();
} }
} }

View File

@ -18,6 +18,7 @@ import org.bukkit.entity.Player;
@CommandParameters(description = "Lists the real names of all online players.", usage = "/<command> [-a | -i | -f | -v]", aliases = "who,lsit") @CommandParameters(description = "Lists the real names of all online players.", usage = "/<command> [-a | -i | -f | -v]", aliases = "who,lsit")
public class Command_list extends FreedomCommand public class Command_list extends FreedomCommand
{ {
public boolean run(final CommandSender sender, final Player playerSender, final Command cmd, final String commandLabel, final String[] args, final boolean senderIsConsole) public boolean run(final CommandSender sender, final Player playerSender, final Command cmd, final String commandLabel, final String[] args, final boolean senderIsConsole)
{ {
if (args.length > 1) if (args.length > 1)
@ -108,11 +109,11 @@ public class Command_list extends FreedomCommand
{ {
continue; continue;
} }
if (listFilter == ListFilter.ADMINS && AdminList.vanished.contains(p)) if (listFilter == ListFilter.ADMINS && AdminList.vanished.contains(p.getName()))
{ {
continue; continue;
} }
if (listFilter == ListFilter.VANISHED_ADMINS && !AdminList.vanished.contains(p)) if (listFilter == ListFilter.VANISHED_ADMINS && !AdminList.vanished.contains(p.getName()))
{ {
continue; continue;
} }
@ -124,7 +125,7 @@ public class Command_list extends FreedomCommand
{ {
continue; continue;
} }
if (listFilter == ListFilter.PLAYERS && AdminList.vanished.contains(p)) if (listFilter == ListFilter.PLAYERS && AdminList.vanished.contains(p.getName()))
{ {
continue; continue;
} }

View File

@ -41,11 +41,11 @@ public class Command_nickfilter extends FreedomCommand
player = getPlayerByDisplayName(displayName); player = getPlayerByDisplayName(displayName);
if (player == null || plugin.al.vanished.contains(player) && !plugin.al.isAdmin(sender)) if (player == null || plugin.al.isVanished(player.getName()) && !plugin.al.isAdmin(sender))
{ {
player = getPlayerByDisplayNameAlt(displayName); player = getPlayerByDisplayNameAlt(displayName);
if (player == null || !plugin.al.vanished.contains(player) && !plugin.al.isAdmin(sender)) if (player == null || !plugin.al.isVanished(player.getName()) && !plugin.al.isAdmin(sender))
{ {
sender.sendMessage(ChatColor.GRAY + "Can't find player by nickname: " + displayName); sender.sendMessage(ChatColor.GRAY + "Can't find player by nickname: " + displayName);
return true; return true;
@ -120,4 +120,4 @@ public class Command_nickfilter extends FreedomCommand
return minEditMatch; return minEditMatch;
} }
} }

View File

@ -14,6 +14,7 @@ import org.bukkit.entity.Player;
@CommandParameters(description = "OP a player", usage = "/<command> <partialname>") @CommandParameters(description = "OP a player", usage = "/<command> <partialname>")
public class Command_op extends FreedomCommand public class Command_op extends FreedomCommand
{ {
@Override @Override
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
{ {
@ -36,7 +37,7 @@ public class Command_op extends FreedomCommand
if (player.getName().toLowerCase().contains(targetName) || player.getDisplayName().toLowerCase().contains(targetName) if (player.getName().toLowerCase().contains(targetName) || player.getDisplayName().toLowerCase().contains(targetName)
|| player.getName().contains(targetName) || player.getDisplayName().contains(targetName)) || player.getName().contains(targetName) || player.getDisplayName().contains(targetName))
{ {
if (!player.isOp() && !AdminList.vanished.contains(player)) if (!player.isOp() && !AdminList.vanished.contains(player.getName()))
{ {
matchedPlayerNames.add(player.getName()); matchedPlayerNames.add(player.getName());
player.setOp(true); player.setOp(true);
@ -59,4 +60,4 @@ public class Command_op extends FreedomCommand
return true; return true;
} }
} }

View File

@ -106,7 +106,7 @@ public class Command_potion extends FreedomCommand
{ {
target = getPlayer(args[4]); target = getPlayer(args[4]);
if (target == null || plugin.al.vanished.contains(target) && !plugin.al.isAdmin(sender)) if (target == null || plugin.al.isVanished(target.getName()) && !plugin.al.isAdmin(sender))
{ {
msg(FreedomCommand.PLAYER_NOT_FOUND, ChatColor.RED); msg(FreedomCommand.PLAYER_NOT_FOUND, ChatColor.RED);
return true; return true;
@ -244,5 +244,4 @@ public class Command_potion extends FreedomCommand
} }
return types; return types;
} }
}
}

View File

@ -48,7 +48,7 @@ public class Command_tag extends FreedomCommand
for (final Player player : server.getOnlinePlayers()) for (final Player player : server.getOnlinePlayers())
{ {
if (plugin.al.vanished.contains(player) && !plugin.al.isAdmin(sender)) if (plugin.al.isVanished(player.getName()) && !plugin.al.isAdmin(sender))
{ {
continue; continue;
} }
@ -269,4 +269,4 @@ public class Command_tag extends FreedomCommand
playerData.setTag(tag); playerData.setTag(tag);
plugin.pl.save(playerData); plugin.pl.save(playerData);
} }
} }

View File

@ -1,16 +1,18 @@
package me.totalfreedom.totalfreedommod.command; package me.totalfreedom.totalfreedommod.command;
import me.totalfreedom.totalfreedommod.admin.Admin;
import me.totalfreedom.totalfreedommod.player.PlayerData; import me.totalfreedom.totalfreedommod.player.PlayerData;
import me.totalfreedom.totalfreedommod.rank.Displayable; import me.totalfreedom.totalfreedommod.rank.Displayable;
import me.totalfreedom.totalfreedommod.rank.Rank; import me.totalfreedom.totalfreedommod.rank.Rank;
import me.totalfreedom.totalfreedommod.util.FLog; import me.totalfreedom.totalfreedommod.util.FLog;
import me.totalfreedom.totalfreedommod.util.FUtil; import me.totalfreedom.totalfreedommod.util.FUtil;
import net.md_5.bungee.api.ChatMessageType;
import net.md_5.bungee.api.chat.TextComponent;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable;
import static me.totalfreedom.totalfreedommod.util.FUtil.playerMsg; import static me.totalfreedom.totalfreedommod.util.FUtil.playerMsg;
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.ONLY_IN_GAME) @CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.ONLY_IN_GAME)
@ -23,7 +25,6 @@ public class Command_vanish extends FreedomCommand
Displayable display = plugin.rm.getDisplay(playerSender); Displayable display = plugin.rm.getDisplay(playerSender);
String displayName = display.getColor() + playerSender.getName(); String displayName = display.getColor() + playerSender.getName();
String tag = display.getColoredTag(); String tag = display.getColoredTag();
Admin admin = plugin.al.getAdmin(playerSender);
boolean silent = false; boolean silent = false;
if (args.length > 0) if (args.length > 0)
{ {
@ -32,22 +33,30 @@ public class Command_vanish extends FreedomCommand
silent = true; silent = true;
} }
} }
if (plugin.al.vanished.contains(playerSender))
if (plugin.al.isVanished(playerSender.getName()))
{ {
msg(ChatColor.GOLD + "You have been unvanished."); if (silent)
if (!silent)
{ {
msg(ChatColor.GOLD + "Silently unvanished.");
}
else
{
msg("You have unvanished.", ChatColor.GOLD);
FUtil.bcastMsg(plugin.rm.craftLoginMessage(playerSender, null)); FUtil.bcastMsg(plugin.rm.craftLoginMessage(playerSender, null));
FUtil.bcastMsg(playerSender.getName() + " joined the game.", ChatColor.YELLOW); FUtil.bcastMsg(playerSender.getName() + " joined the game.", ChatColor.YELLOW);
plugin.dc.messageChatChannel("**" + playerSender.getName() + " joined the server" + "**"); plugin.dc.messageChatChannel("**" + playerSender.getName() + " joined the server" + "**");
} }
PlayerData playerData = plugin.pl.getData(playerSender); PlayerData playerData = plugin.pl.getData(playerSender);
if (playerData.getTag() != null) if (playerData.getTag() != null)
{ {
tag = FUtil.colorize(playerData.getTag()); tag = FUtil.colorize(playerData.getTag());
} }
plugin.pl.getData(playerSender).setTag(tag); plugin.pl.getData(playerSender).setTag(tag);
FLog.info(playerSender.getName() + " is no longer vanished."); FLog.info(playerSender.getName() + " is no longer vanished.");
for (Player player : server.getOnlinePlayers()) for (Player player : server.getOnlinePlayers())
{ {
if (plugin.al.isAdmin(player)) if (plugin.al.isAdmin(player))
@ -61,16 +70,33 @@ public class Command_vanish extends FreedomCommand
} }
plugin.esb.setVanished(playerSender.getName(), false); plugin.esb.setVanished(playerSender.getName(), false);
playerSender.setPlayerListName(StringUtils.substring(displayName, 0, 16)); playerSender.setPlayerListName(StringUtils.substring(displayName, 0, 16));
plugin.al.vanished.remove(playerSender); plugin.al.vanished.remove(playerSender.getName());
} }
else else
{ {
msg("You have been vanished.", ChatColor.GOLD); new BukkitRunnable()
if (!silent)
{ {
@Override
public void run()
{
if (plugin.al.isVanished(playerSender.getName()))
{
playerSender.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(ChatColor.GOLD + "You are hidden from other players."));
}
}
}.runTaskTimer(plugin, 0L, 4L);
if (silent)
{
msg("Silently vanished.", ChatColor.GOLD);
}
else
{
msg ("You have vanished.", ChatColor.GOLD);
FUtil.bcastMsg(playerSender.getName() + " left the game.", ChatColor.YELLOW); FUtil.bcastMsg(playerSender.getName() + " left the game.", ChatColor.YELLOW);
plugin.dc.messageChatChannel("**" + playerSender.getName() + " left the server" + "**"); plugin.dc.messageChatChannel("**" + playerSender.getName() + " left the server" + "**");
} }
FLog.info(playerSender.getName() + " is now vanished."); FLog.info(playerSender.getName() + " is now vanished.");
for (Player player : server.getOnlinePlayers()) for (Player player : server.getOnlinePlayers())
{ {
@ -85,9 +111,10 @@ public class Command_vanish extends FreedomCommand
} }
} }
} }
plugin.esb.setVanished(playerSender.getName(), true); plugin.esb.setVanished(playerSender.getName(), true);
plugin.al.vanished.add(playerSender); plugin.al.vanished.add(playerSender.getName());
} }
return true; return true;
} }
} }

View File

@ -40,7 +40,7 @@ public class Command_whohas extends FreedomCommand
for (final Player player : server.getOnlinePlayers()) for (final Player player : server.getOnlinePlayers())
{ {
if (!plugin.al.isAdmin(sender) && plugin.al.vanished.contains(player)) if (!plugin.al.isAdmin(sender) && plugin.al.isVanished(player.getName()))
{ {
continue; continue;
} }
@ -94,4 +94,4 @@ public class Command_whohas extends FreedomCommand
return Collections.emptyList(); return Collections.emptyList();
} }
} }

View File

@ -303,9 +303,12 @@ public abstract class FreedomCommand implements CommandExecutor, TabCompleter
protected Player getPlayer(String name, Boolean nullVanished) protected Player getPlayer(String name, Boolean nullVanished)
{ {
Player player = Bukkit.getPlayer(name); Player player = Bukkit.getPlayer(name);
if (nullVanished && plugin.al.vanished.contains(player) && !plugin.al.isAdmin(sender)) if (player != null)
{ {
return null; if (nullVanished && plugin.al.isVanished(player.getName()) && !plugin.al.isAdmin(sender))
{
return null;
}
} }
return player; return player;
} }
@ -341,4 +344,4 @@ public abstract class FreedomCommand implements CommandExecutor, TabCompleter
return null; return null;
} }
} }
} }

View File

@ -49,6 +49,7 @@ import org.bukkit.event.player.PlayerQuitEvent;
public class Discord extends FreedomService public class Discord extends FreedomService
{ {
public static HashMap<String, PlayerData> LINK_CODES = new HashMap<>(); public static HashMap<String, PlayerData> LINK_CODES = new HashMap<>();
public static HashMap<String, PlayerData> VERIFICATION_CODES = new HashMap<>(); public static HashMap<String, PlayerData> VERIFICATION_CODES = new HashMap<>();
public ScheduledThreadPoolExecutor RATELIMIT_EXECUTOR; public ScheduledThreadPoolExecutor RATELIMIT_EXECUTOR;
@ -253,13 +254,19 @@ public class Discord extends FreedomService
@EventHandler(priority = EventPriority.MONITOR) @EventHandler(priority = EventPriority.MONITOR)
public void onPlayerJoin(PlayerJoinEvent event) public void onPlayerJoin(PlayerJoinEvent event)
{ {
messageChatChannel("**" + deformat(event.getPlayer().getName()) + " joined the server" + "**"); if (!plugin.al.isVanished(event.getPlayer().getName()))
{
messageChatChannel("**" + deformat(event.getPlayer().getName()) + " joined the server" + "**");
}
} }
@EventHandler(priority = EventPriority.MONITOR) @EventHandler(priority = EventPriority.MONITOR)
public void onPlayerLeave(PlayerQuitEvent event) public void onPlayerLeave(PlayerQuitEvent event)
{ {
messageChatChannel("**" + deformat(event.getPlayer().getName()) + " left the server" + "**"); if (!plugin.al.isVanished(event.getPlayer().getName()))
{
messageChatChannel("**" + deformat(event.getPlayer().getName()) + " left the server" + "**");
}
} }
@EventHandler(priority = EventPriority.MONITOR) @EventHandler(priority = EventPriority.MONITOR)

View File

@ -40,7 +40,7 @@ public class Module_list extends HTTPDModule
for (Player player : Bukkit.getOnlinePlayers()) for (Player player : Bukkit.getOnlinePlayers())
{ {
if (plugin.al.vanished.contains(player)) if (plugin.al.isVanished(player.getName()))
{ {
continue; continue;
} }
@ -128,7 +128,7 @@ public class Module_list extends HTTPDModule
for (Player player : onlinePlayers) for (Player player : onlinePlayers)
{ {
if (plugin.al.vanished.contains(player)) if (plugin.al.isVanished(player.getName()))
{ {
continue; continue;
} }
@ -167,4 +167,4 @@ public class Module_list extends HTTPDModule
{ {
return "Total Freedom - Online Players"; return "Total Freedom - Online Players";
} }
} }

View File

@ -36,7 +36,7 @@ public class Module_players extends HTTPDModule
// All online players // All online players
for (Player player : Bukkit.getOnlinePlayers()) for (Player player : Bukkit.getOnlinePlayers())
{ {
if (!plugin.al.vanished.contains(player)) if (!plugin.al.isVanished(player.getName()))
{ {
players.add(player.getName()); players.add(player.getName());
if (plugin.al.isAdmin(player) && !plugin.al.isAdminImpostor(player)) if (plugin.al.isAdmin(player) && !plugin.al.isAdminImpostor(player))
@ -85,4 +85,4 @@ public class Module_players extends HTTPDModule
response.addHeader("Access-Control-Allow-Origin", "*"); response.addHeader("Access-Control-Allow-Origin", "*");
return response; return response;
} }
} }

View File

@ -250,7 +250,10 @@ public class RankManager extends FreedomService
// Broadcast login message // Broadcast login message
if (isAdmin || FUtil.isDeveloper(player.getName()) || plugin.pl.getData(player).isMasterBuilder() || plugin.pl.getData(player).isDonator()) if (isAdmin || FUtil.isDeveloper(player.getName()) || plugin.pl.getData(player).isMasterBuilder() || plugin.pl.getData(player).isDonator())
{ {
FUtil.bcastMsg(craftLoginMessage(player, null)); if (!plugin.al.isVanished(player.getName()))
{
FUtil.bcastMsg(craftLoginMessage(player, null));
}
} }
// Set display // Set display
@ -312,4 +315,4 @@ public class RankManager extends FreedomService
team.addPlayer(player); team.addPlayer(player);
} }
} }
} }

View File

@ -52,10 +52,9 @@ public class FUtil
{ {
private static final Random RANDOM = new Random(); private static final Random RANDOM = new Random();
//
public static final String SAVED_FLAGS_FILENAME = "savedflags.dat"; public static final String SAVED_FLAGS_FILENAME = "savedflags.dat";
// See https://github.com/TotalFreedom/License - None of the listed names may be removed. // See https://github.com/TotalFreedom/License - None of the listed names may be removed.
public static final List<String> DEVELOPERS = Arrays.asList("Madgeek1450", "Prozza", "WickedGamingUK", "Wild1145", "aggelosQQ", "scripthead", "supernt", "Telesphoreo", "CoolJWB"); public static final List<String> DEVELOPERS = Arrays.asList("Madgeek1450", "Prozza", "WickedGamingUK", "Wild1145", "aggelosQQ", "scripthead", "supernt");
public static String DATE_STORAGE_FORMAT = "EEE, d MMM yyyy HH:mm:ss Z"; public static String DATE_STORAGE_FORMAT = "EEE, d MMM yyyy HH:mm:ss Z";
public static final Map<String, ChatColor> CHAT_COLOR_NAMES = new HashMap<>(); public static final Map<String, ChatColor> CHAT_COLOR_NAMES = new HashMap<>();
public static final List<ChatColor> CHAT_COLOR_POOL = Arrays.asList( public static final List<ChatColor> CHAT_COLOR_POOL = Arrays.asList(
@ -146,7 +145,7 @@ public class FUtil
List<String> names = new ArrayList<>(); List<String> names = new ArrayList<>();
for (Player player : Bukkit.getOnlinePlayers()) for (Player player : Bukkit.getOnlinePlayers())
{ {
if (!TotalFreedomMod.plugin().al.vanished.contains(player)) if (!TotalFreedomMod.plugin().al.isVanished(player.getName()))
{ {
names.add(player.getName()); names.add(player.getName());
} }
@ -814,4 +813,4 @@ public class FUtil
String id; String id;
String name; String name;
} }
} }