question

avimon avatar image
avimon asked

CloudScript execution?

I want to know how can I execute a cloudscipt other than PlayFabClientApi.ExecuteCloudScript api call. For example if I want to send a friend request to someone, would I have to do it with same api call or it can be done from server side also?

CloudScript
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, there's also a Server API version of ExecuteCloudScript: https://api.playfab.com/documentation/server/method/ExecuteCloudScript

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

avimon avatar image avimon commented ·

@Brendan But how the script will be executed and when?

0 Likes 0 ·
brendan avatar image brendan avimon commented ·

Can you please clarify the question? The script is executed when you make the call. When you asked if the call can be made from the server side, the answer is that yes, we have a Server API call you can use from a custom game server or Cloud Script. You can also make Cloud Script calls from PlayStream Actions, if that's what you're looking for: https://api.playfab.com/docs/tutorials/landing-automation/using-cloud-script-actions-with-playstream

0 Likes 0 ·
avimon avatar image avimon commented ·

@Brendan Can you provide a sample code of how to make a server api call from a custom game server or CloudScript? I have integrated photon with playfab.

0 Likes 0 ·
brendan avatar image brendan avimon commented ·

I think the confusion here is that Photon is not a custom game server. The Photon service provides a way to have "rooms" that connect players for exchange of packets - it does not provide for custom hosted logic, apart from their Photon Enterprise service. To make calls to Cloud Script from a server, you should be using a custom game server - here's a tutorial on this topic: https://api.playfab.com/docs/tutorials/landing-tournaments/custom-game-servers

0 Likes 0 ·
avimon avatar image avimon brendan commented ·
@Brendan

That means then I have to make calls from Client side with PlayFabClientAPI?

0 Likes 0 ·
Show more comments

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.