question

doronhn avatar image
doronhn asked

clientapi vs server api - mobile game with unity

Hey,

i am creatating mobile game using unity, and i cant understund what is the diffrent betwenn PlayFabClientApi and PlayFabServerApi, why do i need them both? why use the one on the other?

thanks

apis
10 |1200

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

brendan avatar image
brendan answered

The Client API is for use from client devices - the player. The Server API is for use in Cloud Script or custom game servers (dedicated servers). If you compare the two API sets, you'll see there are some significant differences between them. In specific though, the Server API is for you to use in server-authoritative logic, so that you can update data/stats for players only after making sure the values are legitimate, read and make use of data you don't want to expose to the player (for privacy reasons, or to protect the integrity and security of the game), etc.

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

doronhn avatar image doronhn commented ·

hey,

Thanks brendan for the fast answer.

what puzzle games are doing today? how they update the current player level? they use dedicated server?

the clientAPI is not secure?

0 Likes 0 ·
brendan avatar image brendan doronhn commented ·

Most are using Cloud Script to do these updates. I'm not sure what you mean concerning whether the Client API is "secure". All API calls to the service use SSL, which helps to protect against man-in-the-middle attacks. But the local client is a general-purpose computing device. You cannot prevent the local client from altering the data being sent to the service (the Client API calls), or from just modifying the local memory to set whatever values the user wants to. That's why it's important to consider server-authoritative logic as the only true source of information about the player's progress.

0 Likes 0 ·
doronhn avatar image doronhn brendan commented ·

got it, thanks.

is it common that players alter data?

0 Likes 0 ·
Show more comments
jrDev avatar image
jrDev answered

Hello,

Here is the question,

I am calling server API through Cloudscript, what should I be using to reduce any modifications? Should it be ClientExecuteCloudScript or ServerExecuteCloudScript?

Thanks,

jrDev

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.