Skip to content

Commit

Permalink
Develop into main (#1317)
Browse files Browse the repository at this point in the history
  • Loading branch information
jabbacakes authored Aug 1, 2024
1 parent 1f472c8 commit 3724772
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 8 deletions.
10 changes: 7 additions & 3 deletions docs/basics/networkobject.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,15 @@ When spawning a NetworkObject, the `NetworkObject.GlobalObjectIdHash` value init

You can use [NetworkBehaviours](networkbehaviour.md) to add your own custom Netcode logic to the associated NetworkObject.

:::warning
### Component order

The order of networked objects matters. Make sure to load any NetworkBehaviour components before the Network Object component on the GameObject.
The order of components on a networked GameObject matters. When adding netcode components to a GameObject, ensure that the NetworkObject component is ordered before any NetworkBehaviour components.

:::
The order in which NetworkBehaviour components are presented in the **Inspector** view is the order in which each associated `NetworkBehaviour.OnNetworkSpawn` method is invoked. Any properties that are set during `NetworkBehaviour.OnNetworkSpawn` are set in the order that each NetworkBehaviour's `OnNetworkSpawned` method is invoked.

#### Avoiding execution order issues

You can avoid execution order issues in any NetworkBehaviour component scripts that have dependencies on other NetworkBehaviour components associated with the same NetworkObject by placing those scripts in an overridden `NetworkBehaviour.OnNetworkPostSpawn` method. The `NetworkBehaviour.OnNetworkPostSpawn` method is invoked on each NetworkBehaviour component after all NetworkBehaviour components associated with the same NetworkObject component have had their `NetworkBehaviour.OnNetworkSpawn` methods invoked (but they will still be invoked in the same execution order defined by their relative position to the NetworkObject component when viewed within the Unity Editor **Inspector** view).

## Ownership

Expand Down
4 changes: 4 additions & 0 deletions docs/basics/scenemanagement/client-synchronization-mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ Client synchronization occurs when immediately after a client connects to a host

The client synchronization mode should be set when the server or host is first provided via the `NetworkSceneManager.SetClientSynchronizationMode` method that takes a [`LoadSceneMode`](https://docs.unity3d.com/ScriptReference/SceneManagement.LoadSceneMode.html) value as a parameter. Each client synchronization mode behaves in a similar way to loading a scene based on the chosen `LoadSceneMode`.

::note Distributed authority contexts
When using a [distributed authority network topology](../../terms-concepts/distributed-authority.md), any client can set the client synchronization mode when they're promoted to session owner. Late-joining clients are synchronized using whatever setting the current session owner has.
::

## Single Client Synchronization Mode
_(Existing Client-Side Scenes Unloaded During Synchronization)_

Expand Down
2 changes: 1 addition & 1 deletion docs/components/networkmanager.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ NetworkManager.Singleton.StartClient(); // Starts the NetworkManager as jus
```

:::warning
Don't start a NetworkManager within a NetworkBehaviour's Awake method as this can lead to undesirable results depending upon your project's settings!
Don't start a `NetworkManager` within any `NetworkBehaviour` component's method; doing so can produce timing-related issues that cause the `NetworkManager` to only start once or not at all. `NetworkManager`s begin and end a network session, while `NetworkBehaviour` components are used during a network session. By the time you're using `NetworkBehaviour`s, a `NetworkManager` should already be running.
:::

:::note
Expand Down
3 changes: 2 additions & 1 deletion docs/release-notes/ngo-changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ The following content tracks features, updates, bug fixes, and refactoring for t

| Release | Date | Changelog |
|---|---|---|
| 2.0.0-exp | 2024-04-02 | [2.0.0-exp](https://docs.unity3d.com/Packages/[email protected]/changelog/CHANGELOG.html) |
| 2.0.0-pre | 2024-06-17 | [2.0.0-pre](https://docs.unity3d.com/Packages/[email protected]/changelog/CHANGELOG.html) |
| 2.0.0-exp | 2024-04-02 | [2.0.0-exp](https://docs.unity3d.com/Packages/[email protected]/changelog/CHANGELOG.html#200-exp2---2024-04-02) |
| 1.10.0 | 2024-07-22 | [1.10.0](https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/blob/release/1.10.0/com.unity.netcode.gameobjects/CHANGELOG.md) |
| 1.9.1 | 2024-04-18 | [1.9.1](https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/releases/tag/ngo%2F1.9.1) |
| 1.8.0 | 2023-12-12 | [1.8.0](https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/releases/tag/ngo%2F1.8.0) |
Expand Down
2 changes: 1 addition & 1 deletion docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ module.exports = {
lastVersion: "current",
versions: {
current: {
label: "2.0.0-exp",
label: "2.0.0-pre",
path: "current",
},
"1.10.0": {
Expand Down
4 changes: 2 additions & 2 deletions transport/workflow-client-server-secure.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ void Start ()
When creating the `NetworkDriver`, pass in this `NetworkSettings` object:

```csharp
m_Driver = NetworkDriver.Create(settings);
m_Driver = NetworkDriver.Create(settings);
```

That’s all you need to do to enable secure communication server-side.
Expand All @@ -149,7 +149,7 @@ The secure client is similar to the secure server. The only difference is in how
void Start ()
{
var settings = new NetworkSettings();
settings.WithSecureServerParameters(
settings.WithSecureClientParameters(
serverName: SecureParameters.ServerCommonName,
caCertificate: SecureParameters.MyGameClientCA);
m_Driver = NetworkDriver.Create(settings);
Expand Down

0 comments on commit 3724772

Please sign in to comment.