Message.Serialize has unpredicatable behaviour
Quick Description
Invoking Message.Serialize(DarkRiftWriter) only sets a reference to the backing array of the DarkRiftWriter.
Explaination
Given the above, if the writer was then written to the data in the message would change. However, if enough data was written to the writer to cause the backing array to resize these changes would not propagate to the message and the message would hold a reference to out of date data.
Consistency needs to be formed here however this is resolved.
This has been fixed in version 2.4.0. Since an AutoRecyclingArray is now passed as the reference and that can be resized without changing the reference this is no longer an issue.
Reopening as this is still not working.
Now however, the reference will always point to the latest data, but the count and offset aren't synchronised across the Serialize boundary. This is probably something that is not easily fixed without a re-architecture.
This can probably be fixed fairly easily by making the AutoRecyclingArray in DarkRift do the resizing rather than the MessageBuffer itself.