Search Unity

Resolved Lobbies.Instance.QueryLobbiesAsync returning Lobbies with Null LobbyCodes

Discussion in 'Lobby' started by daniel_lochner, May 10, 2022.

Thread Status:
Not open for further replies.
  1. daniel_lochner

    daniel_lochner

    Joined:
    Jun 9, 2016
    Posts:
    171
    Hi there,

    When you try to list the available lobbies from a joining client, their lobby codes are strangely all undefined. Their data, however, is all perfectly intact -- it's just their lobby codes.

    The following snippet will output Null for each available lobby:
    Code (CSharp):
    1. List<Lobby> lobbies = (await Lobbies.Instance.QueryLobbiesAsync()).Results;
    2. foreach (Lobby lobby in lobbies)
    3. {
    4.     Debug.Log(lobby.LobbyCode);
    5. }
    Thank you in advance.
     
    mconradie likes this.
  2. veleek_unity

    veleek_unity

    Ben Randall Unity Technologies

    Joined:
    Aug 25, 2021
    Posts:
    59
    Hey Daniel,

    The join code is a member only property. When you're querying public lobbies, you can just use the Lobby ID to join the lobby so you don't need the lobby code. The code is intended to be shared manually (e.g. voice chat, text message, etc.) through some other channel by an existing member so it can be typed into the client to join a room without knowing the full ID.

    Let me know if that makes sense or if you're expecting different behavior!
     
    ba55yunky and mconradie like this.
  3. daniel_lochner

    daniel_lochner

    Joined:
    Jun 9, 2016
    Posts:
    171
    Ah alright, thank you! :)
     
  4. emilyryan

    emilyryan

    Unity Technologies

    Joined:
    Nov 22, 2019
    Posts:
    129
    We are going to close out this post, but if you have any additional questions please feel free to create a new forum thread. Thanks for your cooperation!
     
Thread Status:
Not open for further replies.