Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Joining lobbies as a group?

Discussion in 'Lobby' started by MarcoZVincenzi, Oct 2, 2023.

  1. MarcoZVincenzi

    MarcoZVincenzi

    Joined:
    Mar 3, 2022
    Posts:
    15
    Is it possible to join a lobby as a group of players?

    Imagine a P2P environment were 2 players, A and B, want to play together in a public lobby. If they were to search for a lobby independently, it's not guaranteed they'd end up in the same one. So far, the only solution we could come up with is to force the group host—say, player A—to create a public lobby and send its code to player B, but this could still create a situation where we have a number of almost-empty lobbies that don't have enough members to start a game.

    When creating a Matchmaking ticket, a list of players is passed so that the Server knows who is expected to connect. Is there nothing similar that can be done with lobbies?

    Alternatively, if we were to create a lobby just for these 2 players, would there be a way to "merge" it with other existing lobbies?
     
  2. bartj-unity

    bartj-unity

    Unity Technologies

    Joined:
    Sep 9, 2021
    Posts:
    26
    The Bulk Update API is probably your best bet - it requires you to make the requests using service account authentication, but it allows you to join multiple players into a lobby in one request. There is no built-in way to merge lobbies, unfortunately, so this API would also likely be the easiest way to do that.
     
    MarcoZVincenzi likes this.
  3. MarcoZVincenzi

    MarcoZVincenzi

    Joined:
    Mar 3, 2022
    Posts:
    15
    Thanks!

    One quick thing, the API docs say the Bulk Update call can be authenticated with either a Service Account or a Client, but the description says ony Service Accounts should be allowed to. Or is it just that, if a Client were to call it, they would only be able to change lobby data relative to themselves?
     
    Last edited: Oct 9, 2023