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: Assets/Scripts/Gameplay/ConnectionManagement/ServerGameNetPortal.cs
+40-37Lines changed: 40 additions & 37 deletions
Original file line number
Diff line number
Diff line change
@@ -161,26 +161,27 @@ public bool AreAllClientsInServerScene()
161
161
}
162
162
163
163
/// <summary>
164
-
/// This logic plugs into the "ConnectionApprovalCallback" exposed by Netcode.NetworkManager, and is run every time a client connects to us.
165
-
/// See ClientGameNetPortal.StartClient for the complementary logic that runs when the client starts its connection.
164
+
/// This logic plugs into the "ConnectionApprovalResponse" exposed by Netcode.NetworkManager. It is run every time a client connects to us.
165
+
/// The complementary logic that runs when the client starts its connection can be found in ClientGameNetPortal.StartClient.
166
166
/// </summary>
167
167
/// <remarks>
168
-
/// Since our game doesn't have to interact with some third party authentication service to validate the identity of the new connection, our ApprovalCheck
169
-
/// method is simple, and runs synchronously, invoking "callback" to signal approval at the end of the method. Netcode currently doesn't support the ability
170
-
/// to send back more than a "true/false", which means we have to work a little harder to provide a useful error return to the client. To do that, we invoke a
171
-
/// custom message in the same channel that Netcode uses for its connection callback. Since the delivery is NetworkDelivery.ReliableSequenced, we can be
172
-
/// confident that our login result message will execute before any disconnect message.
168
+
/// Multiple things can be done here, some asynchronously. For example, it could authenticate your user against an auth service like UGS' auth service. It can
169
+
/// also send custom messages to connecting users before they receive their connection result (this is useful to set status messages client side
170
+
/// when connection is refused, for example).
173
171
/// </remarks>
174
-
/// <param name="connectionData">binary data passed into StartClient. In our case this is the client's GUID, which is a unique identifier for their install of the game that persists across app restarts. </param>
175
-
/// <param name="clientId">This is the clientId that Netcode assigned us on login. It does not persist across multiple logins from the same client. </param>
176
-
/// <param name="connectionApprovedCallback">The delegate we must invoke to signal that the connection was approved or not. </param>
/// <param name="request"> The initial request contains, among other things, binary data passed into StartClient. In our case, this is the client's GUID,
174
+
/// which is a unique identifier for their install of the game that persists across app restarts.
175
+
/// <param name="response"> Our response to the approval process. In case of connection refusal with custom return message, we delay using the Pending field.
0 commit comments