Skip to content

OnLobbyEntered callback returns no metadata? #838

Description

@YasinAhmet

I have been using OnLobbyEntered callback to handle joining process. But I have added some custom metadata to send name of the map, as it varies from lobby to lobby. Apparently, it goes like this:

  1. Host successfuly sets the metadata // Debug says so
 lobby.SetData("roomName", setRoomName);
lobby.SetData("map", mapName);
lobby.SetData("isDemo", isDemo ? "true" : "false");
  1. Matchmaking lists lobbies and can see metadata // I can successfuly render room name, map name etc
Task<Lobby[]> lobbies = SteamMatchmaking.LobbyList.RequestAsync();
yield return new WaitUntil(() => lobbies.IsCompleted);
 if (lobbies.IsFaulted) {
     Debug.LogError("Failed to fetch lobbies: " + lobbies.Exception);
      yield break;
}
Lobby[] fetchedLobbies = lobbies.Result;
  1. Player tries to join the lobby and has no metadata // OnLobbyEntered callback => Received lobby reference does not have metadata.
private void OnLobbyEntered(Lobby lobby) {
    lobby.GetData("map"); // No metadata
}
  1. Matching with lobby list request workaround // Use RequestAsync metadata instead
Simply some functions that finds a lobby using lobbyId. SteamMatchmaking.LobbyList.RequestAsync()

This works well. But most likely going to break for Friend Only lobbies as it includes matchmaking.

So, any idea what is happening? Am I not supposed to receive metadata through this callback? Looks like we don't have RequestLobbyData, which updates lobby data of a lobby reference. Any healthy workaround?

Facepunch Steamworks: 2.4.1.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions