Jump to content

Recommended Posts

Posted

Hi there,

 

I'm having problems with sending packets between the Server (Container) and the Client (Gui). Each time a button is pressed in the GUI it sends a packet to the server so the container can alter the item in its slot accordingly. On the other side the container sends a message to the client, so the GUI can display the status of the item/ the changes made to the item.

 

The strange thing: In Singleplayer everything works just fine. If I open my world to LAN and somebody else is joining everything is ok for me, it still works. But as soon as he (the player who joined my world) opens the GUI and the first packet is exchanged he gets kicked. If he runs a world with my mod in Singleplayer on his own he has no problems.

 

The errors occuring are eiter like that:

[12:30:29] [Netty Client IO #3/ERROR] [FML]: NetworkDispatcher exception
io.netty.handler.codec.DecoderException: The received string length is longer than maximum allowed (24 > 20)

 

or like that:

NetworkDispatcher exception
io.netty.handler.codec.DecoderException: java.lang.IndexOutOfBoundsException: readerIndex(28) + length(1) exceeds writerIndex(28): UnpooledHeapByteBuf(ridx: 28, widx: 28, cap: 28)

 

I have no idea, why the message should be to long... I'm sending one Integer and recieving one Integer.

I tried to add different MessageIds for server and client when registering the Message (doesn't work).

I searched the forums and via google but couldn't find anybody having the same problem or a solution that worked for me...

So help would really be appreciated :) Does anybody have an idea what the problem is?

 

His error log:

 

  Reveal hidden contents

 

 

If I take out one of the messages he still gets kicked and I get this error:

 

  Reveal hidden contents

 

 

This is my source code:

 

Main mod class:

 

  Reveal hidden contents

 

 

Container:

 

  Reveal hidden contents

 

 

Gui:

 

  Reveal hidden contents

 

 

Message and MessageHandler:

 

  Reveal hidden contents

 

 

Block:

 

  Reveal hidden contents

 

 

TileEntity:

 

  Reveal hidden contents

 

 

The Item I'm trying to change in the gui/container:

 

  Reveal hidden contents

 

 

GuiHandler:

 

  Reveal hidden contents

 

Posted

I'm pretty sure the error is because your SimpleNetworkWrapper channel name exceeds the maximum length of 20.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.