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