I can't find any documentation on how to interact with the reserved currency and how it works. There doesn't seem to be any methods to call such as reserve1(), release1(), etc on SparkPlayer
Is this a deprecated feature?
Best Answer
C
Customer Support
said
over 5 years ago
Hi Ryan,
This is to do with challenge wagers. When a challenge is created with a currency wager the amount set as the wager for a particular currency is stored in the reserved currency field for the creator/joining player. If you look at the below example you can see a challenge created with a wager.
Two things will happen here. The challenge will be created and the wager amount will be placed into the reserved currency field for that player or they will receive an "INSUFFICIENT_FUNDS" error if they don't have the 500 to cover the wager. If you have any further questions just let me know.
This is to do with challenge wagers. When a challenge is created with a currency wager the amount set as the wager for a particular currency is stored in the reserved currency field for the creator/joining player. If you look at the below example you can see a challenge created with a wager.
Two things will happen here. The challenge will be created and the wager amount will be placed into the reserved currency field for that player or they will receive an "INSUFFICIENT_FUNDS" error if they don't have the 500 to cover the wager. If you have any further questions just let me know.
Thanks,
Liam
R
Ryan Fuller
said
over 5 years ago
Ah got it. this is bridging more into feature request territory, but it would be nice to have access to that field for atomicity. I have a complex custom playerState collection that changes fields after debiting or crediting some currency. But if the mongodb update fails for some reason, they will have lost the currency.
So it would be nice to reserve the currency upfront, and charge it or release it depending on the success of other mongo updates. I know we have getbalance() right now, but something can always happen in between.
Just a thought.
Thanks,
Ryan
Customer Support
said
over 5 years ago
Hi Ryan,
Although you don't have direct access to the reserved currency fields you can get them in Cloud Code by using a SparkRequest to send a AccountDetailsRequest, then get the required reserved fields from the response.
//example
var request = new SparkRequests.AccountDetailsRequest();
var response = request.Send();
Spark.setScriptData("reservedCurrency", response.reservedCurrency1)
As the wager amounts are locked into challenges for system use it's unlikely that a method to the release these values based on factors from outside of a challenge would be implemented. If you have any other questions just let us know.
Ryan Fuller
I can't find any documentation on how to interact with the reserved currency and how it works. There doesn't seem to be any methods to call such as reserve1(), release1(), etc on SparkPlayer
Is this a deprecated feature?
Hi Ryan,
This is to do with challenge wagers. When a challenge is created with a currency wager the amount set as the wager for a particular currency is stored in the reserved currency field for the creator/joining player. If you look at the below example you can see a challenge created with a wager.
Two things will happen here. The challenge will be created and the wager amount will be placed into the reserved currency field for that player or they will receive an "INSUFFICIENT_FUNDS" error if they don't have the 500 to cover the wager. If you have any further questions just let me know.
Thanks,
Liam
- Oldest First
- Popular
- Newest First
Sorted by PopularCustomer Support
Hi Ryan,
This is to do with challenge wagers. When a challenge is created with a currency wager the amount set as the wager for a particular currency is stored in the reserved currency field for the creator/joining player. If you look at the below example you can see a challenge created with a wager.
Two things will happen here. The challenge will be created and the wager amount will be placed into the reserved currency field for that player or they will receive an "INSUFFICIENT_FUNDS" error if they don't have the 500 to cover the wager. If you have any further questions just let me know.
Thanks,
Liam
Ryan Fuller
Ah got it. this is bridging more into feature request territory, but it would be nice to have access to that field for atomicity. I have a complex custom playerState collection that changes fields after debiting or crediting some currency. But if the mongodb update fails for some reason, they will have lost the currency.
So it would be nice to reserve the currency upfront, and charge it or release it depending on the success of other mongo updates. I know we have getbalance() right now, but something can always happen in between.
Just a thought.
Thanks,
Ryan
Customer Support
Hi Ryan,
Although you don't have direct access to the reserved currency fields you can get them in Cloud Code by using a SparkRequest to send a AccountDetailsRequest, then get the required reserved fields from the response.
As the wager amounts are locked into challenges for system use it's unlikely that a method to the release these values based on factors from outside of a challenge would be implemented. If you have any other questions just let us know.
Thanks,
Liam
-
Documentation Notes
-
Design issues with user events
-
Using NoSQL
-
Runtime Collections vs Metadata Collections
-
Anonymous authentication from browser app
-
Modules
-
Movement With Unity
-
Problem with url parameters for downloadables
-
Querying NoSql GameSparks database
-
Challenge accesType
See all 2487 topics