Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.IllegalArgumentException: Payload may not be larger than 32767 bytes #92

Open
Azim opened this issue Mar 29, 2020 · 6 comments
Labels

Comments

@Azim
Copy link

Azim commented Mar 29, 2020

Describe the bug
World crash.
Moving here from MightyPirates/OpenComputers#3261

In which environment did the Bug appear?
Singleplayer

To Reproduce
Steps to reproduce the behavior:

  1. Get the app on your laptop with geolyzer installed https://pastebin.com/GXHN4JvS
  2. Run the app deep in cave (modded mc - a lot of diff. ores)
  3. Dont forget to make sure glasses are linked
  4. See error

Expected behavior
World not corrupting, instead throw an error or something

Screenshots / Code Snippet
If applicable, add the code you used and screenshots of how your setup looks like
https://pastebin.com/GXHN4JvS

Minecraft:

  • OpenGlasses 2.2-50
  • Minecraft 1.12
  • Forge 14.23.5.2847
@ben-mkiv ben-mkiv added the bug label Mar 30, 2020
@ben-mkiv
Copy link
Collaborator

ben-mkiv commented Mar 30, 2020

thanks for reporting it, i'll look into that later.

But i can fix your world if you send me your player file (it's located in your minecraft directory at saves/YOUR_WORLDS_NAME/playerdata/YOUR_PLAYER_SSID.dat)

you can also reach me on the discord channel https://discord.gg/gSGSJF or add me Ben#6650

@Azim
Copy link
Author

Azim commented Mar 30, 2020

Thanks, i've already fixed my save at the moment of making that bug report :D

I can send you the world backup + mods if you want more specific environment though

@ben-mkiv
Copy link
Collaborator

actually, more or less for my own information if i ever get to this again, the problem is that Widgets are stored within the NBT data of the Tablet which gets synced by OpenComputers to the Client, and for some reason the Client sends back all the data to the server which causes the error..

tldr: dont use too many OpenGlasses widgets on OC tablets for now

@brisingraerowing
Copy link

As a workaround, you can install Random Patches, which increases the packet size limit.

@agausmann
Copy link

agausmann commented Dec 29, 2020

Here's a potential solution: Store and maintain the widget data separately (e.g. the way that OpenComputers stores disk/memory state, which is in their own files in a subdirectory of the world save), and send updates to clients' widget data using simple channels. I can take a stab at implementing this, if you are interested.

@ben-mkiv
Copy link
Collaborator

ben-mkiv commented Dec 29, 2020

so i wrote a two page essay on this and then closed my browser by accident sigh

the updates already use simple network channels, it's just the widget list on the host component which causes the issue

https://github.com/Starchasers/OCGlasses/blob/OG2-MC1.12.2/src/main/java/com/bymarcin/openglasses/component/WidgetList.java
writeToNBT/readFromNBT have to be changed to save/load from disk

filename should include UUID of the host component, which could be passed as argument to the writeToNBT/readFromNBT methods

and the calls of writeToNBT/readFromNBT have to be changed to not alter the hosts NBT in https://github.com/Starchasers/OCGlasses/blob/OG2-MC1.12.2/src/main/java/com/bymarcin/openglasses/component/OpenGlassesHostComponent.java

That should do the job, if you want you can make an PR, otherwise i might do it within the next days.

Only thing left to figure out is how item deletion gets handled by trash can mods and such, as this would invalidate the UUID and the storage file could be removed, (same for the newUniqueKey() lua-method which can be called by the player)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants