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
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
@@ -12,10 +12,13 @@ Additional documentation and release notes are available at [Multiplayer Documen
12
12
13
13
### Changed
14
14
15
+
- (API Breaking) `ConnectionApprovalCallback` is no longer an `event` and will not allow more than 1 handler registered at a time. Also, `ConnectionApprovalCallback` is now a `Func<>` taking `ConnectionApprovalRequest` in and returning `ConnectionApprovalResponse` back out (#1972)
16
+
15
17
### Removed
16
18
17
19
### Fixed
18
20
21
+
- Fixed issues when multiple `ConnectionApprovalCallback`s were registered (#1972)
19
22
- Fixed endless dialog boxes when adding a NetworkBehaviour to a NetworkManager or vice-versa (#1947)
@@ -358,26 +360,59 @@ public IReadOnlyList<ulong> ConnectedClientsIds
358
360
publiceventActionOnServerStarted=null;
359
361
360
362
/// <summary>
361
-
/// Delegate type called when connection has been approved. This only has to be set on the server.
363
+
/// Connection Approval Response
362
364
/// </summary>
363
-
/// <param name="createPlayerObject">If true, a player object will be created. Otherwise the client will have no object.</param>
364
-
/// <param name="playerPrefabHash">The prefabHash to use for the client. If createPlayerObject is false, this is ignored. If playerPrefabHash is null, the default player prefab is used.</param>
365
-
/// <param name="approved">Whether or not the client was approved</param>
366
-
/// <param name="position">The position to spawn the client at. If null, the prefab position is used.</param>
367
-
/// <param name="rotation">The rotation to spawn the client with. If null, the prefab position is used.</param>
/// <param name="Approved">Whether or not the client was approved</param>
366
+
/// <param name="CreatePlayerObject">If true, a player object will be created. Otherwise the client will have no object.</param>
367
+
/// <param name="PlayerPrefabHash">The prefabHash to use for the client. If createPlayerObject is false, this is ignored. If playerPrefabHash is null, the default player prefab is used.</param>
368
+
/// <param name="Position">The position to spawn the client at. If null, the prefab position is used.</param>
369
+
/// <param name="Rotation">The rotation to spawn the client with. If null, the prefab position is used.</param>
370
+
publicstructConnectionApprovalResponse
371
+
{
372
+
publicboolApproved;
373
+
publicboolCreatePlayerObject;
374
+
publicuint?PlayerPrefabHash;
375
+
publicVector3?Position;
376
+
publicQuaternion?Rotation;
377
+
}
378
+
379
+
/// <summary>
380
+
/// Connection Approval Request
381
+
/// </summary>
382
+
/// <param name="Payload">The connection data payload</param>
383
+
/// <param name="ClientNetworkId">The Network Id of the client we are about to handle</param>
384
+
publicstructConnectionApprovalRequest
385
+
{
386
+
publicbyte[]Payload;
387
+
publiculongClientNetworkId;
388
+
}
369
389
370
390
/// <summary>
371
-
/// The callback to invoke during connection approval
391
+
/// The callback to invoke during connection approval. Allows client code to decide whether or not to allow incoming client connection
0 commit comments