I've got a cloud script function that handles a few different things when the user completes a level. One of the things it does is add the relevant virtual currencies based on the player's performance in that level. I'd like this cloud script function to return the current VC values so the client can make sure its values are fresh.
What I'd like to do is:
1. Get current VC values
2. Apply any earned changes based on performance
3. < other things with stats, save progress, etc >
4. Return the current VC values
The key here is that it's all one call from client to server, but I don't see a way for me to do step 1 and Get the current values (which means I can't do step 4 either). I see an Add/Subtract call I can use to adjust the values (which are now atomic?), but not a way for me to get them.
Any info would be greatly appreciated. Thanks!
-Matt