question

Lewis avatar image
Lewis asked

How can I query for player data from a MultiPlayer server?

I'm developing a game that uses the Multiplayer server feature using the C# GSDK. I'm also using the matchmaking service to pair two users together. When a server is allocated, I receive the two player ids from the GetInitialPlayers() call. However, those player ids appear to be title player ids, and calls to standard PlayFab APIs such as Server/GetPlayerStatistics don't appear to work.

Is there a way to query the standard PlayFab API from a multiplayer server? (I am able to make non-user API calls such as Server/GetTitleData successfully, so API authentication is working)

Thanks!

multiplayer
10 |1200

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

Seth Du avatar image
Seth Du answered

You can call GetProfile API separately and get the PlayFab ID through EntityChain. In addition, Since after the player is connected to the server, for authentication, the server will require players to send their SessionTicket, to call AuthenticateSessionTicket API. You can also get the PlayFab Id in the callback result.

10 |1200

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

Abdulhai Moubarak avatar image
Abdulhai Moubarak answered

I just added this when creating a ticket in the matchmaker

Attributes = new MatchmakingPlayerAttributes { DataObject = new { PlayerId = PlayfabLoginManager.PlayerId }

then you can retrieve it by getmatch and accessing the attributes

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.