question

k-hiraki avatar image
k-hiraki asked

Can't Find the Lobby

I am implementing the lobby functionality using Unity's PlayFab SDK. It was working fine until yesterday, but for some reason now I cannot find the lobby. The requests themselves are being sent and received successfully. However, it seems that the search for lobbies is no longer working properly.

Please let me know if there are any mistakes.

this is the create lobby code:

CreateLobbyRequest createLobbyRequest = new CreateLobbyRequest
{
	AccessPolicy=AccessPolicy.Public,

	MaxPlayers=4,

	// creating user's entity
	Owner=PlayFabController.Instance.UserEntity,

	OwnerMigrationPolicy=OwnerMigrationPolicy.Automatic,

	UseConnections=true,

	Members=new List<Member>
	{
		new Member
		{	
			MemberData=new Dictionary<string,string>
			{
				{"UserName", userName },
			},
		MemberEntity=PlayFabController.Instance.UserEntity
		}
	},
	LobbyData= new Dictionary<string,string>
	{
		{"LobbyStatus","Ready"},
	},
	SearchData= new Dictionary<string,string>
	{
		{string_key1, "roomName"}
	},
};

PlayFabMultiplayerAPI.CreateLobby(createLobbyRequest,
(result)=>{
	// success
	},
OnFailure);

this is the find lobby code:

FindLobbiesRequest findLobbyRequestAsMember = new FindLobbiesRequest
{
	Filter="lobby/membershipLock eq 'Unlocked'"
};


PlayFabMultiplayerAPI.FindLobbies(findLobbyRequestAsMember,
(result)=>{
	switch(result.Lobbies.Count)
	{
		case0:
			Debug.Log($"here");
			break;
		default:
			Debug.Log($"not comming");
			break;
	}
},
OnFailure);
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

·
Xiao Zha avatar image
Xiao Zha answered

By default, the Lobby needs a connected entity to be searchable. For more details, please see UseConnections section in CreateLobby API.

PlayFab Unity SDK is based on RESTful API and can't be used to establish the connections. To create a connected Lobby, please use PlayFab Multiplayer SDKs.

Otherwise, if you do not need real-time notifications, you can set UseConnections to false and also OwnerMigrationPolicy to None, then lobbies do not need connections to be searchable.

2 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.

zreederem avatar image zreederem commented ·

I'm also trying to use this API because the Lobby SDK doesn't seem to work on Android.

I added the AuthenticationContext to the CreateLobbyRequest, but still get no results.

1 Like 1 ·
Resul avatar image Resul zreederem commented ·

Did you find any solution for Azure Playfab Lobby and Matchmaking Unity SDK working with Android?

In this post, they mentioned as the "PlayFab Lobby and Matchmaking" feature is not supported for mobile platforms. And I can not see anything about Android or iOS here.

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.