[USER=“3140864”]MostHost LA[/USER]
All players are placed in an array, which is processed using a simple timer only if play has begun properly.
i.e. GetWorld()->HasBegunPlay() would return true.
The timer checks that a player is valid and has a valid net connection, then checks if the player has completed an initial sync.
When ever this check fails, it uses a client RPC in an attempt to get the player to sync up.
This client function checks to make sure the play has begun, then waits for the player state, game state and game mode classes to all be valid.
Once those criteria are met, its starts loading up various assets and tells the server it is synced up.
All this server function does is to set the initial sync boolean to ‘true’.
Once the initial sync check passes on the server, the game mode figure out where the player should spawn etc and the uses another client RPC to fade out transition/loading screens.
It then removes the player from the waiting list.
If the waiting list is empty, timer is cleared.
If not, it loops around again.
Waiting for GetWorld()->HasBegunPlay() to be true on the server and client helps prevents NetGUID issues, which can happen if actors are spawned too early.
Waiting for the player state, game state and game mode classes to all be valid ensures that anything that requires basic info from them has it immediately without the need for any further delays.