From 17c2099bf152737d21187dd3dda4eba867a2ab16 Mon Sep 17 00:00:00 2001 From: games647 Date: Fri, 16 Sep 2016 17:40:42 +0200 Subject: [PATCH] Make use of the awesome Java 8 features --- .../fastlogin/bukkit/EncryptionUtil.java | 5 +- .../bukkit/commands/CrackedCommand.java | 5 +- .../bukkit/commands/PremiumCommand.java | 4 +- .../bukkit/hooks/CrazyLoginHook.java | 4 +- .../fastlogin/bukkit/hooks/RoyalAuthHook.java | 14 ++- .../fastlogin/bukkit/hooks/xAuthHook.java | 13 +-- .../bukkit/listener/BungeeCordListener.java | 19 +--- .../protocollib/LoginSkinApplyListener.java | 9 +- .../protocollib/VerifyResponseTask.java | 14 ++- .../bukkit/tasks/DelayedAuthHook.java | 1 + .../games647/fastlogin/bungee/BungeeCore.java | 11 +-- .../fastlogin/bungee/ImportCommand.java | 1 - .../listener/PluginMessageListener.java | 88 ++++++++++--------- .../fastlogin/core/shared/FastLoginCore.java | 9 +- .../core/shared/MojangApiConnector.java | 2 +- 15 files changed, 85 insertions(+), 114 deletions(-) diff --git a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/EncryptionUtil.java b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/EncryptionUtil.java index a2dff92d..20222b8b 100644 --- a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/EncryptionUtil.java +++ b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/EncryptionUtil.java @@ -10,6 +10,7 @@ import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.security.PrivateKey; import java.security.PublicKey; +import java.util.stream.Stream; import javax.crypto.BadPaddingException; import javax.crypto.Cipher; @@ -48,9 +49,7 @@ public class EncryptionUtil { private static byte[] digestOperation(String algo, byte[]... content) { try { MessageDigest messagedigest = MessageDigest.getInstance(algo); - for (byte[] data : content) { - messagedigest.update(data); - } + Stream.of(content).forEach(messagedigest::update); return messagedigest.digest(); } catch (NoSuchAlgorithmException nosuchalgorithmexception) { diff --git a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/commands/CrackedCommand.java b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/commands/CrackedCommand.java index 0235c87e..a6476107 100644 --- a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/commands/CrackedCommand.java +++ b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/commands/CrackedCommand.java @@ -37,9 +37,10 @@ public class CrackedCommand implements CommandExecutor { } } else { //todo: load async if - final PlayerProfile profile = plugin.getCore().getStorage().loadProfile(sender.getName()); + PlayerProfile profile = plugin.getCore().getStorage().loadProfile(sender.getName()); if (profile.isPremium()) { sender.sendMessage(plugin.getCore().getMessage("remove-premium")); + profile.setPremium(false); profile.setUuid(null); Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> { @@ -72,7 +73,7 @@ public class CrackedCommand implements CommandExecutor { } } else { //todo: load async - final PlayerProfile profile = plugin.getCore().getStorage().loadProfile(args[0]); + PlayerProfile profile = plugin.getCore().getStorage().loadProfile(args[0]); if (profile == null) { sender.sendMessage("Error occured"); return; diff --git a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/commands/PremiumCommand.java b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/commands/PremiumCommand.java index 9ba15f47..03e715fe 100644 --- a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/commands/PremiumCommand.java +++ b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/commands/PremiumCommand.java @@ -53,7 +53,7 @@ public class PremiumCommand implements CommandExecutor { plugin.getCore().getPendingConfirms().remove(id); //todo: load async - final PlayerProfile profile = plugin.getCore().getStorage().loadProfile(sender.getName()); + PlayerProfile profile = plugin.getCore().getStorage().loadProfile(sender.getName()); if (profile.isPremium()) { sender.sendMessage(plugin.getCore().getMessage("already-exists")); } else { @@ -89,7 +89,7 @@ public class PremiumCommand implements CommandExecutor { } } else { //todo: load async - final PlayerProfile profile = plugin.getCore().getStorage().loadProfile(args[0]); + PlayerProfile profile = plugin.getCore().getStorage().loadProfile(args[0]); if (profile == null) { sender.sendMessage(plugin.getCore().getMessage("player-unknown")); return; diff --git a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/hooks/CrazyLoginHook.java b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/hooks/CrazyLoginHook.java index 4e70fb54..8ba1e1e2 100644 --- a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/hooks/CrazyLoginHook.java +++ b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/hooks/CrazyLoginHook.java @@ -29,10 +29,10 @@ public class CrazyLoginHook implements AuthPlugin { private final PlayerListener playerListener = getListener(); @Override - public boolean forceLogin(final Player player) { + public boolean forceLogin(Player player) { //not thread-safe operation Future future = Bukkit.getScheduler().callSyncMethod(crazyLoginPlugin, () -> { - LoginPlayerData playerData = crazyLoginPlugin.getPlayerData(player.getName()); + LoginPlayerData playerData = crazyLoginPlugin.getPlayerData(player); if (playerData != null) { //mark the account as logged in playerData.setLoggedIn(true); diff --git a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/hooks/RoyalAuthHook.java b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/hooks/RoyalAuthHook.java index 0e7d8020..81050d12 100644 --- a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/hooks/RoyalAuthHook.java +++ b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/hooks/RoyalAuthHook.java @@ -24,11 +24,10 @@ public class RoyalAuthHook implements AuthPlugin { private final RoyalAuth royalAuthPlugin = (RoyalAuth) Bukkit.getPluginManager().getPlugin("RoyalAuth"); @Override - public boolean forceLogin(final Player player) { - //not thread-safe - Future future = Bukkit.getScheduler().callSyncMethod(royalAuthPlugin, () -> { - AuthPlayer authPlayer = AuthPlayer.getAuthPlayer(player); + public boolean forceLogin(Player player) { + AuthPlayer authPlayer = AuthPlayer.getAuthPlayer(player); + Future future = Bukkit.getScheduler().callSyncMethod(royalAuthPlugin, () -> { //https://github.com/RoyalDev/RoyalAuth/blob/master/src/main/java/org/royaldev/royalauth/commands/CmdLogin.java#L62 //not thread-safe authPlayer.login(); @@ -56,11 +55,8 @@ public class RoyalAuthHook implements AuthPlugin { AuthPlayer authPlayer = AuthPlayer.getAuthPlayer(player); boolean registerSuccess = authPlayer.setPassword(password, Config.passwordHashType); - if (registerSuccess) { - //login in the player after registration - return forceLogin(player); - } - return false; + //login in the player after registration + return registerSuccess && forceLogin(player); } } diff --git a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/hooks/xAuthHook.java b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/hooks/xAuthHook.java index 4036b058..1ca6e894 100644 --- a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/hooks/xAuthHook.java +++ b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/hooks/xAuthHook.java @@ -25,7 +25,7 @@ public class xAuthHook implements AuthPlugin { protected final xAuth xAuthPlugin = xAuth.getPlugin(); @Override - public boolean forceLogin(final Player player) { + public boolean forceLogin(Player player) { //not thread-safe Future future = Bukkit.getScheduler().callSyncMethod(xAuthPlugin, () -> { xAuthPlayer xAuthPlayer = xAuthPlugin.getPlayerManager().getPlayer(player); @@ -56,7 +56,7 @@ public class xAuthHook implements AuthPlugin { } @Override - public boolean forceRegister(final Player player, final String password) { + public boolean forceRegister(Player player, final String password) { //not thread-safe Future future = Bukkit.getScheduler().callSyncMethod(xAuthPlugin, () -> { xAuthPlayer xAuthPlayer = xAuthPlugin.getPlayerManager().getPlayer(player); @@ -73,13 +73,8 @@ public class xAuthHook implements AuthPlugin { }); try { - boolean success = future.get(); - if (success) { - //login in the player after registration - return forceLogin(player); - } - - return false; + //login in the player after registration + return future.get() && forceLogin(player); } catch (InterruptedException | ExecutionException ex) { xAuthPlugin.getLogger().log(Level.SEVERE, "Failed to forceLogin", ex); return false; diff --git a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/BungeeCordListener.java b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/BungeeCordListener.java index 3c78d288..e515f5d9 100644 --- a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/BungeeCordListener.java +++ b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/BungeeCordListener.java @@ -5,7 +5,6 @@ import com.github.games647.fastlogin.bukkit.FastLoginBukkit; import com.github.games647.fastlogin.bukkit.tasks.ForceLoginTask; import com.github.games647.fastlogin.core.hooks.AuthPlugin; import com.google.common.base.Charsets; -import com.google.common.collect.Sets; import com.google.common.io.ByteArrayDataInput; import com.google.common.io.ByteStreams; import com.google.common.io.Files; @@ -16,6 +15,7 @@ import java.util.List; import java.util.Set; import java.util.UUID; import java.util.logging.Level; +import java.util.stream.Collectors; import org.bukkit.Bukkit; import org.bukkit.entity.Player; @@ -42,7 +42,7 @@ public class BungeeCordListener implements PluginMessageListener { } @Override - public void onPluginMessageReceived(String channel, final Player player, byte[] message) { + public void onPluginMessageReceived(String channel, Player player, byte[] message) { if (!channel.equals(plugin.getName())) { return; } @@ -69,7 +69,7 @@ public class BungeeCordListener implements PluginMessageListener { //fail if BungeeCord support is disabled (id = null) if (proxyIds.contains(sourceId)) { - final String id = '/' + checkedPlayer.getAddress().getAddress().getHostAddress() + ':' + String id = '/' + checkedPlayer.getAddress().getAddress().getHostAddress() + ':' + checkedPlayer.getAddress().getPort(); if ("AUTO_LOGIN".equalsIgnoreCase(subchannel)) { BukkitLoginSession playerSession = new BukkitLoginSession(playerName, true); @@ -105,19 +105,8 @@ public class BungeeCordListener implements PluginMessageListener { whitelistFile.createNewFile(); } - Set ids = Sets.newHashSet(); - List lines = Files.readLines(whitelistFile, Charsets.UTF_8); - for (String line : lines) { - if (line == null || line.trim().isEmpty()) { - continue; - } - - UUID uuid = UUID.fromString(line.trim()); - ids.add(uuid); - } - - return ids; + return lines.stream().map(String::trim).map(UUID::fromString).collect(Collectors.toSet()); } catch (IOException ex) { plugin.getLogger().log(Level.SEVERE, "Failed to create file for Proxy whitelist", ex); } catch (Exception ex) { diff --git a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/protocollib/LoginSkinApplyListener.java b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/protocollib/LoginSkinApplyListener.java index e9fe26d7..528705e7 100644 --- a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/protocollib/LoginSkinApplyListener.java +++ b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/protocollib/LoginSkinApplyListener.java @@ -42,17 +42,18 @@ public class LoginSkinApplyListener implements Listener { Collection sessions = plugin.getSessions().values(); for (BukkitLoginSession session : sessions) { if (session.getUsername().equals(player.getName())) { - applySkin(player, session); + String signature = session.getSkinSignature(); + String skinData = session.getEncodedSkinData(); + + applySkin(player, skinData, signature); break; } } } } - private void applySkin(Player player, BukkitLoginSession session) { + private void applySkin(Player player, String skinData, String signature) { WrappedGameProfile gameProfile = WrappedGameProfile.fromPlayer(player); - String skinData = session.getEncodedSkinData(); - String signature = session.getSkinSignature(); if (skinData != null && signature != null) { WrappedSignedProperty skin = WrappedSignedProperty.fromValues("textures", skinData, signature); try { diff --git a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/protocollib/VerifyResponseTask.java b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/protocollib/VerifyResponseTask.java index 1d56032f..45f9bba3 100644 --- a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/protocollib/VerifyResponseTask.java +++ b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/protocollib/VerifyResponseTask.java @@ -56,6 +56,11 @@ public class VerifyResponseTask implements Runnable { verifyResponse(session); } } finally { + //this is a fake packet; it shouldn't be send to the server + synchronized (packetEvent.getAsyncMarker().getProcessingLock()) { + packetEvent.setCancelled(true); + } + ProtocolLibrary.getProtocolManager().getAsynchronousManager().signalPacketTransmission(packetEvent); } } @@ -90,11 +95,6 @@ public class VerifyResponseTask implements Runnable { , "Player {0} ({1}) tried to log in with an invalid session ServerId: {2}" , session.getUsername(), fromPlayer.getAddress(), serverId); } - - //this is a fake packet; it shouldn't be send to the server - synchronized (packetEvent.getAsyncMarker().getProcessingLock()) { - packetEvent.setCancelled(true); - } } private void setPremiumUUID(UUID premiumUUID) { @@ -169,10 +169,6 @@ public class VerifyResponseTask implements Runnable { } kickPlayer(packetEvent.getPlayer(), kickReason); - //cancel the event in order to prevent the server receiving an invalid packet - synchronized (packetEvent.getAsyncMarker().getProcessingLock()) { - packetEvent.setCancelled(true); - } } private void kickPlayer(Player player, String reason) { diff --git a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/tasks/DelayedAuthHook.java b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/tasks/DelayedAuthHook.java index 13a62851..7a253942 100644 --- a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/tasks/DelayedAuthHook.java +++ b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/tasks/DelayedAuthHook.java @@ -43,6 +43,7 @@ public class DelayedAuthHook implements Runnable { List>> supportedHooks = Lists.newArrayList(AuthMeHook.class , CrazyLoginHook.class, LogItHook.class, LoginSecurityHook.class, UltraAuthHook.class , xAuthHook.class); + for (Class> clazz : supportedHooks) { String pluginName = clazz.getSimpleName().replace("Hook", ""); //uses only member classes which uses AuthPlugin interface (skip interfaces) diff --git a/bungee/src/main/java/com/github/games647/fastlogin/bungee/BungeeCore.java b/bungee/src/main/java/com/github/games647/fastlogin/bungee/BungeeCore.java index 7b05df28..0422fc2b 100644 --- a/bungee/src/main/java/com/github/games647/fastlogin/bungee/BungeeCore.java +++ b/bungee/src/main/java/com/github/games647/fastlogin/bungee/BungeeCore.java @@ -1,18 +1,17 @@ package com.github.games647.fastlogin.bungee; import com.github.games647.fastlogin.core.shared.FastLoginCore; -import com.google.common.collect.Maps; import com.google.common.util.concurrent.ThreadFactoryBuilder; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.nio.file.Files; -import java.util.Collection; import java.util.Map; import java.util.concurrent.ThreadFactory; import java.util.logging.Level; import java.util.logging.Logger; +import java.util.stream.Collectors; import net.md_5.bungee.api.ChatColor; import net.md_5.bungee.api.connection.ProxiedPlayer; @@ -24,13 +23,7 @@ import net.md_5.bungee.config.YamlConfiguration; public class BungeeCore extends FastLoginCore { private static Map generateConfigMap(Configuration config) { - Map configMap = Maps.newHashMap(); - Collection keys = config.getKeys(); - keys.forEach(key -> { - configMap.put(key, config.get(key)); - }); - - return configMap; + return config.getKeys().stream().collect(Collectors.toMap(key -> key, key -> config.get(key))); } private final FastLoginBungee plugin; diff --git a/bungee/src/main/java/com/github/games647/fastlogin/bungee/ImportCommand.java b/bungee/src/main/java/com/github/games647/fastlogin/bungee/ImportCommand.java index 3f1023aa..199cd4a2 100644 --- a/bungee/src/main/java/com/github/games647/fastlogin/bungee/ImportCommand.java +++ b/bungee/src/main/java/com/github/games647/fastlogin/bungee/ImportCommand.java @@ -1,6 +1,5 @@ package com.github.games647.fastlogin.bungee; -import com.github.games647.fastlogin.bungee.FastLoginBungee; import com.github.games647.fastlogin.core.AuthStorage; import com.github.games647.fastlogin.core.importer.ImportPlugin; diff --git a/bungee/src/main/java/com/github/games647/fastlogin/bungee/listener/PluginMessageListener.java b/bungee/src/main/java/com/github/games647/fastlogin/bungee/listener/PluginMessageListener.java index 5b2d1441..ca79a477 100644 --- a/bungee/src/main/java/com/github/games647/fastlogin/bungee/listener/PluginMessageListener.java +++ b/bungee/src/main/java/com/github/games647/fastlogin/bungee/listener/PluginMessageListener.java @@ -38,52 +38,56 @@ public class PluginMessageListener implements Listener { //check if the message is sent from the server if (Server.class.isAssignableFrom(pluginMessageEvent.getSender().getClass())) { - readMessage(pluginMessageEvent); + //so that we can safely process this in the background + byte[] data = Arrays.copyOf(pluginMessageEvent.getData(), pluginMessageEvent.getData().length); + ProxiedPlayer forPlayer = (ProxiedPlayer) pluginMessageEvent.getReceiver(); + + ProxyServer.getInstance().getScheduler().runAsync(plugin, () -> { + readMessage(forPlayer, data); + }); } } - private void readMessage(PluginMessageEvent pluginMessageEvent) { - //so that we can safely process this in the background - byte[] data = Arrays.copyOf(pluginMessageEvent.getData(), pluginMessageEvent.getData().length); - ProxiedPlayer forPlayer = (ProxiedPlayer) pluginMessageEvent.getReceiver(); + private void readMessage(ProxiedPlayer forPlayer, byte[] data) { + ByteArrayDataInput dataInput = ByteStreams.newDataInput(data); + String subchannel = dataInput.readUTF(); + if ("ON".equals(subchannel)) { + String playerName = dataInput.readUTF(); - ProxyServer.getInstance().getScheduler().runAsync(plugin, () -> { - ByteArrayDataInput dataInput = ByteStreams.newDataInput(data); - String subchannel = dataInput.readUTF(); - if ("ON".equals(subchannel)) { - String playerName = dataInput.readUTF(); - - if (playerName.equals(forPlayer.getName()) && plugin.getConfig().getBoolean("premium-warning") - && !plugin.getCore().getPendingConfirms().contains(forPlayer.getUniqueId())) { - String message = plugin.getCore().getMessage("premium-warning"); - forPlayer.sendMessage(TextComponent.fromLegacyText(message)); - plugin.getCore().getPendingConfirms().add(forPlayer.getUniqueId()); - return; - } - - plugin.getCore().getPendingConfirms().remove(forPlayer.getUniqueId()); - AsyncToggleMessage task = new AsyncToggleMessage(plugin, forPlayer, playerName, true); - ProxyServer.getInstance().getScheduler().runAsync(plugin, task); - } else if ("OFF".equals(subchannel)) { - String playerName = dataInput.readUTF(); - - AsyncToggleMessage task = new AsyncToggleMessage(plugin, forPlayer, playerName, false); - ProxyServer.getInstance().getScheduler().runAsync(plugin, task); - } else if ("SUCCESS".equals(subchannel)) { - if (forPlayer.getPendingConnection().isOnlineMode()) { - //bukkit module successfully received and force logged in the user - //update only on success to prevent corrupt data - BungeeLoginSession loginSession = plugin.getSession().get(forPlayer.getPendingConnection()); - PlayerProfile playerProfile = loginSession.getProfile(); - loginSession.setRegistered(true); - - if (!loginSession.isAlreadySaved()) { - playerProfile.setPremium(true); - plugin.getCore().getStorage().save(playerProfile); - loginSession.setAlreadySaved(true); - } - } + if (playerName.equals(forPlayer.getName()) && plugin.getConfig().getBoolean("premium-warning") + && !plugin.getCore().getPendingConfirms().contains(forPlayer.getUniqueId())) { + String message = plugin.getCore().getMessage("premium-warning"); + forPlayer.sendMessage(TextComponent.fromLegacyText(message)); + plugin.getCore().getPendingConfirms().add(forPlayer.getUniqueId()); + return; } - }); + + plugin.getCore().getPendingConfirms().remove(forPlayer.getUniqueId()); + AsyncToggleMessage task = new AsyncToggleMessage(plugin, forPlayer, playerName, true); + ProxyServer.getInstance().getScheduler().runAsync(plugin, task); + } else if ("OFF".equals(subchannel)) { + String playerName = dataInput.readUTF(); + + AsyncToggleMessage task = new AsyncToggleMessage(plugin, forPlayer, playerName, false); + ProxyServer.getInstance().getScheduler().runAsync(plugin, task); + } else if ("SUCCESS".equals(subchannel)) { + onSuccessMessage(forPlayer); + } + } + + private void onSuccessMessage(ProxiedPlayer forPlayer) { + if (forPlayer.getPendingConnection().isOnlineMode()) { + //bukkit module successfully received and force logged in the user + //update only on success to prevent corrupt data + BungeeLoginSession loginSession = plugin.getSession().get(forPlayer.getPendingConnection()); + PlayerProfile playerProfile = loginSession.getProfile(); + loginSession.setRegistered(true); + + if (!loginSession.isAlreadySaved()) { + playerProfile.setPremium(true); + plugin.getCore().getStorage().save(playerProfile); + loginSession.setAlreadySaved(true); + } + } } } diff --git a/core/src/main/java/com/github/games647/fastlogin/core/shared/FastLoginCore.java b/core/src/main/java/com/github/games647/fastlogin/core/shared/FastLoginCore.java index 1bacffc7..a37a7f6f 100644 --- a/core/src/main/java/com/github/games647/fastlogin/core/shared/FastLoginCore.java +++ b/core/src/main/java/com/github/games647/fastlogin/core/shared/FastLoginCore.java @@ -42,12 +42,9 @@ public abstract class FastLoginCore

{ builder.maximumSize(maxSize); } - return builder.build(new CacheLoader() { - @Override - public V load(K key) throws Exception { - throw new UnsupportedOperationException("Not supported yet."); - } - }); + return builder.build(CacheLoader.from(() -> { + throw new UnsupportedOperationException(); + })); } public static UUID parseId(String withoutDashes) { diff --git a/core/src/main/java/com/github/games647/fastlogin/core/shared/MojangApiConnector.java b/core/src/main/java/com/github/games647/fastlogin/core/shared/MojangApiConnector.java index 09faf1ab..9d5cd929 100644 --- a/core/src/main/java/com/github/games647/fastlogin/core/shared/MojangApiConnector.java +++ b/core/src/main/java/com/github/games647/fastlogin/core/shared/MojangApiConnector.java @@ -62,7 +62,7 @@ public abstract class MojangApiConnector { try { InetAddress address = InetAddress.getByName(localAddress); if (!address.isAnyLocalAddress()) { - logger.log(Level.WARNING, "Submitted IP-Address is not local", address); + logger.log(Level.WARNING, "Submitted IP-Address is not local {0}", address); continue; }