fix(vendor/msgpack-cs): patch to allow clientside serialization of types#5
Conversation
FabianTerhorst
left a comment
There was a problem hiding this comment.
Make sure to use spaces instead of tabs. Because you changed the code formatting.
feat(vendor/msgpack-cs): remove symbols from unit test project fix(vendor/msgpack-cs): don't serialize player with client method in test fix(vendor/msgpack-cs): fix unit tests fix(vendor/msgpack-cs): patch to allow clientside serialization of types
| } | ||
| } | ||
|
|
||
| public unsafe void Serialize(IEnumerable enumerable) |
There was a problem hiding this comment.
Due to the change of indentation from mixed to spaced... (thanks visual studio we love you...)
this is one of the changes:
- Added for clientside IEnumerable serialization, handles Arrays, Lists, Dictionaries (ArrayFormatter and DictionaryFormatter)
|
|
||
| #region Extra types | ||
|
|
||
| public unsafe void SerializeType(object obj) |
There was a problem hiding this comment.
This is the other change:
SerializeType patches serialization made in TypeFormatter for clientside
|
Ok, the formatting seems to be mixed up even before this pull request. Better go with only tabs for now with every file. |
|
yeah i always had mixed on one side.. and made it spaces now on the other side.. so i'll keep that memorized..
|
If you can't resolve the serialization issue by yourself on the client then better merge it like this. |
|
Alright, sounds good. |
GOAL OF THIS PR
This patch serves as a temporary workaround, using
#if !IS_FXSERVERchecks, to address client-side serialization issues with formatters and their IL generating code.Deserialization appears to work correctly and is untouched.
However, serialization consistently crashes the client, with a crash pointing to mono-2.0-sgen.dll+247C2.
While awaiting a proper, long-term fix, this patch introduces a straightforward fallback mechanism that bypasses the use of formatters during serialization on the client.
🧞♂️ Oh great @prikolium-cfx, I summon thee!
Grant us a wish: look into this arcane madness in mono library, and perhaps bestow upon us a fix worthy of the client realm (Or at least i can provide the dmp files to help you to help me checking into the problem).
What happens?
Client serialization of custom types crashes without stacktrace leaving no information at all to how to solve this mistery

trying to open the dmp leaves also no clues on the root cause of the problem

I'll keep investigating on the matter while this patch fixes temporarily the problem, allowing us to keep going forward in the testing process of experimental builds
Edit: it appears that everything comes down to
Somehow the
m_objectSerializerdelegate when called crashes the client, weirdly enough, deserialization which works the same way works perfectly.. what is happening here?Fixes
Client side serialization of any
formatterhandled type