jacobturley14 avatar image
jacobturley14 asked

GetPlayersInSegment with Inventory?,Get players in segment, but include inventory?

Essentially I am trying to do a database sync. I am creating a public facing API for a title and will be keeping in sync with events. However, on the inital load I really don't want to go through all 60k and issue a getPlayerCombinedInfo. Is there an easier way to get all player info(stats/Inventorty) with something like GetPlayersInSegment?


So I see in the PlayerProfile that inventory is not included, but if I do getPlayerCombinedInfo, I can include the inventory... I am creating essentially a database sync for a public facing API(they hit my DB which updates based on events) but on the inital load of data, I really don't want to get each profile 1 by 1, is there any way around this?

Player DataPlayer Inventory
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

Sorry, but what you're describing isn't supported, as a) it would generate an excessive number of calls in a short window, increasing as your player count grows, and b) it wouldn't provide you with reasonable accuracy, since players could be changing inventory often.

What you should do is use the PlayStream system to keep your data in sync. One way would be by using the Webhook system to set up a call to your server whenever there are events like player_inventory_item_added or player_consumed_item. Another would be to use the Event Archive to get all the events in your own S3 bucket, and have a job set up that processes those events regularly. A third would be to have a Cloud Script call which uses http.request() to make a call to your server on player login, or occasionally, when important changes are made to the player inventory.

10 |1200

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

jacobturley14 avatar image jacobturley14 commented ·

Sorry, I probably didn't explain myself correctly.

What you described is what I am doing via the s3 bucket archive. The main issue I am having is the inital "data load". I would rather not have to load every player individually one time(off set by 3 seconds or something).

Again, this is a one time inital data load.

0 Likes 0 ·
brendan avatar image brendan jacobturley14 commented ·

Your best bet, if you didn't set this up prior to launch, is to use the Cloud Script route I described above - do this as a one-time thing on the next player login after you get this set up, and set a flag in the player save data to indicate that it's complete once you have (so that each player only does it once, but even players who haven't signed in for a long time will still get this when they next sign in).

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.