You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix!: NativeList<T> causes crashes when used in RPCs [NCCBUG-106] (#1901)
* WIP: fixing crashes when passing a NativeList to an RPC
* continued WIP, not ready for anything.
* Finally got it working correctly, still need to write tests.
* Added tests for templated types, fixed some issues around the ILPP generated for them.
* - Fixed failing tests (FixedString is not natively supported anymore without a ForceSerializeByMemcpy wrapper due to the ISerializeByMemcpy tag requirement)
- Made sure there's at least one test exercising Unity types going through RPCs... more tests exercising all of these are needed later.
* Removed some debug logging.
* Standards
* Changelog
* Fix testproject-tools-integration
* Slight refactor to let ILPP find more types it needs to generate initializers for by looking for instances of NetworkVariable<T> and NetworkList<T>. This was required because runtime reflection doesn't work in AoT consoles; the runtime reflection will now only ever be needed if someone does something particularly odd like, for some reason, making a NetworkVariable or NetworkList that's not a field of a NetworkBehaviour.
Made an class to go between NetworkVariable and NetworkVariableBase so that future uses for these serialization functions will also be picked up automatically by ILPP.
Also, review feedback:
- Renamed ISerializeByMemcpy to INetworkSerializeByMemcpy
- Reverted Burst json file
- Removed an errant empty line
* Update com.unity.netcode.gameobjects/CHANGELOG.md
Co-authored-by: Fatih Mar <[email protected]>
* Standards.
* super minor touch
* xmldocs and comments
Co-authored-by: Fatih Mar <[email protected]>
Copy file name to clipboardExpand all lines: com.unity.netcode.gameobjects/CHANGELOG.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,8 @@ Additional documentation and release notes are available at [Multiplayer Documen
11
11
12
12
### Changed
13
13
14
+
-`unmanaged` structs are no longer universally accepted as RPC parameters because some structs (i.e., structs with pointers in them, such as `NativeList<T>`) can't be supported by the default memcpy struct serializer. Structs that are intended to be serialized across the network must add `INetworkSerializeByMemcpy` to the interface list (i.e., `struct Foo : INetworkSerializeByMemcpy`). This interface is empty and just serves to mark the struct as compatible with memcpy serialization. For external structs you can't edit, you can pass them to RPCs by wrapping them in `ForceNetworkSerializeByMemcpy<T>`. (#1901)
15
+
14
16
### Removed
15
17
16
18
### Fixed
@@ -19,6 +21,7 @@ Additional documentation and release notes are available at [Multiplayer Documen
19
21
- Fixed client throwing an exception if it has messages in the outbound queue when processing the `NetworkEvent.Disconnect` event and is using UTP. (#1884)
20
22
- Fixed issue during client synchronization if 'ValidateSceneBeforeLoading' returned false it would halt the client synchronization process resulting in a client that was approved but not synchronized or fully connected with the server. (#1883)
21
23
- Fixed an issue where UNetTransport.StartServer would return success even if the underlying transport failed to start (#854)
24
+
- Passing generic types to RPCs no longer causes a native crash (#1901)
0 commit comments