Wait all clients to login

I want server to wait for all clients to login and then tell them to start playing. In “Multiplayer Shootout” I saw I could use Blueprint Session Result to get current players and max players, so I suppose I could check if current players == max players in a loop, and set some RepNotify variable to tell other clients to initialize and start playing.

What I don’t know is, how to get Blueprint Session Result? How can a server get his current session? In Multiplayer Shootout example I could see FindSessions function that returns all sessions in LAN. How to recognize session that is set by my server?

Still interested in this one!

The game session is responsible for providing information to potential clients about available hosts.

When you are a host, your GameMode (available only to server, it does not exist on clients) has the information for how many players are in your game (host included) in the variable “NumPlayers”.

If you are using ServerTravel in order to change maps afterwards, you can use GameMode to see how many clients are still traveling by checking it’s “NumTravellingPlayers” variable.

Hope this helps :slight_smile:

Thank you, that was really a helpful answer :slight_smile:

But, one thing that confuses me now, though, is that GameMode is not available on clients. In the Multiplayer Shootout, MyPlayerController blueprint executes event ClientPostLogin and there it calls MyGameMode’s event for spawning a player. I first assumed that client maybe has “some part” of GameMode in order to call it’s event, but when I try to debug, it’s always shows null on client side. Even further, client RPC call never seem to execute.

Am I seeing things wrong?

ps. Sorry I added this second question, but you seem like you really know this stuff, I don’t want to lose you :slight_smile:

That part of Multiplayer Shootout also got me a bit confused due to the same reason. My understanding is the PlayerController is the only object able to communicate with Server Only calls whether or not it was meant to have access to the object, such as GameMode.

Sorry that I can’t provide additional insight for that logic :slight_smile:

Still, it is strange that we can’t invoke any other event or function after RespawnPlayerEvent. It definitely does execute, client get’s it’s own player at adequate PlayerStart, but we can’t breakpoint that event.

Anyway, I’ll post this as a new question and hope we will get more information on this. Thanks once again :slight_smile: