question

frostdamage avatar image
frostdamage asked

API calls optimisation

Hi. I currently experience block by API calls limit. In my cloud code I user quite much, but only because I work with arrays of entities and players. Is there a way to use entity.GetObject. entity.SetObject and server.GetUserAccountInfo on arrays of entities/users? The function is run by scheduled task every day at midnight and has to manage a row in TitleData.

Alternatively I could use Leaderboards for my purpose but I cannot find a way to create two-parameter leaderboard. For my instance I need to sort players by points and date of last point earned.

Second approach looks much cleaner, but ss there a way to achieve that?

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

·
Andy avatar image
Andy answered

No, we generally don't support operations on collections of users. Our preference in many of those types of cases would be to add players to a group and operate on the group. Could you share more about your scenario and why it requires you to operate on collections of users?

Also, we only support a single statistic per leaderboard. You could, of course, created two leaderboards, but a) that might not be what you want and b) you'd need to transform that date into an integer (number of days, for instance).

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

brendan avatar image brendan commented ·

@FrostDamage : Can you explain what you mean when you say that the scheduled task "has to manage a row of Title Data"? If you are trying to aggregate information from a bunch of users into Title Data, that is not supported and specifically will not work. Title Data is only designed to be updated periodically by the developer/publisher, and never as a result of an operation on a client. If that's what you're trying to do, can you explain in more detail, so that we can guide you to something that will work?

0 Likes 0 ·
frostdamage avatar image frostdamage commented ·

Nevermind. I'll use pair of leaderboardsm thanks for this idea. However, I'm curios will there be such feature. Leaderboard is just a sorted list of data, right? If you will allow developers create their own comparators they could create their own data-types for leaderboards (ofcource, if you are not tied with data size)

0 Likes 0 ·
Andy avatar image Andy ♦♦ frostdamage commented ·

We are planning to allow for additional metadata attached to leaderboard entries, but we don't currently plan to extend that to offering custom comparators. There are some risks there around hosting your logic in our main service. We could probably come up with a solution, but it's not been something we've explored.

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.