Skip to content

Commit 2bf18a7

Browse files
authored
Develop into main to publish NGO 1.10.0 and tools 2.2.0 (#1312)
2 parents 950baec + e9d17e9 commit 2bf18a7

File tree

136 files changed

+17032
-123
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+17032
-123
lines changed

docs/about.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ For more information, check out [Release Notes](release-notes/ngo-changelog.md)
5252

5353
Netcode for GameObjects supports the following versions:
5454

55-
- Unity 2021.3 and later
55+
- Unity 6.0+ and later
5656
- Mono and IL2CPP [Scripting Backends](https://docs.unity3d.com/Manual/scripting-backends.html)
5757

5858
Netcode for GameObjects supports the following platforms:

docs/basics/connection-approval.md

+20-20
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,6 @@ With every new connection, Netcode for GameObjects performs a handshake in addit
77

88
When you set the ConnectionApproval property of the NetworkManager to true, Netcode for GameObjects checks to make sure the `NetworkManager.ConnectionApprovalCallback` has been assigned. If assigned, the connection approval process is used for connecting clients to decide whether to allow a connection or deny it. If you don't assign the `NetworkManager.ConnectionApprovalCallback` (even with the `NetworkManager.ConnectionApprovalCallback` set to `true`), Netcode for GameObjects uses basic authentication for the user, which automatically authorizes and assigns the default player Prefab.
99

10-
## `NetworkManager.ConnectionApprovalRequest`
11-
12-
This class represents the client-to-server request which has:
13-
14-
- **ClientNetworkId**: the connecting client identifier
15-
- **Payload**: any additional user-defined connection data
16-
17-
## `NetworkManager.ConnectionApprovalResponse`
18-
19-
This is how the connection approval response is formed by server-side specific user code in the handler assigned to `NetworkManager.ConnectionApprovalCallback`. On the server side, this class has all the connection approval response information required to either allow or reject a player attempting to connect. It also has the following properties:
20-
21-
- **Approved**: When `true`, the player is approved. When `false`, the player is denied.
22-
- **CreatePlayerObject**: When `true`, the server spawns a player Prefab for the connecting client. When `false`, the connecting client will have no player Prefab spawned.
23-
- **PlayerPrefabHash**: The type of player Prefab to use for the authorized player (if this is `null`, it uses the default NetworkManager-defined player Prefab)
24-
- **Position** and **Rotation**: The position and rotation of the player when spawned.
25-
- **Pending**: Provides the ability to mark the approval as pending to delay the authorization until other user-specific code finishes the approval process.
26-
- **Reason**: If `Approved` is `false`, you can populate this with a string-based message (or JSON) to send the reason the client wasn't approved.
27-
28-
In earlier versions of Netcode for GameObjects, you had to provide a callback to invoke within the connection approval handler method. It's now only necessary to set the appropriate properties of the `NetworkManager.ConnectionApprovalResponse` class. Part of this update allows you to set your `ConnectionApprovalResponse` to `Pending`, providing extra time to process any other tasks involved with the player approval process.
29-
3010
## Server-side connection approval example
3111

3212
```csharp
@@ -69,6 +49,26 @@ private void ApprovalCheck(NetworkManager.ConnectionApprovalRequest request, Net
6949
}
7050
```
7151

52+
## `NetworkManager.ConnectionApprovalRequest`
53+
54+
This class represents the client-to-server request which has:
55+
56+
- **ClientNetworkId**: the connecting client identifier
57+
- **Payload**: any additional user-defined connection data
58+
59+
## `NetworkManager.ConnectionApprovalResponse`
60+
61+
This is how the connection approval response is formed by server-side specific user code in the handler assigned to `NetworkManager.ConnectionApprovalCallback`. On the server side, this class has all the connection approval response information required to either allow or reject a player attempting to connect. It also has the following properties:
62+
63+
- **Approved**: When `true`, the player is approved. When `false`, the player is denied.
64+
- **CreatePlayerObject**: When `true`, the server spawns a player Prefab for the connecting client. When `false`, the connecting client will have no player Prefab spawned.
65+
- **PlayerPrefabHash**: The type of player Prefab to use for the authorized player (if this is `null`, it uses the default NetworkManager-defined player Prefab)
66+
- **Position** and **Rotation**: The position and rotation of the player when spawned.
67+
- **Pending**: Provides the ability to mark the approval as pending to delay the authorization until other user-specific code finishes the approval process.
68+
- **Reason**: If `Approved` is `false`, you can populate this with a string-based message (or JSON) to send the reason the client wasn't approved.
69+
70+
In earlier versions of Netcode for GameObjects, you had to provide a callback to invoke within the connection approval handler method. It's now only necessary to set the appropriate properties of the `NetworkManager.ConnectionApprovalResponse` class. Part of this update allows you to set your `ConnectionApprovalResponse` to `Pending`, providing extra time to process any other tasks involved with the player approval process.
71+
7272
## Sending an approval declined reason (`NetworkManager.ConnectionApprovalResponse.Reason`)
7373

7474
If you need to deny a player from connecting for any reason (such as if they reached the maximum number of connections or provided an invalid authorization), the `NetworkManager.ConnectionApprovalResponse` structure provides you with the optional `NetworkManager.ConnectionApprovalResponse.Reason` property.

0 commit comments

Comments
 (0)