Log when it's likely the indexedcodec is gonna fail, because of LAN server derps likely. Try and give some context for debuggers.
This commit is contained in:
parent
34382745ab
commit
c88bc769ef
1 changed files with 4 additions and 0 deletions
|
@ -70,6 +70,10 @@ public abstract class FMLIndexedMessageToMessageCodec<A> extends MessageToMessag
|
||||||
{
|
{
|
||||||
testMessageValidity(msg);
|
testMessageValidity(msg);
|
||||||
ByteBuf payload = msg.payload().copy();
|
ByteBuf payload = msg.payload().copy();
|
||||||
|
if (payload.readableBytes() < 1)
|
||||||
|
{
|
||||||
|
FMLLog.log(Level.ERROR, "The FMLIndexedCodec has received an empty buffer on channel %s, likely a result of a LAN server issue. Pipeline parts : %s", ctx.channel().attr(NetworkRegistry.FML_CHANNEL), ctx.pipeline().toString());
|
||||||
|
}
|
||||||
byte discriminator = payload.readByte();
|
byte discriminator = payload.readByte();
|
||||||
Class<? extends A> clazz = discriminators.get(discriminator);
|
Class<? extends A> clazz = discriminators.get(discriminator);
|
||||||
if(clazz == null)
|
if(clazz == null)
|
||||||
|
|
Loading…
Reference in a new issue