If a packet is not handled by the channel, log it, and clear it.
Could be spammy, but this is a serious bug and could cause a memory leak otherwise.
This commit is contained in:
parent
c56fc3b490
commit
72fbc45a19
1 changed files with 6 additions and 1 deletions
|
@ -12,6 +12,7 @@ import net.minecraft.network.play.client.C17PacketCustomPayload;
|
|||
import net.minecraft.network.play.server.S3FPacketCustomPayload;
|
||||
import org.apache.logging.log4j.Level;
|
||||
import cpw.mods.fml.common.FMLLog;
|
||||
import cpw.mods.fml.common.network.ByteBufUtils;
|
||||
import cpw.mods.fml.common.network.FMLNetworkException;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
import cpw.mods.fml.common.network.handshake.NetworkDispatcher;
|
||||
|
@ -68,7 +69,11 @@ public class FMLProxyPacket extends Packet {
|
|||
internalChannel.attr(NetworkRegistry.NET_HANDLER).set(this.netHandler);
|
||||
try
|
||||
{
|
||||
internalChannel.writeInbound(this);
|
||||
if (internalChannel.writeInbound(this))
|
||||
{
|
||||
FMLLog.severe("A packet for channel %s for side %s was not processed by the embedded channel - it has been dropped. Payload\n%s", this.channel, this.target, ByteBufUtils.getContentDump(this.payload));
|
||||
}
|
||||
internalChannel.inboundMessages().clear();
|
||||
}
|
||||
catch (FMLNetworkException ne)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue