Basically, I have a currency that I save every time the player leaves the game (the saving system is quite secure I think), the player can also buy currency. When a player buys currency it automatically saves (without waiting for them to leave)… if the save succeeds, the player is awarded their coins (they are added to their leaderstat). But if it does not succeed, I currently send a message trough webhooks and I would probably award it to the player manually. This is because if it did fail and I still gave them the coins, the leaderstat value would be different from the save. Now you may say it will save once they leave, but what if that fails too?
I want to make sure that if the player’s get their coins, the save is successful, else it would create even more confusion and trouble. Is this a good way to do it? And should I even be this worried about data saves failing?
I also have another concern… I want to make sure that it doesn’t attempt the purchase and saving coins unless the player’s data is already loaded to prevent data loss. I have this quite sorted out, however as you may know, if the player leaves jsut after buying a devproduct, it is common to return:
´Enum.ProductPurchaseDecision.NotProcessedYet´
in the processReceipt() function in order to retry the process once the player rejoins. If the player rejoins, I am not sure how to make it wait for the data to get loaded before retrying the process. Should I just return ´NotProcessedYet´ again if the data isn’t loaded? What will happen if I do that?