question

ad@t-bull.com avatar image
ad@t-bull.com asked

Security Problem with global INFO

Hello, there
Can You tell me if there is possibility to write and read global informations available for all users without using Title Data?
I wonder about this because to use Title Data I have to use PlayFab Api Secret Key and i really dont want to put this information in my apk because of security.

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

·
brendan avatar image
brendan answered

Yes, you should never let your Secret Key get out - it would allow anyone to wreak havoc on your game.

The Shared Group Data system is the one we provided, to give you a space where multiple users can all write to it and read from it (though this should not be used a "global data" for all users - more on this below):

https://api.playfab.com/Documentation/Server/method/GetSharedGroupData
https://api.playfab.com/Documentation/Server/method/UpdateSharedGroupData

I'm showing the Server version, by the way, since our recommendation, for the most part, is to only write to it from secure, server-side operations, in order to prevent cheating.

Note that this is intended for a discrete subset of users in your game. There are two key reasons for this:

First, multiple players could be writing to it simultaneously - locking the data for write isn't really a possibility, as it would cause constant issues once you go to scale. So you should either design to allow for collision (last person to write to the Key "wins"), or have your users write to distinct Keys, using their PlayFab ID as part of the Key. Though note that Shared Group Data, as with the User Data types, is limited in the total number of Keys (100 of 100KB each right now, but please check our site for the latest version of the limits, which we'll be posting within a couple of weeks of this post), so that should be taken into consideration as well.

More importantly though, the Shared Group Data is the same as User Data, in that it cannot be replicated across multiple servers, as that would cause sync delays between instances of the data. Data which is to be read by all players, like Title Data, is replicated in this way. Data that can be updated by users needs to be highly reliable, in terms of the values written, and so it cannot. So if you have many users all trying to read the same data at the same time, you will cause delays and potentially even timeouts in those operations - it's simply a matter of physics, at that point.

So the real question comes down to, what is the in-game behavior you're trying to produce? Knowing the design goals would help us in advising you on the best way to achieve it.

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.