Netcode for GameObjects is a high-level netcode SDK that provides networking capabilities to GameObject/MonoBehaviour workflows within Unity and sits on top of underlying transport layer.
MIT License
2.1k
stars
430
forks
source link
fix: Added support for byte on NetworkVariable through codegen #2953
the codegen wasn't picking byte - it's because a variable of a type other than NetworkVariable<byte> (such as NetworkVariable<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 NetworkVariable in their code, the byte serializer won't be initialized by the codegen pass.
fix: #2920
Changelog
Fixed: Issue where internal delta serialization could not have a byte serializer defined when serializing deltas for other types. Added [GenerateSerializationForType(typeof(byte))] to both the NetworkVariable and AnticipatedNetworkVariable classes to assure a byte serializer is defined.
Testing and Documentation
No tests were added or updated.
No documentation changes or additions were necessary.
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