jpw1991 / chebs-necromancy

Cheb's Necromancy adds Necromancy to Valheim via craftable wands and structures. Minions will follow you, guard your base, and perform menial tasks.
The Unlicense
10 stars 4 forks source link

Phylactery EndOfStreamException: Unable to read beyond the end of the stream #261

Closed jpw1991 closed 1 month ago

jpw1991 commented 7 months ago

A player called Antharis has been getting his server log spammed full of this error:

[Error  : Unity Log] EndOfStreamException: Unable to read beyond the end of the stream.
Stack trace:
System.IO.MemoryStream.InternalReadInt32 () (at <834b2ded5dad441e8c7a4287897d63c7>:0)
(wrapper remoting-invoke-with-check) System.IO.MemoryStream.InternalReadInt32()
System.IO.BinaryReader.ReadInt32 () (at <834b2ded5dad441e8c7a4287897d63c7>:0)
ZPackage.ReadInt () (at <a9028810fc2d428f8395f8fa0799143e>:0)
ChebsNecromancy.Structures.Phylactery.PhylacteryZDOHasFuel (ZDO zdo) (at <9deeed1516644e54ac9ae8f2b6d43ca9>:0)
ChebsNecromancy.Structures.Phylactery+<PhylacteryCheckRPCServerReceive>d__17.MoveNext () (at <9deeed1516644e54ac9ae8f2b6d43ca9>:0)

Conferring with the modding wizards for wisdom gleaned:

Hugo the Dwarf — Today at 8:25 AM if your Phylactery is a piece/building, I guess it'd depend on how many mods are tacking on custom ZDO keys for it ChebsNecromancy.Structures.Phylactery.PhylacteryZDOHasFuel (ZDO zdo) some reason when trying to read an Int from it, it's already empty or tries to read past the end which afaik if a key is missing it returns the default, which would be 0 Cheb Gonaz — Today at 8:28 AM Ok, good to know. Thanks. And yeah it's a piece Hugo the Dwarf — Today at 8:29 AM also Jotunn.Entities.CustomRPC:ReceivePackage(Int64, ZPackage) if you're using JVL for custom RPC for sending that data perhaps it's a rare instance you're sending an empty Zpackage?

I think at least this can be remedied by catching the exception and logging it once, then ignoring it from thereon out to stop spamming the server. Better case will be to actually fix it.

LogOutput_Antharis.log

jpw1991 commented 1 month ago

Fixed in 5.0.1