Closed Ufabsther closed 5 months ago
@Unity-Technologies/multiplayer-sdk I'm part of Unity, could you MP a proper way to fix the CLA situation
hello @Ufabsther @NoelStephensUnity
im really sorry, but the fix does not work for me after upgrading to 1.10.0 :/
I do have the supposed fix in the code
also again if i add
NetworkVariableSerialization<byte>.AreEqual = NetworkVariableSerialization<byte>.ValueEquals;
to NetworkVariableSerialization:InitializeIntegerSerialization
it starts working
should I do something extra to trigger the codegen, or is there still something wrong with the code? thanks! :)
I also noticed that after upgrading to version 1.10.0 that I still continue to get the same error. But if I add the workaround that was mentioned previously ([GenerateSerializationForType(typeof(byte))]
) to one of my scripts, it fixes the error.
We apologize for any confusion this might have caused. We are aware that this PR does not resolve the issue and have an alternate approach that will be reviewed early next week. If it gets a sign off on the different approach, then I will start a patch update to NGO v1.10.1 that will include the alternate fix.
If you are having this issue and using fixed strings, then you could update your manifest with this:
"com.unity.netcode.gameobjects": "https://github.com/Unity-Technologies/com.unity.netcode.gameobjects.git?path=com.unity.netcode.gameobjects#fix/fixedstring-byte-writing-and-comparing",
And report back here if that resolves your issue.
We apologize for any confusion this might have caused. We are aware that this PR does not resolve the issue and have an alternate approach that will be reviewed early next week. If it gets a sign off on the different approach, then I will start a patch update to NGO v1.10.1 that will include the alternate fix.
If you are having this issue and using fixed strings, then you could update your manifest with this:
"com.unity.netcode.gameobjects": "https://github.com/Unity-Technologies/com.unity.netcode.gameobjects.git?path=com.unity.netcode.gameobjects#fix/fixedstring-byte-writing-and-comparing",
And report back here if that resolves your issue.
I have tested this very extensively for my game, and we have had no issues with fixedstrings. We use a lot of fixedstrings in INetworkSerializable structs to contain web IDs that don't change after the player connects. We also use some fixedstrings as NetworkVariables to store JSON data of things like dictionaries of game settings. So far, it's behaving just like 1.8.1 had been, no bugs or errors being logged server side or client side. This is with a ping upwards of 200 ms.
the codegen wasn't picking byte - it's because a variable of a type other than in their code, the byte serializer won't be initialized by the codegen pass.
NetworkVariable<byte>
(such asNetworkVariable<FixedString32Bytes>
) is serializing a byte value as part of its delta serialization. Delta serialization was added in NGO 1.9, which is why it doesn't happen in previous versions. This code assumes the existence of a byte serializer, but if the user doesn't have a NetworkVariablefix: #2920
Changelog
[GenerateSerializationForType(typeof(byte))]
to both theNetworkVariable
andAnticipatedNetworkVariable
classes to assure a byte serializer is defined.Testing and Documentation