About automatically joining the room after entering the lobby.

Question :
I read the OnPlaySessionStarted API, which says, “If a Callback is not supplied, coherence will automatically join the specified RoomData.” Does this mean that if I do not use lobbies.OnPlaySessionStarted += OnLobbyPlaySessionStarted;, it will automatically join the room?

Requirement :
I want the player to automatically join the room when they call FindOrCreateLobbyAsync, without waiting for the Lobby Owner to call “StartGameSessionAsync”

Reference:
OnPlaySessionStarted API

Lobby

Looking forward to your reply.

If a player is in the lobby when the lobby owner starts the session, they will automatically join the room.

If a player joins the lobby after the game has started, you’ll need to use the lobby RoomData like in the snippet here to manually join the room: Lobbies | coherence Documentation

So,lobby owner must call StartGameSessionAsync for players (including the lobby owner) to enter the room?

Yes, if you want to rely on this automatic functionality. If you want to manage rooms completely separate from lobbies, then you can do something like:

  1. use a lobby to coordinate players with attributes
  2. create a room outside of the lobby “start game” system using the normal coherence rooms API
  3. add the room data to a lobby attribute
  4. use lobby attributes (and hence the room to join data) by all future members of the lobby to join as needed