Idea

simong@everguild.com avatar image
simong@everguild.com suggested

UnlockContainerItem on the Server API

It would be quite good to have most of the client API inside the server API so we can use cloud script to handle in a better way some API calls.
Would it be possible to add UnlockContainerItem function into the server API?
The idea is to ask via cloud script to unlock a container and then do some other stuff on the server after the item was unlocked.
I'm using a cloud script call after but it creates a chain of asynchronous calls that slow down the system where most of the job could be done in one script call if I had access to the client API in the server API.
Thanks

10 |1200

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

4 Comments

·
brendan avatar image
brendan commented

In general, we prefer to add Server API calls which are needed, since there are a number of Client API calls which aren't valid in that context (like any login operations).

Since you're specifically asking about UnlockContainerItem, is that because you are doing procedural item generation, and want to apply some custom values to the items on creation? I have an open backlog item to add that API method to the Server API set, so I'll add you to that for tracking (and aggregation of how many people are asking).

But bear in mind that you are limited to 10 PlayFab API calls in the course of one Cloud Script execution. So if you have something more complex in mind, we should probably discuss it in more detail, and probably open a backlog item to address your need more specifically.

10 |1200

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

simong@everguild.com avatar image
simong@everguild.com commented

Thanks for the response. The idea is after a player bought a container I need to unlock it and then generate custom user read only data according to what he unlocked. So yeah but having this on the server side I could save one async call for most purchases.

I didn't know about the 10 api calls limitation, that's good to know!

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 commented

I see - thanks, having the scenario info is helpful in making sure we understand the need.

We'll make sure to get the limits posted to the site as soon as we can, so that everyone has the info on this.

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 commented

There are a couple of ways to do this now, depending on your specific requirements:

1. https://api.playfab.com/Documentation/Server/method/UnlockContainerItem and https://api.playfab.com/Documentation/Server/method/UnlockContainerInstance

These API calls let you unlock a container - either of a given ItemId or a specific Instance on the player account from your Cloud Script.

2. https://api.playfab.com/Documentation/Server/method/EvaluateRandomResultTable

Alternately, this method lets you get a "draw" from a drop table in your game, but without creating or adding the item. This allows for more complex behaviors, where you want to check that the player doesn't already have the item before adding it, for instance. In that case, the recommendation is to switch to an alternate drop table, so that you can award items which don't need to be unique in the player inventory (like virtual currencies).

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 a Comment

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

Your Opinion Counts

Share your great idea, or help out by voting for other people's ideas.

Related Ideas