question

rocketcolastudio avatar image
rocketcolastudio asked

Mass restore all virtual currency purchases after a closed beta

Hello,

we will run a closed beta and we want to restore the virtual currency that players will buy and use during this period.

So if a player buys 100 HC and spends it, after the beta he will get 100 back.

If a player buys 100 HC and spends 50 HC, he will get 50 back. etc.


What would be the best way to achieve something like 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

·
Citrus Yan avatar image
Citrus Yan answered

Hi @rocketcolastudio,

As I see it, using a Scheduled task that run actions on each player in a segment might be a good way to massively restore all virtual currency purchases after a closed beta, the action being a Cloud Script function that will first check how much VC should be restored (refund) for each targeted player and then call AddUserVirtualCurrency to restore the VC, and, the segment should contain all active players during the beta in case you missed out some players, hence, the All Players segment is a safe choice.

Now, we have only one problem left: how to calculate the Refund for each player? And, to simplify the question, let’s suppose there are only two operations players can perform regarding virtual currency: (a) buy VC (b) spend VC. There are two ways to achieve this:

  • Keep track of the total VC players bought, after the closed beta, subtract the amount of VC players currently have from the total VC they bought to get the amount of refund.
  • Keep track of the total VC players spent, after the closed beta, it should equal to the amount of refund.

You can utilize another type of VC, Player Data, or Statistics to keep track of VC bought/spent. For instance, suppose we choose to keep track of VC bought and use another type of VC (let’s suppose it’s called RC ), the basic idea is that whenever the player buys the VC we always add the same amount of RC for him, after the beta, the amount of RC for each player equals to the total VC he/she bought. Similarly, if we choose to keep track of VC spent, we’ll need to add the same amount of RC whenever players spend the VC, after the beta, the amount of RC should equal to the amount of refund.

Please feel free to reach us if you have any questions regarding 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.

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.