Cause found

This commit is contained in:
catfoolyou 2025-02-25 12:40:52 -05:00
parent 415b09b03f
commit 18ab3e8014
1 changed files with 9 additions and 3 deletions

View File

@ -5,6 +5,7 @@
package net.md_5.bungee.netty; package net.md_5.bungee.netty;
import io.netty.channel.Channel; import io.netty.channel.Channel;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelHandlerContext;
public class ChannelWrapper { public class ChannelWrapper {
@ -15,10 +16,15 @@ public class ChannelWrapper {
this.ch = ctx.channel(); this.ch = ctx.channel();
} }
public synchronized void write(final Object packet) { // This is a problem, the packets ARE being sent but arent coming to client public synchronized void write(final Object packet) { // This is a problem, the packets ARE being sent but they are null
if (!this.closed) { if (!this.closed) {
System.out.println("[ChannelWrapper] - trying to send packet"); StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
this.ch.write(packet); StackTraceElement element = stackTrace[2];
System.out.println("null packets coming from: " + element.getClassName()); // UserConnection
ChannelFuture cf = this.ch.write(packet);
if (!cf.isSuccess()) {
System.out.println("Couldnt send packet: " + cf.cause());
}
} }
} }