Attempt to fix leak
This commit is contained in:
parent
d26eee4610
commit
97f1d2b493
|
|
@ -4,7 +4,7 @@ plugins {
|
|||
}
|
||||
|
||||
group 'org.adde0109'
|
||||
version '1.1.4'
|
||||
version '1.1.4-alpha'
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
|
|
@ -21,8 +21,8 @@ dependencies {
|
|||
implementation 'com.electronwill.night-config:toml:3.6.5'
|
||||
implementation 'org.bstats:bstats-velocity:3.0.0'
|
||||
implementation 'org.apache.commons:commons-collections4:4.4'
|
||||
implementation 'io.netty:netty-buffer:4.1.79.Final'
|
||||
implementation 'io.netty:netty-transport:4.1.79.Final'
|
||||
compileOnly 'io.netty:netty-buffer:4.1.85.Final'
|
||||
compileOnly 'io.netty:netty-transport:4.1.85.Final'
|
||||
}
|
||||
|
||||
shadowJar {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import io.netty.channel.ChannelInboundHandlerAdapter;
|
|||
public class FML2CRPMResetCompleteDecoder extends ChannelInboundHandlerAdapter {
|
||||
|
||||
@Override
|
||||
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
|
||||
public void channelRead(ChannelHandlerContext ctx, Object msg) {
|
||||
if (msg instanceof ByteBuf buf) {
|
||||
if (!ctx.channel().isActive() || !buf.isReadable()) {
|
||||
buf.release();
|
||||
|
|
@ -21,13 +21,18 @@ public class FML2CRPMResetCompleteDecoder extends ChannelInboundHandlerAdapter {
|
|||
int packetId = ProtocolUtils.readVarInt(buf);
|
||||
if (packetId == 0x02 && buf.readableBytes() > 1) {
|
||||
try {
|
||||
MinecraftPacket packet = new LoginPluginResponse();
|
||||
packet.decode(buf, ProtocolUtils.Direction.SERVERBOUND,null);
|
||||
ctx.fireChannelRead(packet);
|
||||
} finally {
|
||||
buf.release();
|
||||
}
|
||||
return;
|
||||
int id = ProtocolUtils.readVarInt(buf);
|
||||
boolean success = buf.readBoolean();
|
||||
if (id == 98) {
|
||||
try {
|
||||
MinecraftPacket packet = new LoginPluginResponse(id,success,buf.readRetainedSlice(buf.readableBytes()));
|
||||
ctx.fireChannelRead(packet);
|
||||
} finally {
|
||||
buf.release();
|
||||
}
|
||||
return;
|
||||
}
|
||||
} catch (Exception ignored) {}
|
||||
} else {
|
||||
buf.readerIndex(originalReaderIndex);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -96,7 +96,6 @@ public class FML2ClientConnectionPhase extends VelocityForgeClientConnectionPhas
|
|||
|
||||
public void handleJoinGame() {
|
||||
this.onJoinGame.complete(null);
|
||||
this.onJoinGame = null;
|
||||
}
|
||||
|
||||
public CompletableFuture<Void> awaitJoinGame() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user