In this section we'll talk about the Demo Project design and why things were done like they were.

Spawn Queue

In Unreal player pawn is spawned and possessed by GameModeBase class, player pawn is defined in Game Mode settings, once it knows that the only thing left to do is find a location in world level. Spawn location is defined by Player Start Actor, Game Mode uses FindPlayerStart function to get list of Player Start Actors in level. Then it gets world coordinates of unoccupied actor.

Server Join Queue

In Demo Project Default Pawn Class is ServerJoinQueuePawn, this not movable pawn so player can't move, this gives us a change to teleport player anywhere we wan't and then we keep their screen black, this creates an illusion that they are joining the server even though they are already in server. Lot of games uses this technique like arma 3 and dayz standalone, it's cheap and dirty. Arma 3 let's every players to join server and if server is full or player doesn't have vip it kicks them.

Better version of this would be to create Game Session class in C++ (File -> New C++ Class) and then expand it with bunch of custom functions. We could store client ip's in TArray, the one stored in zero would get notified when there's a open slot. Then it would be up to client to join.