question

tobias-nerg avatar image
tobias-nerg asked

A couple of questions about Lobbies

Hello!

Currently trying out and implementing logic pertaining to the new Public Preview Lobbies.
I'm using Unity and the PlayFab Multiplayer SDK for Unity.

  1. When PlayFabMultiplayer.OnLobbyFindLobbiesCompleted fires, all the lobbies in the result has 0 MaxMemberCount and 0 CurrentMemberCount. Is this expected or a known/unknown bug?
  2. In my studios' title game, Lobbies aim to be as short-lived as when the last player leaves the game session. I currently have many "Ghost" lobbies present, which is because I forgot to call Lobby.Leave.

Since we are in development, every time the game boots up, a new account is created:

var request = new LoginWithCustomIDRequest { CustomId = RandomString(10), CreateAccount = true };

This means that as far as I know, I can not log into these accounts again, and their lobbies seems to be alive forever (?).

  • Is a lobby alive indefinitely until the user actually calls Lobby.Leave? I recently purged all the "Test users" of my title, but the lobby is still alive.
  • Is there a way that I can kill these lobbies by hand without having access to the user that created them?

3. What are the accepted Keys to a SearchProperty?

https://docs.microsoft.com/en-us/gaming/playfab/features/multiplayer/lobby/lobby-properties only mentions the limitation, but not the actual approved keys.

3b. We are wondering if additional information about the lobby could somehow be synced in e.g a SearchProperty. For now we had the idea to include the state of the actual game (In Game creation, In the actual game playing level x, etc).

Thanks!

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Made Wang avatar image
Made Wang answered

1.You can call PlayFabMultiplayerAPI.FindLobbies to get the lobby and it works fine in testing.

2.[Edited] I did some more tests so that I need to revise my answer. In the test, the lobby will be automatically deleted when there is no connection for more than 15 minutes.

3.For restrictions you can refer to Find lobbies - PlayFab | Microsoft Docs.

3b.You can manually customize the required information in SearchProperty, refer to Create searchable lobbies - PlayFab | Microsoft Docs. And you can call UpdateLobby to update the properties in it.

4 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

tobias-nerg avatar image tobias-nerg commented ·

Thank you! Must have overlooked some of the documentation. All of my questions are answered :)

0 Likes 0 ·
tobias-nerg avatar image tobias-nerg commented ·

Just a small addendum: Using PostMan I get the correct

"MaxPlayers": 8, "CurrentPlayers": 2,

However in the Unity MultiPlayerSDK

PlayFabMultiplayer.OnLobbyFindLobbiesCompleted those values are always 0. Maybe a Unity SDK only bug?

0 Likes 0 ·
Made Wang avatar image Made Wang tobias-nerg commented ·

There are two APIs here, one is PlayFabMultiplayerAPI.FindLobbies and the other is PlayFabMultiplayer.FindLobbies, the former is the API in the PlayFab SDK and works fine in testing, the latter is the API in the PlayFabMultiplayer SDK which does return always 0. You can refer to the code below to use the first API.

PlayFabMultiplayerAPI.FindLobbies(new PlayFab.MultiplayerModels.FindLobbiesRequest(),
            (result) =>
            {
                foreach (var item in result.Lobbies)
                {
                    Debug.Log(item.CurrentPlayers);
                    Debug.Log(item.MaxPlayers);
                }
            },
            (error) =>
            {
                Debug.Log(error.GenerateErrorReport());
            });
0 Likes 0 ·
tobias-nerg avatar image tobias-nerg Made Wang commented ·

Thanks for the reply @Made Wang! I see now that I got confused by the different API:s :)

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.