question

Marian Stychuk avatar image
Marian Stychuk asked

Call GetLobby from azure function backend

Hello!

We have an azure function game backend where we would like to get the lobby info (/Lobby/GetLobby) in the azure function invoked by a client via ExecuteFuntion. The problem is that the regular title authentication which is used for all server-side requests doesn't work for this API. Here's an error:

 {
     "code": 401,
     "status": "Unauthorized",
     "error": "NotAuthorized",
     "errorCode": 1089,
     "errorMessage": "Only entities of the following types may call this API: game_server, title_player_account"
 }

According to this comment, I see that the game_server entity is being developed and cannot be used. And the title_player_account entity requires client entity token which is not provided in the FunctionExecutionContext. Obviously, we can provide it 'manually' in the function argument, but this doesn't seem like a correct approach.

So what would be the correct way to retrieve a Lobby information on the game backend?

P.S. We need that info to grab all the members of a party, whose member invoked the function.

Matchmaking
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

Only lobby owner or member can get the lobby details through GetLobby API. So, currently, to get the client owned lobbies details in Azure Function, you can only pass EntityToken in the Azure Function to call the GetLobby API. Also, the game_server entity is developed, you can call AuthenticateGameServerWithCustomId API to create a game_server entity and refer to Game Servers and Lobbies - PlayFab | Microsoft Learn to create server owned lobbies.

10 |1200

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

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.