mirror of
https://github.com/TheDeus-Group/TFM-4.3-Reloaded.git
synced 2024-12-22 22:34:58 +00:00
Move IP on join from prelogin event to join event
This commit is contained in:
parent
454a342a9a
commit
8342460d6e
2 changed files with 12 additions and 12 deletions
|
@ -82,18 +82,6 @@ public class Server
|
||||||
{
|
{
|
||||||
final String ip = event.getAddress().getHostAddress().trim();
|
final String ip = event.getAddress().getHostAddress().trim();
|
||||||
final boolean isAdmin = AdminList.isSuperAdminSafe(null, ip);
|
final boolean isAdmin = AdminList.isSuperAdminSafe(null, ip);
|
||||||
TextComponent textComponent = new TextComponent(String.format("%s is attempting to join with IP %s.", event.getName(), Utilities.getFuzzyIp(ip)));
|
|
||||||
textComponent.setColor(ChatColor.GRAY.asBungee());
|
|
||||||
|
|
||||||
for (org.bukkit.entity.Player player : Bukkit.getOnlinePlayers())
|
|
||||||
{
|
|
||||||
if (AdminList.isSuperAdmin(player))
|
|
||||||
{
|
|
||||||
player.spigot().sendMessage(textComponent);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DiscordBridge.transmitAdminMessage(textComponent.getText());
|
|
||||||
|
|
||||||
// Check if the player is already online
|
// Check if the player is already online
|
||||||
for (Player onlinePlayer : TotalFreedomMod.server.getOnlinePlayers())
|
for (Player onlinePlayer : TotalFreedomMod.server.getOnlinePlayers())
|
||||||
|
|
|
@ -774,6 +774,18 @@ public class PlayerListener implements Listener {
|
||||||
final String ip = Utilities.getIp(player);
|
final String ip = Utilities.getIp(player);
|
||||||
final Player playerEntry;
|
final Player playerEntry;
|
||||||
Log.info("[JOIN] " + Utilities.formatPlayer(player) + " joined the game with IP address: " + ip, true);
|
Log.info("[JOIN] " + Utilities.formatPlayer(player) + " joined the game with IP address: " + ip, true);
|
||||||
|
TextComponent textComponent = new TextComponent(String.format("%s is joining with IP %s.", player.getName(), Utilities.getFuzzyIp(ip)));
|
||||||
|
textComponent.setColor(ChatColor.GRAY.asBungee());
|
||||||
|
|
||||||
|
for (org.bukkit.entity.Player onlinePlayer : Bukkit.getOnlinePlayers())
|
||||||
|
{
|
||||||
|
if (AdminList.isSuperAdmin(player))
|
||||||
|
{
|
||||||
|
onlinePlayer.spigot().sendMessage(textComponent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
DiscordBridge.transmitAdminMessage(textComponent.getText());
|
||||||
|
|
||||||
// Check absolute value to account for negatives
|
// Check absolute value to account for negatives
|
||||||
if (Math.abs(player.getLocation().getX()) >= MAX_XY_COORD || Math.abs(player.getLocation().getZ()) >= MAX_XY_COORD)
|
if (Math.abs(player.getLocation().getX()) >= MAX_XY_COORD || Math.abs(player.getLocation().getZ()) >= MAX_XY_COORD)
|
||||||
|
|
Loading…
Reference in a new issue