NametagEdit

721k Downloads

Internal Exception: io.netty.handler.codec.DecoderException: The received string is longer than maximum allowed (18 > 16)

VanadeysHaven opened this issue ยท 8 comments

commented

Hey, I'm using the Nametag plugin on my server as a API for my custom plugin. But I ran into a problem.
When there is just one player online, it's fine, but when a different player joins, it's kicking ALL players off the server with the following error:
Internal Exception: io.netty.handler.codec.DecoderException: The received string is longer than maximum allowed (18 > 16)

I googled around and found this:
http://www.minecraftforum.net/forums/support/server-support/1883605-my-server-keeps-losing-connection?comment=9
This made sense to me because I noticed when updating a nametag, it would also apply to ALL NPC's with the same name as the player. When the name is even one character off it doesn't change anymore, it is case-sensitive.
So a simple fix would be to change all the NPC names. But I was wondering to if there is a way around this. And if you guys were aware of this problem.
I hope you can help me out with this.

commented

Oh I think I may have forgotten to put a a 16 character tag limit in the API. I'll have a commit out soon. Thanks!

commented

Well the thing is, the names above our heads appear to be fine. please note it doesn't apply to all players, and the weirdest thing is, it doesn't crash on my name, but others (that have a shorter tag + name) it does. And when i disable Citizens 2 it seems to be fine. So it's about the NPC's.

This is my ranks enum class, as you can see (the last argument is my nametag) they don't exceed the limit at all.

commented

So you have an NPC of a player that is potentially already online? My thinking is that the NPC might already have a prefix/suffix, and we're trying to add even more to it. Interesting though, haven't seen this issue before.

We use Citizens2 on this server I work for, and use NametagEdit. Haven't encountered this issue before. I'll check it out soon.

commented

The NPC's are like a staff stand, so NPC's there have the exact name and skin of a player, when that player joins it changes the prefix on both the NPC and the actual player. But when the player leaves, the prefix of the NPC changes back to normal. But it only seems to work when the name is EXACTLY equal to that of the player. So just a white (no colorcodes) name with the right capitals.

You can recreate it with the following steps:

  1. Spawn a NPC of your player.
  2. Give yourself a prefix, and it should change on the NPC aswell.

And the NametagEdit.getApi().setPefix(...) only gets called when a player joins and when their rank changes.

commented

You are calling this api method in the PlayerJoinEvent?

commented

Yeah, but for now as a temp solution I have changed the prefixes to just be a color, and now it seems to work fine. But I really want the rank also be above the players head. (On the player itself not the NPC)

commented

Are you still have any issues?

commented

Sorry to reopen this but I still get this periodically which to fix it I have to restart nametagedit with plugman. I usually get string lengths around ~40. E.g. 40 > 16