Closed Charanor closed 10 months ago
In your example
m2.AddMessage(m1, m2.WrittenBits, 0);
should actually be
m2.AddMessage(m1, m1.WrittenBits, 0);
Also, why not just write each entity directly into the combined message? Why the extra steps?
I'm a dong xD sorry! And writing directly to the "main" message is the plan, I was just transferring the netcode from my previous iteration that used per-entity packages so this was sort of an intermediate step before I write the real serialization.
Hello! In my setup I am writing each entity to a message then combining the messages to pack them as tightly as possible before sending them over the net. I noticed when doing this some values are not written (or read, at least) correctly. The below snippet can reproduce the issue without having to send the messages over a connection.
Note that it doesn't matter if I use int/float/long or any other value, the second
AddXYZ
seems to always fail (or the secondGetXYZ
at least).