question

forplayers.co avatar image
forplayers.co asked

[Moved to forums] Limits on Cloud Scripts and scheduled tasks

Me:_______

[....]

Would it be allowed to execute a cloud script every 10 seconds which would consists to make one http request and set a title data? Currently, there is no scheduled task option for 10 seconds intervals.

[....]

Brendan:_________

[....]

Specific to your question though, I would recommend reading our tutorial on Title Data (https://api.playfab.com/docs/tutorials/landing-content/using-title-data) and this post, which discusses the various forms of data in PlayFab (https://community.playfab.com/questions/18230/playfab-for-a-persistent-business-sim.html). In short, no, Title Data cannot be used that way.

[....]

Me:____________

[....]

I think I'll opt for another solution then. The goal was to make of playfab a master server for all my servers

[....]

Brendan:____________

I see - we've recently added an additional option in the custom compute space (Thunderhead), but to be clear, Title Data is not designed for the use case you have in mind. I'd be interested in hearing the specifics, though - why exactly are you trying to update a data field that can be read by all players in the game at the same time at that frequency? I'm assuming that it's not something deterministic, since then you could simply provide all the potential data and just use Cloud Script to calculate the correct current data on a per-player basis. So my guess would be that you're trying to aggregate some information based on player activities - is that the case? If so, using a Redis int or similar might be your best bet.

Me:_____________

Thank you for the advices.
Here is the story. Each server has a little .json file that contains its data such as its name, the count of players on it, its allowed app version, its allowed assetbundle version (since a game instance is running on the server for physics).

At the beginning I made this system: the player was asking playfab the available ip addresses and then was making x http requests to the x ip addresses to retrieve all of the json files. I realized that this could be a huge problem if there was a lot of players since it would eat all the bandwidth of each server. Thus, I switched to another solution: making a central server that would do the work and would share one json file containing all the others json files.
I immediately thought to playfab, did the cloudscript and met two problems: cloudscript wasn't able to do async operations which prevented me doing multiple http requests due to the 5 seconds cpu time limit and the one you know.
The 10 seconds interval was especially useful to know the player count, to know whether the server was reachable or not and to always have the accurate infos such as the allowed app version and allowed asset bundle version. I could have added more realtime infos.

Best regards,
Alexandre

CloudScript
capture-decran-36.png (473.1 KiB)
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

So boiling this down, you have a number of custom game servers, and you want to provide metadata on all running servers to players looking for games. One thing to know is that you can use https://api.playfab.com/documentation/client/method/GetCurrentGames to get information on all running game sessions, whether you're using our server hosting or external server hosting. However, it sounds like you also want to have some custom data per game session available. Since a generic data system which can aggregate information from updates made by all clients (which could be millions of players) would be incredibly expensive to operate, I'd have to recommend using external data for that.

1 comment
10 |1200

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

forplayers.co avatar image forplayers.co commented ·

It seems to be awesome, I thought it was only for Windows Server 2012. It seems I wasn't clear in my words. My old system had no interactions with the players and wasn't getting information from updates made by all clients. It was just retrieving the current player count from a server.

I'm currently trying it.

Thanks for the help!

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.