(1.2.1) Fixed various incompetent mistakes with the plugin
This commit is contained in:
parent
c6ac781036
commit
b25d4f0670
Binary file not shown.
|
@ -61,6 +61,8 @@ public class EaglerInitialHandler extends InitialHandler {
|
||||||
private final int gameProtocolVersion;
|
private final int gameProtocolVersion;
|
||||||
private final String username;
|
private final String username;
|
||||||
private final UUID playerUUID;
|
private final UUID playerUUID;
|
||||||
|
private final UUID playerUUIDOffline;
|
||||||
|
private final UUID playerUUIDRewrite;
|
||||||
private LoginResult loginResult;
|
private LoginResult loginResult;
|
||||||
private final InetSocketAddress eaglerAddress;
|
private final InetSocketAddress eaglerAddress;
|
||||||
private final InetSocketAddress virtualHost;
|
private final InetSocketAddress virtualHost;
|
||||||
|
@ -79,12 +81,14 @@ public class EaglerInitialHandler extends InitialHandler {
|
||||||
private static final Property[] NO_PROPERTIES = new Property[0];
|
private static final Property[] NO_PROPERTIES = new Property[0];
|
||||||
|
|
||||||
public EaglerInitialHandler(BungeeCord bungee, EaglerListenerConfig listener, final ChannelWrapper ch,
|
public EaglerInitialHandler(BungeeCord bungee, EaglerListenerConfig listener, final ChannelWrapper ch,
|
||||||
int gameProtocolVersion, String username, UUID playerUUID, InetSocketAddress address, String host,
|
int gameProtocolVersion, String username, UUID playerUUID, UUID offlineUUID, InetSocketAddress address,
|
||||||
String origin, ClientCertificateHolder clientCertificate) {
|
String host, String origin, ClientCertificateHolder clientCertificate) {
|
||||||
super(bungee, listener);
|
super(bungee, listener);
|
||||||
this.gameProtocolVersion = gameProtocolVersion;
|
this.gameProtocolVersion = gameProtocolVersion;
|
||||||
this.username = username;
|
this.username = username;
|
||||||
this.playerUUID = playerUUID;
|
this.playerUUID = playerUUID;
|
||||||
|
this.playerUUIDOffline = offlineUUID;
|
||||||
|
this.playerUUIDRewrite = bungee.config.isIpForward() ? playerUUID : offlineUUID;
|
||||||
this.eaglerAddress = address;
|
this.eaglerAddress = address;
|
||||||
this.origin = origin;
|
this.origin = origin;
|
||||||
this.skinLookupRateLimiter = new SimpleRateLimiter();
|
this.skinLookupRateLimiter = new SimpleRateLimiter();
|
||||||
|
@ -127,6 +131,14 @@ public class EaglerInitialHandler extends InitialHandler {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static UUID generateOfflineUUID(byte[] username) {
|
||||||
|
String offlinePlayerStr = "OfflinePlayer:";
|
||||||
|
byte[] uuidHashGenerator = new byte[offlinePlayerStr.length() + username.length];
|
||||||
|
System.arraycopy(offlinePlayerStr.getBytes(StandardCharsets.US_ASCII), 0, uuidHashGenerator, 0, offlinePlayerStr.length());
|
||||||
|
System.arraycopy(username, 0, uuidHashGenerator, offlinePlayerStr.length(), username.length);
|
||||||
|
return UUID.nameUUIDFromBytes(uuidHashGenerator);
|
||||||
|
}
|
||||||
|
|
||||||
void setLoginProfile(LoginResult obj) {
|
void setLoginProfile(LoginResult obj) {
|
||||||
this.loginResult = obj;
|
this.loginResult = obj;
|
||||||
try {
|
try {
|
||||||
|
@ -231,12 +243,12 @@ public class EaglerInitialHandler extends InitialHandler {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public UUID getOfflineId() {
|
public UUID getOfflineId() {
|
||||||
return playerUUID;
|
return playerUUIDOffline;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public UUID getRewriteId() {
|
public UUID getRewriteId() {
|
||||||
return playerUUID;
|
return playerUUIDRewrite;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -27,7 +27,7 @@ public class EaglerMinecraftByteBufEncoder extends MessageToMessageEncoder<ByteB
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void encode(ChannelHandlerContext var1, ByteBuf var2, List<Object> var3) throws Exception {
|
protected void encode(ChannelHandlerContext var1, ByteBuf var2, List<Object> var3) throws Exception {
|
||||||
var3.add(new BinaryWebSocketFrame(Unpooled.copiedBuffer(var2)));
|
var3.add(new BinaryWebSocketFrame(var2.retain()));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,7 @@ import io.netty.handler.codec.http.websocketx.BinaryWebSocketFrame;
|
||||||
import io.netty.handler.codec.http.websocketx.PingWebSocketFrame;
|
import io.netty.handler.codec.http.websocketx.PingWebSocketFrame;
|
||||||
import io.netty.handler.codec.http.websocketx.PongWebSocketFrame;
|
import io.netty.handler.codec.http.websocketx.PongWebSocketFrame;
|
||||||
import io.netty.handler.codec.http.websocketx.WebSocketFrame;
|
import io.netty.handler.codec.http.websocketx.WebSocketFrame;
|
||||||
|
import io.netty.util.ReferenceCountUtil;
|
||||||
import net.lax1dude.eaglercraft.v1_8.plugin.gateway_bungeecord.EaglerXBungee;
|
import net.lax1dude.eaglercraft.v1_8.plugin.gateway_bungeecord.EaglerXBungee;
|
||||||
import net.lax1dude.eaglercraft.v1_8.plugin.gateway_bungeecord.server.bungeeprotocol.EaglerBungeeProtocol;
|
import net.lax1dude.eaglercraft.v1_8.plugin.gateway_bungeecord.server.bungeeprotocol.EaglerBungeeProtocol;
|
||||||
import net.lax1dude.eaglercraft.v1_8.plugin.gateway_bungeecord.server.bungeeprotocol.EaglerProtocolAccessProxy;
|
import net.lax1dude.eaglercraft.v1_8.plugin.gateway_bungeecord.server.bungeeprotocol.EaglerProtocolAccessProxy;
|
||||||
|
@ -50,6 +51,7 @@ public class EaglerMinecraftDecoder extends MessageToMessageDecoder<WebSocketFra
|
||||||
if(frame instanceof BinaryWebSocketFrame) {
|
if(frame instanceof BinaryWebSocketFrame) {
|
||||||
BinaryWebSocketFrame in = (BinaryWebSocketFrame) frame;
|
BinaryWebSocketFrame in = (BinaryWebSocketFrame) frame;
|
||||||
ByteBuf buf = in.content();
|
ByteBuf buf = in.content();
|
||||||
|
buf.markReaderIndex();
|
||||||
int pktId = DefinedPacket.readVarInt(buf);
|
int pktId = DefinedPacket.readVarInt(buf);
|
||||||
DefinedPacket pkt = EaglerProtocolAccessProxy.createPacket(protocol, protocolVersion, pktId, server);
|
DefinedPacket pkt = EaglerProtocolAccessProxy.createPacket(protocol, protocolVersion, pktId, server);
|
||||||
Protocol bungeeProtocol = null;
|
Protocol bungeeProtocol = null;
|
||||||
|
@ -72,9 +74,11 @@ public class EaglerMinecraftDecoder extends MessageToMessageDecoder<WebSocketFra
|
||||||
EaglerXBungee.logger().severe("[DECODER][" + ctx.channel().remoteAddress() + "] Packet " +
|
EaglerXBungee.logger().severe("[DECODER][" + ctx.channel().remoteAddress() + "] Packet " +
|
||||||
pkt.getClass().getSimpleName() + " had extra bytes! (" + buf.readableBytes() + ")");
|
pkt.getClass().getSimpleName() + " had extra bytes! (" + buf.readableBytes() + ")");
|
||||||
}else {
|
}else {
|
||||||
|
buf.resetReaderIndex();
|
||||||
out.add(this.wrapPacket(pkt, buf, bungeeProtocol));
|
out.add(this.wrapPacket(pkt, buf, bungeeProtocol));
|
||||||
}
|
}
|
||||||
}else {
|
}else {
|
||||||
|
buf.resetReaderIndex();
|
||||||
out.add(this.wrapPacket(null, buf, bungeeProtocol));
|
out.add(this.wrapPacket(null, buf, bungeeProtocol));
|
||||||
}
|
}
|
||||||
}else if(frame instanceof PingWebSocketFrame) {
|
}else if(frame instanceof PingWebSocketFrame) {
|
||||||
|
@ -103,19 +107,12 @@ public class EaglerMinecraftDecoder extends MessageToMessageDecoder<WebSocketFra
|
||||||
this.protocolVersion = protocolVersion;
|
this.protocolVersion = protocolVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private PacketWrapper wrapPacket(DefinedPacket packet, ByteBuf buf, Protocol protocol) {
|
private PacketWrapper wrapPacket(DefinedPacket packet, ByteBuf buf, Protocol protocol) {
|
||||||
ByteBuf cbuf = null;
|
|
||||||
|
|
||||||
PacketWrapper var7;
|
|
||||||
try {
|
|
||||||
cbuf = buf.copy(0, buf.writerIndex());
|
|
||||||
PacketWrapper pkt;
|
PacketWrapper pkt;
|
||||||
if (packetWrapperConstructor != null) {
|
if (packetWrapperConstructor != null) {
|
||||||
try {
|
try {
|
||||||
pkt = packetWrapperConstructor.newInstance(packet, cbuf);
|
pkt = packetWrapperConstructor.newInstance(packet, buf);
|
||||||
cbuf = null;
|
buf.retain();
|
||||||
return pkt;
|
return pkt;
|
||||||
} catch (IllegalAccessException | InvocationTargetException | InstantiationException var14) {
|
} catch (IllegalAccessException | InvocationTargetException | InstantiationException var14) {
|
||||||
throw new RuntimeException(var14);
|
throw new RuntimeException(var14);
|
||||||
|
@ -123,26 +120,18 @@ public class EaglerMinecraftDecoder extends MessageToMessageDecoder<WebSocketFra
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
pkt = new PacketWrapper(packet, cbuf, protocol);
|
pkt = new PacketWrapper(packet, buf, protocol);
|
||||||
cbuf = null;
|
buf.retain();
|
||||||
return pkt;
|
return pkt;
|
||||||
} catch (NoSuchMethodError var15) {
|
} catch (NoSuchMethodError var15) {
|
||||||
try {
|
try {
|
||||||
packetWrapperConstructor = PacketWrapper.class.getDeclaredConstructor(DefinedPacket.class, ByteBuf.class);
|
packetWrapperConstructor = PacketWrapper.class.getDeclaredConstructor(DefinedPacket.class, ByteBuf.class);
|
||||||
pkt = packetWrapperConstructor.newInstance(packet, cbuf);
|
pkt = packetWrapperConstructor.newInstance(packet, buf);
|
||||||
cbuf = null;
|
buf.retain();
|
||||||
var7 = pkt;
|
return pkt;
|
||||||
} catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException | InstantiationException var13) {
|
} catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException | InstantiationException var13) {
|
||||||
throw new RuntimeException(var13);
|
throw new RuntimeException(var13);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} finally {
|
|
||||||
if (cbuf != null) {
|
|
||||||
cbuf.release();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return var7;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,6 @@ import java.lang.reflect.Method;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBuf;
|
||||||
import io.netty.buffer.Unpooled;
|
|
||||||
import io.netty.channel.ChannelHandlerContext;
|
import io.netty.channel.ChannelHandlerContext;
|
||||||
import io.netty.handler.codec.MessageToMessageEncoder;
|
import io.netty.handler.codec.MessageToMessageEncoder;
|
||||||
import io.netty.handler.codec.http.websocketx.BinaryWebSocketFrame;
|
import io.netty.handler.codec.http.websocketx.BinaryWebSocketFrame;
|
||||||
|
@ -52,7 +51,7 @@ public class EaglerMinecraftEncoder extends MessageToMessageEncoder<DefinedPacke
|
||||||
case STATUS:
|
case STATUS:
|
||||||
bungeeProtocol = Protocol.STATUS;
|
bungeeProtocol = Protocol.STATUS;
|
||||||
}
|
}
|
||||||
ByteBuf buf = Unpooled.buffer();
|
ByteBuf buf = ctx.alloc().buffer();
|
||||||
int pk = EaglerProtocolAccessProxy.getPacketId(protocol, protocolVersion, msg, server);
|
int pk = EaglerProtocolAccessProxy.getPacketId(protocol, protocolVersion, msg, server);
|
||||||
DefinedPacket.writeVarInt(pk, buf);
|
DefinedPacket.writeVarInt(pk, buf);
|
||||||
try {
|
try {
|
||||||
|
@ -65,11 +64,11 @@ public class EaglerMinecraftEncoder extends MessageToMessageEncoder<DefinedPacke
|
||||||
meth.invoke(msg, buf, server ? Direction.TO_CLIENT : Direction.TO_SERVER, protocolVersion);
|
meth.invoke(msg, buf, server ? Direction.TO_CLIENT : Direction.TO_SERVER, protocolVersion);
|
||||||
} catch (Exception e1) {
|
} catch (Exception e1) {
|
||||||
buf.release();
|
buf.release();
|
||||||
buf = Unpooled.EMPTY_BUFFER;
|
throw new RuntimeException("Could not call DefinedPacket write method!", e1);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
buf.release();
|
buf.release();
|
||||||
buf = Unpooled.EMPTY_BUFFER;
|
throw new RuntimeException("Could not call DefinedPacket write method!", e);
|
||||||
}
|
}
|
||||||
out.add(new BinaryWebSocketFrame(buf));
|
out.add(new BinaryWebSocketFrame(buf));
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,7 @@ import io.netty.handler.codec.http.HttpVersion;
|
||||||
import io.netty.handler.codec.http.websocketx.TextWebSocketFrame;
|
import io.netty.handler.codec.http.websocketx.TextWebSocketFrame;
|
||||||
import io.netty.handler.codec.http.websocketx.WebSocketServerHandshaker;
|
import io.netty.handler.codec.http.websocketx.WebSocketServerHandshaker;
|
||||||
import io.netty.handler.codec.http.websocketx.WebSocketServerHandshakerFactory;
|
import io.netty.handler.codec.http.websocketx.WebSocketServerHandshakerFactory;
|
||||||
|
import io.netty.util.ReferenceCountUtil;
|
||||||
import net.lax1dude.eaglercraft.v1_8.plugin.gateway_bungeecord.EaglerXBungee;
|
import net.lax1dude.eaglercraft.v1_8.plugin.gateway_bungeecord.EaglerXBungee;
|
||||||
import net.lax1dude.eaglercraft.v1_8.plugin.gateway_bungeecord.config.EaglerListenerConfig;
|
import net.lax1dude.eaglercraft.v1_8.plugin.gateway_bungeecord.config.EaglerListenerConfig;
|
||||||
import net.lax1dude.eaglercraft.v1_8.plugin.gateway_bungeecord.config.EaglerRateLimiter;
|
import net.lax1dude.eaglercraft.v1_8.plugin.gateway_bungeecord.config.EaglerRateLimiter;
|
||||||
|
@ -54,6 +55,7 @@ public class HttpHandshakeHandler extends ChannelInboundHandlerAdapter {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void channelRead(final ChannelHandlerContext ctx, Object msg) throws Exception {
|
public void channelRead(final ChannelHandlerContext ctx, Object msg) throws Exception {
|
||||||
|
try {
|
||||||
if (msg instanceof HttpRequest) {
|
if (msg instanceof HttpRequest) {
|
||||||
EaglerConnectionInstance pingTracker = ctx.channel().attr(EaglerPipeline.CONNECTION_INSTANCE).get();
|
EaglerConnectionInstance pingTracker = ctx.channel().attr(EaglerPipeline.CONNECTION_INSTANCE).get();
|
||||||
HttpRequest req = (HttpRequest) msg;
|
HttpRequest req = (HttpRequest) msg;
|
||||||
|
@ -165,6 +167,9 @@ public class HttpHandshakeHandler extends ChannelInboundHandlerAdapter {
|
||||||
}else {
|
}else {
|
||||||
ctx.close();
|
ctx.close();
|
||||||
}
|
}
|
||||||
|
}finally {
|
||||||
|
ReferenceCountUtil.release(msg);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
|
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
|
||||||
|
|
|
@ -19,6 +19,7 @@ import io.netty.handler.codec.http.websocketx.PingWebSocketFrame;
|
||||||
import io.netty.handler.codec.http.websocketx.PongWebSocketFrame;
|
import io.netty.handler.codec.http.websocketx.PongWebSocketFrame;
|
||||||
import io.netty.handler.codec.http.websocketx.TextWebSocketFrame;
|
import io.netty.handler.codec.http.websocketx.TextWebSocketFrame;
|
||||||
import io.netty.handler.codec.http.websocketx.WebSocketFrame;
|
import io.netty.handler.codec.http.websocketx.WebSocketFrame;
|
||||||
|
import io.netty.util.ReferenceCountUtil;
|
||||||
import net.lax1dude.eaglercraft.v1_8.plugin.gateway_bungeecord.EaglerXBungee;
|
import net.lax1dude.eaglercraft.v1_8.plugin.gateway_bungeecord.EaglerXBungee;
|
||||||
import net.lax1dude.eaglercraft.v1_8.plugin.gateway_bungeecord.config.EaglerListenerConfig;
|
import net.lax1dude.eaglercraft.v1_8.plugin.gateway_bungeecord.config.EaglerListenerConfig;
|
||||||
import net.lax1dude.eaglercraft.v1_8.plugin.gateway_bungeecord.server.query.QueryManager;
|
import net.lax1dude.eaglercraft.v1_8.plugin.gateway_bungeecord.server.query.QueryManager;
|
||||||
|
@ -123,6 +124,7 @@ public abstract class HttpServerQueryHandler extends ChannelInboundHandlerAdapte
|
||||||
}
|
}
|
||||||
|
|
||||||
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
|
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
|
||||||
|
try {
|
||||||
if(msg instanceof WebSocketFrame) {
|
if(msg instanceof WebSocketFrame) {
|
||||||
if(msg instanceof BinaryWebSocketFrame) {
|
if(msg instanceof BinaryWebSocketFrame) {
|
||||||
handleBinary(ctx, ((BinaryWebSocketFrame)msg).content());
|
handleBinary(ctx, ((BinaryWebSocketFrame)msg).content());
|
||||||
|
@ -136,6 +138,9 @@ public abstract class HttpServerQueryHandler extends ChannelInboundHandlerAdapte
|
||||||
}else {
|
}else {
|
||||||
EaglerXBungee.logger().severe("Unexpected Packet: " + msg.getClass().getSimpleName());
|
EaglerXBungee.logger().severe("Unexpected Packet: " + msg.getClass().getSimpleName());
|
||||||
}
|
}
|
||||||
|
}finally {
|
||||||
|
ReferenceCountUtil.release(msg);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
|
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
|
||||||
|
@ -200,15 +205,11 @@ public abstract class HttpServerQueryHandler extends ChannelInboundHandlerAdapte
|
||||||
}
|
}
|
||||||
|
|
||||||
public void sendBinaryResponse(byte[] bytes) {
|
public void sendBinaryResponse(byte[] bytes) {
|
||||||
ByteBuf buf = Unpooled.buffer(bytes.length, bytes.length);
|
context.writeAndFlush(new BinaryWebSocketFrame(Unpooled.wrappedBuffer(bytes)));
|
||||||
buf.writeBytes(bytes);
|
|
||||||
context.writeAndFlush(new BinaryWebSocketFrame(buf));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void sendBinaryResponseAndClose(byte[] bytes) {
|
public void sendBinaryResponseAndClose(byte[] bytes) {
|
||||||
ByteBuf buf = Unpooled.buffer(bytes.length, bytes.length);
|
context.writeAndFlush(new BinaryWebSocketFrame(Unpooled.wrappedBuffer(bytes))).addListener(ChannelFutureListener.CLOSE);
|
||||||
buf.writeBytes(bytes);
|
|
||||||
context.writeAndFlush(new BinaryWebSocketFrame(buf)).addListener(ChannelFutureListener.CLOSE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setKeepAlive(boolean enable) {
|
public void setKeepAlive(boolean enable) {
|
||||||
|
|
|
@ -35,6 +35,7 @@ import io.netty.handler.codec.http.websocketx.TextWebSocketFrame;
|
||||||
import io.netty.handler.codec.http.websocketx.WebSocketFrame;
|
import io.netty.handler.codec.http.websocketx.WebSocketFrame;
|
||||||
import io.netty.handler.timeout.ReadTimeoutHandler;
|
import io.netty.handler.timeout.ReadTimeoutHandler;
|
||||||
import io.netty.handler.timeout.WriteTimeoutHandler;
|
import io.netty.handler.timeout.WriteTimeoutHandler;
|
||||||
|
import io.netty.util.ReferenceCountUtil;
|
||||||
import io.netty.util.concurrent.Future;
|
import io.netty.util.concurrent.Future;
|
||||||
import io.netty.util.concurrent.GenericFutureListener;
|
import io.netty.util.concurrent.GenericFutureListener;
|
||||||
import net.lax1dude.eaglercraft.v1_8.plugin.gateway_bungeecord.EaglerXBungee;
|
import net.lax1dude.eaglercraft.v1_8.plugin.gateway_bungeecord.EaglerXBungee;
|
||||||
|
@ -106,6 +107,7 @@ public class HttpWebSocketHandler extends ChannelInboundHandlerAdapter {
|
||||||
private CharSequence clientVersionString;
|
private CharSequence clientVersionString;
|
||||||
private CharSequence clientUsername;
|
private CharSequence clientUsername;
|
||||||
private UUID clientUUID;
|
private UUID clientUUID;
|
||||||
|
private UUID offlineUUID;
|
||||||
private CharSequence clientRequestedServer;
|
private CharSequence clientRequestedServer;
|
||||||
private boolean clientAuth;
|
private boolean clientAuth;
|
||||||
private byte[] clientAuthUsername;
|
private byte[] clientAuthUsername;
|
||||||
|
@ -125,6 +127,7 @@ public class HttpWebSocketHandler extends ChannelInboundHandlerAdapter {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
|
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
|
||||||
|
try {
|
||||||
if(msg instanceof WebSocketFrame) {
|
if(msg instanceof WebSocketFrame) {
|
||||||
if(msg instanceof BinaryWebSocketFrame) {
|
if(msg instanceof BinaryWebSocketFrame) {
|
||||||
handleBinary(ctx, ((BinaryWebSocketFrame)msg).content());
|
handleBinary(ctx, ((BinaryWebSocketFrame)msg).content());
|
||||||
|
@ -138,6 +141,9 @@ public class HttpWebSocketHandler extends ChannelInboundHandlerAdapter {
|
||||||
}else {
|
}else {
|
||||||
EaglerXBungee.logger().severe("Unexpected Packet: " + msg.getClass().getSimpleName());
|
EaglerXBungee.logger().severe("Unexpected Packet: " + msg.getClass().getSimpleName());
|
||||||
}
|
}
|
||||||
|
}finally {
|
||||||
|
ReferenceCountUtil.release(msg);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
|
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
|
||||||
|
@ -557,11 +563,7 @@ public class HttpWebSocketHandler extends ChannelInboundHandlerAdapter {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String offlinePlayerStr = "OfflinePlayer:";
|
clientUUID = offlineUUID = EaglerInitialHandler.generateOfflineUUID(clientAuthUsername);
|
||||||
byte[] uuidHashGenerator = new byte[offlinePlayerStr.length() + clientAuthUsername.length];
|
|
||||||
System.arraycopy(offlinePlayerStr.getBytes(StandardCharsets.US_ASCII), 0, uuidHashGenerator, 0, offlinePlayerStr.length());
|
|
||||||
System.arraycopy(clientAuthUsername, 0, uuidHashGenerator, offlinePlayerStr.length(), clientAuthUsername.length);
|
|
||||||
clientUUID = UUID.nameUUIDFromBytes(uuidHashGenerator);
|
|
||||||
|
|
||||||
strlen = buffer.readUnsignedByte();
|
strlen = buffer.readUnsignedByte();
|
||||||
clientRequestedServer = buffer.readCharSequence(strlen, StandardCharsets.US_ASCII);
|
clientRequestedServer = buffer.readCharSequence(strlen, StandardCharsets.US_ASCII);
|
||||||
|
@ -775,7 +777,7 @@ public class HttpWebSocketHandler extends ChannelInboundHandlerAdapter {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
final EaglerInitialHandler initialHandler = new EaglerInitialHandler(bungee, conf, ch, gameProtocolVersion,
|
final EaglerInitialHandler initialHandler = new EaglerInitialHandler(bungee, conf, ch, gameProtocolVersion,
|
||||||
usernameStr, clientUUID, baseAddress, ctx.channel().attr(EaglerPipeline.HOST).get(),
|
usernameStr, clientUUID, offlineUUID, baseAddress, ctx.channel().attr(EaglerPipeline.HOST).get(),
|
||||||
ctx.channel().attr(EaglerPipeline.ORIGIN).get(), cert);
|
ctx.channel().attr(EaglerPipeline.ORIGIN).get(), cert);
|
||||||
if(!blockUpdate) {
|
if(!blockUpdate) {
|
||||||
List<ClientCertificateHolder> set = EaglerUpdateSvc.getCertList();
|
List<ClientCertificateHolder> set = EaglerUpdateSvc.getCertList();
|
||||||
|
|
|
@ -65,7 +65,7 @@ public class HttpMemoryCache {
|
||||||
}
|
}
|
||||||
|
|
||||||
public DefaultFullHttpResponse createHTTPResponse(HttpResponseStatus code) {
|
public DefaultFullHttpResponse createHTTPResponse(HttpResponseStatus code) {
|
||||||
DefaultFullHttpResponse response = new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, code, Unpooled.copiedBuffer(fileData));
|
DefaultFullHttpResponse response = new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, code, Unpooled.wrappedBuffer(fileData.retain()));
|
||||||
HttpHeaders responseHeaders = response.headers();
|
HttpHeaders responseHeaders = response.headers();
|
||||||
Date d = new Date();
|
Date d = new Date();
|
||||||
responseHeaders.add(HttpHeaderNames.CONTENT_TYPE, contentType.httpHeader);
|
responseHeaders.add(HttpHeaderNames.CONTENT_TYPE, contentType.httpHeader);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
name: EaglercraftXBungee
|
name: EaglercraftXBungee
|
||||||
main: net.lax1dude.eaglercraft.v1_8.plugin.gateway_bungeecord.EaglerXBungee
|
main: net.lax1dude.eaglercraft.v1_8.plugin.gateway_bungeecord.EaglerXBungee
|
||||||
version: 1.2.0
|
version: 1.2.1
|
||||||
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
|
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
|
||||||
author: lax1dude
|
author: lax1dude
|
|
@ -1 +1 @@
|
||||||
1.2.0
|
1.2.1
|
Loading…
Reference in New Issue
Block a user