question

aleksandr avatar image
aleksandr asked

Please explain me an example cppWindowsRunnerGame

In processRequests connect new players. But as far as I understand, this is done directly - between the client and the server.

Client sends http request and then for each request, "add" a connected player players.push_back(Microsoft::Azure::Gaming::ConnectedPlayer("gamer" + std::to_string(requestCount))); requestCount++; Microsoft::Azure::Gaming::GSDK::updateConnectedPlayers(players);

But as far as I understand, to keep track of players, you need to insert playFabID instead "gamer" + std::to_string(requestCount)

How to get playFabID in this case?

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

·
Citrus Yan avatar image
Citrus Yan answered

The cppWindowsRunnerGame project is just a simple example demonstrating how GSDK is integrated with game servers, which does not implement a mechanism that gets PlayFabId for connected players. To do that, the client need to send their PlayFabId (or other info that can help identity the player, such as Session Ticket or Entity Token) in the network message when connecting to the server so that it can PlayFabId from it.

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

aleksandr avatar image aleksandr commented ·

Can you please refer to an example with Session Ticket or Entity Token? With its transmission by the client and reception by the server.

0 Likes 0 ·
Citrus Yan avatar image Citrus Yan aleksandr commented ·

Sorry, we don't have an example project for that, however, I think you'd be interested in this sample MpsSamples/UnityMirror at master PlayFab/MpsSamples (github.com). In this sample, the client send their PlayFabId to the server so that it can use it to update the connected player list, start from this section:https://github.com/PlayFab/MpsSamples/blob/95f36cee9f1273fdc3b5231363347824ad7669f5/UnityMirror/UnityServer/Assets/Server/Scripts/UnityNetworkServer.cs#L48

0 Likes 0 ·
aleksandr avatar image aleksandr Citrus Yan commented ·

Thank you.

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.