You can set an integer variable in your game mode like “MaxNumberOfConnectedPlayers” and when post login is called increment that integer upwards and set it.
Right before incrementing the variable do a branch and check if Max Number Of Connected Players is >= to your number. Off false run your logic and increment the integer, if true just create a function in your player controller to “Open Level” you want them to return to and call it from that game mode. Create a server function in the game mode that casts to that player controller.
You can cast from that game mode to that player controller by passing the player controller reference from player controller object reference off the On Post Login function into the cast of the game mode server function. If that makes sense.
Be sure that you use the log out function in the game mode to decrement the Max Number Of Connected Players when a player leaves to make room for other players.
P.s. I don’t think you’ll be able to get a game instance variable from the server in the game mode unfortunately.