diff --git a/gateway/EaglercraftXVelocity/EaglerXVelocity-Latest.jar b/gateway/EaglercraftXVelocity/EaglerXVelocity-Latest.jar index c4902dae..78f2fbf0 100644 Binary files a/gateway/EaglercraftXVelocity/EaglerXVelocity-Latest.jar and b/gateway/EaglercraftXVelocity/EaglerXVelocity-Latest.jar differ diff --git a/gateway/EaglercraftXVelocity/src/main/java/net/lax1dude/eaglercraft/v1_8/plugin/gateway_velocity/EaglerXVelocityVersion.java b/gateway/EaglercraftXVelocity/src/main/java/net/lax1dude/eaglercraft/v1_8/plugin/gateway_velocity/EaglerXVelocityVersion.java index 23235908..cb53b7b0 100644 --- a/gateway/EaglercraftXVelocity/src/main/java/net/lax1dude/eaglercraft/v1_8/plugin/gateway_velocity/EaglerXVelocityVersion.java +++ b/gateway/EaglercraftXVelocity/src/main/java/net/lax1dude/eaglercraft/v1_8/plugin/gateway_velocity/EaglerXVelocityVersion.java @@ -17,13 +17,13 @@ package net.lax1dude.eaglercraft.v1_8.plugin.gateway_velocity; */ public class EaglerXVelocityVersion { - public static final String NATIVE_VELOCITY_BUILD = "3.3.0-SNAPSHOT:2016d148:b436"; + public static final String NATIVE_VELOCITY_BUILD = "3.4.0-SNAPSHOT:99aaf3ce:b439"; public static final String ID = "EaglerXVelocity"; public static final String PLUGIN_ID = "eaglerxvelocity"; public static final String NAME = "EaglercraftXVelocity"; public static final String DESCRIPTION = "Plugin to allow EaglercraftX 1.8 players to join your network, or allow EaglercraftX 1.8 players to use your network as a proxy to join other networks"; - public static final String VERSION = "1.1.2"; + public static final String VERSION = "1.1.3"; public static final String[] AUTHORS = new String[] { "lax1dude", "ayunami2000" }; } diff --git a/gateway/EaglercraftXVelocity/src/main/java/net/lax1dude/eaglercraft/v1_8/plugin/gateway_velocity/server/HttpWebSocketHandler.java b/gateway/EaglercraftXVelocity/src/main/java/net/lax1dude/eaglercraft/v1_8/plugin/gateway_velocity/server/HttpWebSocketHandler.java index a3904c66..175e69c4 100644 --- a/gateway/EaglercraftXVelocity/src/main/java/net/lax1dude/eaglercraft/v1_8/plugin/gateway_velocity/server/HttpWebSocketHandler.java +++ b/gateway/EaglercraftXVelocity/src/main/java/net/lax1dude/eaglercraft/v1_8/plugin/gateway_velocity/server/HttpWebSocketHandler.java @@ -117,6 +117,7 @@ public class HttpWebSocketHandler extends ChannelInboundHandlerAdapter { private static final Constructor stupid2Constructor; private static final Method loginEventFiredMethod; private static final Constructor stupid3Constructor; + private static final Constructor stupid3Constructor_new; private static final Method setPermissionFunctionMethod; private static final Field defaultPermissionsField; private static final Constructor stupid4Constructor; @@ -134,8 +135,18 @@ public class HttpWebSocketHandler extends ChannelInboundHandlerAdapter { stupid2Constructor.setAccessible(true); loginEventFiredMethod = LoginInboundConnection.class.getDeclaredMethod("loginEventFired", Runnable.class); loginEventFiredMethod.setAccessible(true); - stupid3Constructor = ConnectedPlayer.class.getDeclaredConstructor(VelocityServer.class, GameProfile.class, MinecraftConnection.class, InetSocketAddress.class, boolean.class, IdentifiedKey.class); - stupid3Constructor.setAccessible(true); + Constructor c3 = null; + Constructor c3_new = null; + try { + c3_new = ConnectedPlayer.class.getDeclaredConstructor(VelocityServer.class, GameProfile.class, MinecraftConnection.class, InetSocketAddress.class, String.class, boolean.class, IdentifiedKey.class); + c3_new.setAccessible(true); + } catch (NoSuchMethodException e) { + c3 = ConnectedPlayer.class.getDeclaredConstructor(VelocityServer.class, GameProfile.class, MinecraftConnection.class, InetSocketAddress.class, boolean.class, IdentifiedKey.class); + c3.setAccessible(true); + c3_new = null; + } + stupid3Constructor = c3; + stupid3Constructor_new = c3_new; setPermissionFunctionMethod = ConnectedPlayer.class.getDeclaredMethod("setPermissionFunction", PermissionFunction.class); setPermissionFunctionMethod.setAccessible(true); defaultPermissionsField = ConnectedPlayer.class.getDeclaredField("DEFAULT_PERMISSIONS"); @@ -1069,10 +1080,18 @@ public class HttpWebSocketHandler extends ChannelInboundHandlerAdapter { } ConnectedPlayer player; - try { - player = stupid3Constructor.newInstance(bungee, gp, con, lic.getVirtualHost().orElse(null), false, lic.getIdentifiedKey()); - } catch (InstantiationException | IllegalAccessException | InvocationTargetException e) { - throw new RuntimeException(e); + if(stupid3Constructor_new != null) { + try { + player = stupid3Constructor_new.newInstance(bungee, gp, con, lic.getVirtualHost().orElse(null), lic.getRawVirtualHost().orElse(null), false, lic.getIdentifiedKey()); + } catch (InstantiationException | IllegalAccessException | InvocationTargetException e) { + throw new RuntimeException(e); + } + }else { + try { + player = stupid3Constructor.newInstance(bungee, gp, con, lic.getVirtualHost().orElse(null), false, lic.getIdentifiedKey()); + } catch (InstantiationException | IllegalAccessException | InvocationTargetException e) { + throw new RuntimeException(e); + } } con.setAssociation(player); diff --git a/gateway/EaglercraftXVelocity/src/main/java/net/lax1dude/eaglercraft/v1_8/plugin/gateway_velocity/server/protocol/GameProtocolMessageController.java b/gateway/EaglercraftXVelocity/src/main/java/net/lax1dude/eaglercraft/v1_8/plugin/gateway_velocity/server/protocol/GameProtocolMessageController.java index 10238c3d..96caab5a 100644 --- a/gateway/EaglercraftXVelocity/src/main/java/net/lax1dude/eaglercraft/v1_8/plugin/gateway_velocity/server/protocol/GameProtocolMessageController.java +++ b/gateway/EaglercraftXVelocity/src/main/java/net/lax1dude/eaglercraft/v1_8/plugin/gateway_velocity/server/protocol/GameProtocolMessageController.java @@ -237,8 +237,10 @@ public class GameProtocolMessageController { pkt = sendQueueV4.remove(0); sendPluginMessage(owner, GamePluginMessageConstants.V4_CHANNEL, pkt); }else { - int i, j, sendCount = 0, totalLen = 0; + int i, j, sendCount, totalLen; while(!sendQueueV4.isEmpty()) { + sendCount = 0; + totalLen = 0; do { i = sendQueueV4.get(sendCount++).length; totalLen += GamePacketOutputBuffer.getVarIntSize(i) + i; diff --git a/gateway/EaglercraftXVelocity/src/main/resources/velocity-plugin.json b/gateway/EaglercraftXVelocity/src/main/resources/velocity-plugin.json index 467093f2..82c0e44f 100644 --- a/gateway/EaglercraftXVelocity/src/main/resources/velocity-plugin.json +++ b/gateway/EaglercraftXVelocity/src/main/resources/velocity-plugin.json @@ -1 +1 @@ -{"id":"eaglerxvelocity","name":"EaglercraftXVelocity","version":"1.1.2","description":"Plugin to allow EaglercraftX 1.8 players to join your network, or allow EaglercraftX 1.8 players to use your network as a proxy to join other networks","authors":["lax1dude", "ayunami2000"],"dependencies":[],"main":"net.lax1dude.eaglercraft.v1_8.plugin.gateway_velocity.EaglerXVelocity"} \ No newline at end of file +{"id":"eaglerxvelocity","name":"EaglercraftXVelocity","version":"1.1.3","description":"Plugin to allow EaglercraftX 1.8 players to join your network, or allow EaglercraftX 1.8 players to use your network as a proxy to join other networks","authors":["lax1dude", "ayunami2000"],"dependencies":[],"main":"net.lax1dude.eaglercraft.v1_8.plugin.gateway_velocity.EaglerXVelocity"} \ No newline at end of file diff --git a/gateway_version_velocity b/gateway_version_velocity index 8428158d..9c1218c2 100644 --- a/gateway_version_velocity +++ b/gateway_version_velocity @@ -1 +1 @@ -1.1.2 \ No newline at end of file +1.1.3 \ No newline at end of file