diff --git a/src/main/java/fr/xephi/authme/process/login/ProcessSyncronousPlayerLogin.java b/src/main/java/fr/xephi/authme/process/login/ProcessSyncronousPlayerLogin.java index 0c9ffd7cb..8d6221cf9 100644 --- a/src/main/java/fr/xephi/authme/process/login/ProcessSyncronousPlayerLogin.java +++ b/src/main/java/fr/xephi/authme/process/login/ProcessSyncronousPlayerLogin.java @@ -24,6 +24,9 @@ import org.bukkit.entity.Player; import org.bukkit.plugin.PluginManager; import org.bukkit.potion.PotionEffectType; +import com.google.common.io.ByteArrayDataOutput; +import com.google.common.io.ByteStreams; + /** */ public class ProcessSyncronousPlayerLogin implements Runnable { @@ -118,8 +121,7 @@ public class ProcessSyncronousPlayerLogin implements Runnable { } protected void sendBungeeMessage() { - ByteArrayOutputStream b = new ByteArrayOutputStream(); - DataOutputStream out = new DataOutputStream(b); + ByteArrayDataOutput out = ByteStreams.newDataOutput(); try { String str = "AuthMe;login;" + name; out.writeUTF("Forward"); @@ -127,7 +129,7 @@ public class ProcessSyncronousPlayerLogin implements Runnable { out.writeUTF("AuthMe"); out.writeShort(str.length()); out.writeUTF(str); - player.sendPluginMessage(plugin, "BungeeCord", b.toByteArray()); + player.sendPluginMessage(plugin, "BungeeCord", out.toByteArray()); } catch (Exception e) {} } diff --git a/src/main/java/fr/xephi/authme/process/logout/ProcessSyncronousPlayerLogout.java b/src/main/java/fr/xephi/authme/process/logout/ProcessSyncronousPlayerLogout.java index 69c9a80d5..0355124ef 100644 --- a/src/main/java/fr/xephi/authme/process/logout/ProcessSyncronousPlayerLogout.java +++ b/src/main/java/fr/xephi/authme/process/logout/ProcessSyncronousPlayerLogout.java @@ -20,6 +20,9 @@ import org.bukkit.potion.PotionEffectType; import org.bukkit.scheduler.BukkitScheduler; import org.bukkit.scheduler.BukkitTask; +import com.google.common.io.ByteArrayDataOutput; +import com.google.common.io.ByteStreams; + /** */ public class ProcessSyncronousPlayerLogout implements Runnable { @@ -43,8 +46,7 @@ public class ProcessSyncronousPlayerLogout implements Runnable { } protected void sendBungeeMessage() { - ByteArrayOutputStream b = new ByteArrayOutputStream(); - DataOutputStream out = new DataOutputStream(b); + ByteArrayDataOutput out = ByteStreams.newDataOutput(); try { String str = "AuthMe;logout;" + name; out.writeUTF("Forward"); @@ -52,7 +54,7 @@ public class ProcessSyncronousPlayerLogout implements Runnable { out.writeUTF("AuthMe"); out.writeShort(str.length()); out.writeUTF(str); - player.sendPluginMessage(plugin, "BungeeCord", b.toByteArray()); + player.sendPluginMessage(plugin, "BungeeCord", out.toByteArray()); } catch (Exception e) {} }