question

Daniel S avatar image
Daniel S asked

Gameserver and GetMatch doesn't work

I am using Unity and the GDSK. I've set up a Matchmaking Queue that deploys Gameservers. When the gameserver is started, I have problems figuring out how to get information about the match. For example, what teams the different players belong to, or what map was selected.

From the documentation, it says: "Matchmaking does not pass any ticket attributes to the game server. If the game needs to access any ticket attributes on the server, it can do so by calling GetMatch with the ReturnMemberAttributes header to true."

But how exactly do I call GetMatch()? I tried using the PlayFabSdk for clients, logging in, and calling PlayFabMultiplayerAPI.GetMatch(), but as you would expect, this gives me the error: "Failed to get match data: /Match/GetMatch: Only a user in the match can access it.".

I've tried using the POST API for GetMatch, but that requires an EntityToken, and I can't seem to use a secret key to call this, which I'm assuming would just give the same result as my call to GetMatch() with the PlayFabSdk.

The GDSK also seems to have no way of doing this, using PlayFabMultiplayerAgentAPI. Letting the clients send me this information is not reliable, so I want a secure way of getting the absolute data from the matchid / session.

So when the docs talk about using GetMatch, what exactly do they mean? How do I access this data?

Thanks in Advance.

sdksCustom Game Servers
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

·
Gosen Gao avatar image
Gosen Gao answered

If you want to get match info on the server, you can use secret key to call Authentication - Get Entity Token - REST API (PlayFab Authentication) | Microsoft Learn to get a title level entity token, and then call Matchmaking - Get Match - REST API (PlayFab Multiplayer) | Microsoft Learn to get the match info, and the Match Id will be the Session Id of the server instance. If you want to get match info on the client, you can call GetMatch when the ticket is matched.

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.