Hi - I seem to be having an issue with some of my API calls getting lost. In my game, I give the player the ability to unlock all locations (4 of them) via in-app purchase. I have all receipt validation with Google working fine.
The problem is that when a player purchases the locations, I loop through and run a "PurchaseLocation" script that fires off FOUR UpdatePlayerStatistics API call (one for each location just unlocked). These API calls seem to be failing without error, and randomly.
The expectation is that in Player Statistics, after purchasing the 'unlocklocations' item (and consuming it), four new statistics will appear: "Location1Unlocked = 1", "Location2Unlocked = 1", etc. What is happening is that I am getting random results. Sometimes only one statistic makes it, sometimes three of them, and always something different.
I suppose the question is: Am I firing off too many API calls all at once? It seems very random, and I'm not getting any errors, it actually doesn't even look like it's calling all four of them...but again, it's random.
Here is most of the code I'm using to do this. Again, there are no errors returned.
//When player purchases with RM, this is called four times. One for each Location purchased public void PurchaseBackground(string background){ if(background == Constants.LOCATION_2){ PlayFabController.Instance.UpdateLocation2UnlockedStatistic(); } if(background == Constants.LOCATION_3){ PlayFabController.Instance.UpdateLocation3UnlockedStatistic(); } if(background == Constants.LOCATION_4){ PlayFabController.Instance.UpdateLocation4UnlockedStatistic(); } if(background == Constants.LOCATION_5){ PlayFabController.Instance.UpdateLocation5UnlockedStatistic(); } } //In PlayFabController.cs - There are 4 of these methods, one for each location public void UpdateLocation2UnlockedStatistic(){ if(CheckInternet.Instance.isconnectedToInternet) { if(PlayFabClientAPI.IsClientLoggedIn()) { PlayFabClientAPI.UpdatePlayerStatistics(new UpdatePlayerStatisticsRequest { Statistics = new List<StatisticUpdate> { new StatisticUpdate { StatisticName = "Location2Unlocked", Value = 1 }, } }, result => { OnLocation2UnlockedSuccess(result); }, error => { OnLocation2UnlockedFail(error); }); } } }