@@ -1925,6 +1925,10 @@ private void OnClientLoadedScene(uint sceneEventId, Scene scene)
19251925 /// when many clients attempt to connect at the same time they will be
19261926 /// handled sequentially so as to not saturate the session owner's maximum
19271927 /// reliable messages.
1928+ /// DANGO-TODO: Get clients to track their synchronization status (if they haven't finished synchronizing)
1929+ /// - pending clients can listen to SessionOwnerChanged messages
1930+ /// - If the session owner changes, fire "some sort of event" to the service
1931+ /// - service can fire ConnectionApproved at new session owner
19281932 /// </summary>
19291933 internal List < ulong > ClientConnectionQueue = new List < ulong > ( ) ;
19301934
@@ -2529,27 +2533,29 @@ private void HandleSessionOwnerEvent(uint sceneEventId, ulong clientId)
25292533 {
25302534 // Remove the client that just synchronized
25312535 ClientConnectionQueue . Remove ( clientId ) ;
2532-
2533- // If we have pending clients to synchronize, then make sure they are still connected
2534- while ( ClientConnectionQueue . Count > 0 )
2535- {
2536- // If the next client is no longer connected then remove it from the list
2537- if ( ! NetworkManager . ConnectedClientsIds . Contains ( ClientConnectionQueue [ 0 ] ) )
2538- {
2539- ClientConnectionQueue . RemoveAt ( 0 ) ;
2540- }
2541- else
2542- {
2543- break ;
2544- }
2545- }
2536+ // Debug.Log($"Remove client-{clientId} from synchronization queue.");
2537+ //
2538+ // // If we have pending clients to synchronize, then make sure they are still connected
2539+ // while (ClientConnectionQueue.Count > 0)
2540+ // {
2541+ // // If the next client is no longer connected then remove it from the list
2542+ // if (!NetworkManager.ConnectedClientsIds.Contains(ClientConnectionQueue[0]))
2543+ // {
2544+ // Debug.Log($"Remove client-{clientId} from synchronization queue as they are no longer connected.");
2545+ // ClientConnectionQueue.RemoveAt(0);
2546+ // }
2547+ // else
2548+ // {
2549+ // break;
2550+ // }
2551+ // }
25462552
25472553 // If we still have any pending clients waiting, then synchronize the next one
25482554 if ( ClientConnectionQueue . Count > 0 )
25492555 {
25502556 if ( NetworkManager . LogLevel <= LogLevel . Developer )
25512557 {
2552- Debug . Log ( $ "Synchronizing Client-{ ClientConnectionQueue [ 0 ] } ...") ;
2558+ Debug . Log ( $ "Synchronizing Deferred Client-{ ClientConnectionQueue [ 0 ] } ...") ;
25532559 }
25542560 SynchronizeNetworkObjects ( ClientConnectionQueue [ 0 ] ) ;
25552561 }
0 commit comments