question

Prabin Gurung avatar image
Prabin Gurung asked

Unable to subtract rechargeable virtual currency

"Hello PlayFab team,

I have recently noticed an issue with my rechargeable virtual currency in PlayFab. I have created a virtual currency called 'timer' with an initial deposit of 1, a recharge rate of 86400, and a recharge maximum of 1. However, when I manually or using the subtract API, I subtract the timer from 1 to 0, the value automatically updates to 1 instead of waiting for the time to recharge. This behavior was not present before and I am unsure if it is a bug or intentional. Can you please provide some clarification on whether this behavior is expected or if it is a bug that needs to be addressed? Thank you."

apis
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

·
Simon Cui avatar image
Simon Cui answered

Given your description, the recharge rate of 86400 means that it will grant a user 86400/per day, which equals to 3600/per hour or 1/per second. Therefore, the currency value will become to 1 instantly after 1 second since you subtract it to 0. As soon as the currency drops below its max recharge level, that starts the timer to when the next unit will recharge (based on your recharge rate). Please refer to this post: Virtual currency's recharge rates times are at specific hours in server, or after the players wastes it? - Playfab Community.

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.