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
chore: Up-port from develop-2.0.0 from week 31 (#4116)
* chore: Adding a note about DontDestroyOnLoad usage for Networked scene objects (#4070)
Docs correction
* ci: Split code coverage into Package Test and Project Test jobs (#4101)
* ci: Split code coverage into Package Test and Project Test jobs
Convert the existing coverage job to [Code Coverage] Package Test - NGO [ubuntu, trunk] and add [Code Coverage] Project Test - NGO testproject [ubuntu, trunk]. Wire Package Test into PR/nightly triggers and Project Test into the weekly run.
* ci: Run both coverage jobs on PR and nightly
* ci: Use pinnedTrunk for PR coverage and drop package-test job
* chore: Point CMB resources at new monorepo (#4106)
* chore: Point CMB resources at new monorepo
* fix: NetworkVariable change prior to ownership change using distributed authority topology fails to sync NetworkVariable (#4107)
* fix
This resolves the issue where in a distributed authority session changing a NetworkVariable prior to changing ownership in the same call-stack would result in the NetworkVariable not being synchronized.
* fix - update
Removing the additional authority check as it is not needed.
Fixing a very edge case scenario that shouldn't happen but in the event it does when finding objects by type within a specific scene, if the scene is invalid then use an empty array for the found objects.
* fix: spawn disabled in scene placed and network prefab registration (#4093)
* fix
- Issue where disabled in-scene placed NetworkObjects could not be spawned after starting a session.
- Issue where users are allowed to spawn a NetworkObject with a GlobalObjectIdHash value of 0 (zero).
* update
NetworkAnimator not pointing to an animator within awake now just logs a warning as opposed to an error.
* test
Updating tests based on the fixes applied to this branch.
A large portion is related to some integration tests trying to spawn NetworkObjects with a GlobalObjectIdHash value of zero(0).
* update
Style and providing internal write access to the prefabs list.
* test
Potentially last iteration on fixing/updating integration tests.
* test - fix
Using the fixed version of NetworkPrefabHandlerSpawnAndSynchronizeTests.
Fixing some issues with prefab and handler creation.
* style
Fixing formatting issues.
* style
Fixing some standards formatting related issues.
* style
removing trailing spaces.
* style
Super weird one... but using ? as opposed to an if null check.
* style
Removing commented out code that is no longer needed/used.
* update
Committing suggested changes.
Co-authored-by: Emma <emma.mcmillan@unity3d.com>
* update
Applying changes based on review discussion.
* update
Making adjustments based on review discussion.
* style
Removing field that is no longer valid.
Moving Awake higher in NetworkObject as it has become wedged in the middle of the code.
* update
Adding change log entries.
* update
Inverting logic (oops)
* doc
Updating NetworkObject documentation and in-scene placed documentation.
* Update documentation for the two types of NetworkObjects
Clarified the categories of NetworkObjects and their requirements. Added details for dynamically instantiated and in-scene placed NetworkObjects.
* style
White spaces!
* Apply suggestions from code review
Co-authored-by: Amy Reeve <amy.reeve@unity3d.com>
---------
Co-authored-by: Emma <emma.mcmillan@unity3d.com>
Co-authored-by: Amy Reeve <amy.reeve@unity3d.com>
* docs: Docs-wide link fixes and xref update (#4102)
* Docs-wide link fixes and xref update
* Typo in API docs
* chore: Add NGO_EXCLUDE_HEAVY_TESTS define (#4114)
Add NGO_EXCLUDE_HEAVY_TESTS
---------
Co-authored-by: Nikos <nikos@unity3d.com>
Co-authored-by: Emma <emma.mcmillan@unity3d.com>
Co-authored-by: Noel Stephens <noel.stephens@unity3d.com>
Co-authored-by: Amy Reeve <amy.reeve@unity3d.com>
Co-authored-by: mnachury-unity <120488254+mnachury-unity@users.noreply.github.com>
# Run API validation to early-detect all new APIs that would force us to release new minor version of the package. Note that for this to work the package version in package.json must correspond to "actual package state" which means that it should be higher than last released version
# In theory this job also runs package tests, but we don't want to use it as default since is heavier (because of added coverage analysis) and coverage is not changing that often
19
20
# Requires Unity Editor installation
20
21
# Burst compilation is disabled to ensure accurate coverage measurement
21
22
# In order to properly use -coverage-results-path parameter we need to start it with $PWD (which means the absolute path). Otherwise coverage results will not be visible
Copy file name to clipboardExpand all lines: Tools/CI/service.cmb/README.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Testing against the CMB Service
2
2
3
-
The CMB Service is a tool that is external to our repository. The tool is inside the `runtime` folder in the [mps-common-multiplayer-backend](https://github.com/Unity-Technologies/mps-common-multiplayer-backend)repository.
3
+
The CMB Service is a tool that is external to our repository. The tool is inside the `runtime` folder of the [CMB service](https://github.com/Unity-Technologies/unity-player-services/tree/main/services/common-multiplayer-backend)in the Unity Player Services monorepo.
4
4
5
5
Due to this, there is some more setup needed when running tests against the CMB Service.
6
6
@@ -56,3 +56,7 @@ The following environment variables allow for further configuration of the setup
56
56
`CMB_SERVICE_PORT` defines the port where the tests will try to connect to the service (defaults to `7789`).
57
57
58
58
`NGO_HOST` defines the http address where the tests will try to connect to the service (defaults to `127.0.0.1`).
59
+
60
+
## Running on CI (Yamato)
61
+
62
+
The CMB tests can also be run from Yamato. The jobs are defined in [`.yamato/cmb-service-standalone-tests.yml`](../../../.yamato/cmb-service-standalone-tests.yml) and appear in Yamato as `CMB Service Test - NGO <project> - [<platform>, <editor>, <backend>]`. The job can be triggered manually from any branch meaning it can be easier to run the CMB tests from Yamato rather than set them up locally. The test uses [`run_cmb_service.sh`](./run_cmb_service.sh) to setup and run the CMB service.
@@ -27,6 +29,10 @@ Additional documentation and release notes are available at [Multiplayer Documen
27
29
28
30
### Fixed
29
31
32
+
- Issue with not being able to spawn initially disabled in-scene placed objects. (#4093)
33
+
- Issue with pre-instantiated network prefab instances being marked as in-scene placed. Now pre-instantiated network prefabs are dynamically spawned. (#4093)
34
+
- Issue where a user could spawn runtime created `NetworkObject` that has a GlobalObjectIdHash of zero. These are not valid instances and will no longer be allowed to spawn. (#4093)
Copy file name to clipboardExpand all lines: com.unity.netcode.gameobjects/Documentation~/advanced-topics/fastbufferwriter-fastbufferreader.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -82,7 +82,7 @@ This allows the four bytes of the embedded struct to be rapidly serialized as a
82
82
83
83
`FastBufferWriter` and `FastBufferReader` are replacements for the old `NetworkWriter` and `NetworkReader`. For those familiar with the old classes, there are some key differences:
84
84
85
-
-`FastBufferWriter` uses `WriteValue()` as the name of the method for all types *except*[`INetworkSerializable`](serialization/inetworkserializable) types, which are serialized through `WriteNetworkSerializable()`
85
+
-`FastBufferWriter` uses `WriteValue()` as the name of the method for all types *except*[`INetworkSerializable`](serialization/inetworkserializable.md) types, which are serialized through `WriteNetworkSerializable()`
86
86
-`FastBufferReader` similarly uses `ReadValue()` for all types except INetworkSerializable (which is read through `ReadNetworkSerializable`), with the output changed from a return value to an `out` parameter to allow for method overload resolution to pick the correct value.
87
87
-`FastBufferWriter` and `FastBufferReader` outsource packed writes and reads to `BytePacker` and `ByteUnpacker`, respectively.
88
88
-`FastBufferWriter` and `FastBufferReader` are **structs**, not **classes**. This means they can be constructed and destructed without GC allocations.
> `ClientRpcSendParams`'s `TargetClientIds` property is a `ulong[]` which means everytime you try to specify a subset of target clients or even a single client target, you will have to allocate a `new ulong[]`. This pattern can quickly lead into lots of heap allocations and pressure GC which would cause GC spikes at runtime. We suggest developers cache their `ulong[]` variables or use an array pool to cycle `ulong[]` instances so that it would cause less heap allocations.
Copy file name to clipboardExpand all lines: com.unity.netcode.gameobjects/Documentation~/advanced-topics/network-prefab-handler.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
The network prefab handler system provides advanced control over how network prefabs are instantiated and destroyed during runtime. You can use it to override the default Netcode for GameObjects [object spawning](../basics/object-spawning.md) behavior by implementing custom prefab handlers.
4
4
5
-
The network prefab handler system is accessible from the [NetworkManager](../components/networkmanager.md) as `NetworkManager.PrefabHandler`.
5
+
The network prefab handler system is accessible from the [NetworkManager](../components/core/networkmanager.md) as `NetworkManager.PrefabHandler`.
6
6
7
7
## When to use a prefab handler
8
8
@@ -13,14 +13,14 @@ For an overview of the default object spawning behavior, refer to the [object sp
13
13
-**Custom initialization**: Setting up objects with game client specific data or configurations.
14
14
-**Conditional spawning**: Initializing different prefab variants based on runtime conditions.
15
15
16
-
The prefab handler system addresses these needs through an interface-based architecture. The system relies on two key methods: `Instantiate` and `Destroy`. `Instantiate` is called on non-authority clients when an [authority](../terms-concepts/authority.md) spawns a new [NetworkObject](../basics/networkobject.md) that has a registered network prefab handler. `Destroy` is called on all game clients whenever a registered [NetworkObject](../basics/networkobject.md) is destroyed.
16
+
The prefab handler system addresses these needs through an interface-based architecture. The system relies on two key methods: `Instantiate` and `Destroy`. `Instantiate` is called on non-authority clients when an [authority](../terms-concepts/authority.md) spawns a new [NetworkObject](../components/core/networkobject.md) that has a registered network prefab handler. `Destroy` is called on all game clients whenever a registered [NetworkObject](../components/core/networkobject.md) is destroyed.
17
17
18
18
## Create a prefab handler
19
19
20
20
Prefab handlers are classes that implement one of the Netcode for GameObjects prefab handler descriptions. There are currently two such descriptions:
21
21
22
-
-[**INetworkPrefabInstanceHandler**](https://docs.unity3d.com/Packages/com.unity.netcode.gameobjects@latest?subfolder=/api/Unity.Netcode.INetworkPrefabInstanceHandler.html): This is the simplest interface for custom prefab handlers.
23
-
-[**NetworkPrefabInstanceHandlerWithData**](https://docs.unity3d.com/Packages/com.unity.netcode.gameobjects@latest?subfolder=/api/Unity.Netcode.NetworkPrefabInstanceHandlerWithData.html): This specialized handler receives custom data from the authority during spawning, enabling dynamic prefab customization.
22
+
-[**INetworkPrefabInstanceHandler**](xref:Unity.Netcode.INetworkPrefabInstanceHandler): This is the simplest interface for custom prefab handlers.
23
+
-[**NetworkPrefabInstanceHandlerWithData**](xref:Unity.Netcode.NetworkPrefabInstanceHandlerWithData): This specialized handler receives custom data from the authority during spawning, enabling dynamic prefab customization.
24
24
25
25
When using a prefab handler, Netcode for GameObjects uses the `Instantiate` and `Destroy` methods instead of default spawn handlers for the NetworkObject during spawning and despawning. The authority instance uses the traditional spawning approach where it will, via user script, instantiate and spawn a network prefab (even for those registered with a prefab handler). However, all non-authority clients will automatically use the instantiate method defined by the `INetworkPrefabInstanceHandler` implementation if the network prefab spawned has a registered `INetworkPrefabInstanceHandler` implementation with the `NetworkPrefabHandler` (`NetworkManager.PrefabHandler`).
26
26
@@ -55,7 +55,7 @@ public abstract class NetworkPrefabInstanceHandlerWithData<T> : INetworkPrefabIn
55
55
56
56
## Register a prefab handler
57
57
58
-
Once you've [created a prefab handler](#create-a-prefab-handler), whether by implementing or deriving, you need to register any new instance of that handler with the network prefab handler system using `NetworkManager.PrefabHandler.AddHandler`. Prefab handlers are registered against a NetworkObject's [GlobalObjectIdHash](../basics/networkobject.md#using-networkobjects).
58
+
Once you've [created a prefab handler](#create-a-prefab-handler), whether by implementing or deriving, you need to register any new instance of that handler with the network prefab handler system using `NetworkManager.PrefabHandler.AddHandler`. Prefab handlers are registered against a NetworkObject's [GlobalObjectIdHash](../components/core/networkobject.md#using-networkobjects).
59
59
60
60
```csharp
61
61
publicclassGameManager : NetworkBehaviour
@@ -70,7 +70,7 @@ public class GameManager : NetworkBehaviour
70
70
}
71
71
```
72
72
73
-
To un-register a prefab handler, you can [invoke the `NetworkManager.PrefabHandler.RemoveHandler` method](https://docs.unity3d.com/Packages/com.unity.netcode.gameobjects@latest?subfolder=/api/Unity.Netcode.NetworkPrefabHandler.html#Unity_Netcode_NetworkPrefabHandler_RemoveHandler_System_UInt32_). There are several override versions of this method.
73
+
To un-register a prefab handler, you can [invoke the `NetworkManager.PrefabHandler.RemoveHandler` method](xref:Unity.Netcode.NetworkPrefabHandler.RemoveHandler*). There are several override versions of this method.
0 commit comments