char type variables only network sync the least significant byte, leading to unexpected data loss
available in future release
Happyrobot33
If you have a char or char[] that is network synced, the client will only actually serialize and send the least significant byte over the network for that char. This leads to the issue that since C# supports UTF-16 encoding for char types, you cant actually serialize anything outside of the extended ASCII range of 0-255. Fixing this is especially pertinent for non-english individuals as it means basically all non-latin character codes are not directly serializable without tricks
Here is a video showing it wrap around, the left user is a remote player and the right user is the player serializing the data. https://youtu.be/vl_gstPcouI
The correct fix for this is making chars serialize as 2 bytes internally, as the max C# value for a char type is the size of a short https://learn.microsoft.com/en-us/dotnet/api/system.char.maxvalue?view=net-8.0
Log In
This post was marked as
available in future release
This post was marked as
tracked