public void GrantTargetedBundleRewards(TargetedBundleVO offerVO) { IDataController dataController = Service.Get <IDataController>(); int i = 0; int count = offerVO.RewardUIDs.Count; while (i < count) { RewardVO optional = dataController.GetOptional <RewardVO>(offerVO.RewardUIDs[i]); if (optional == null) { Service.Get <StaRTSLogger>().WarnFormat("Trying to grant {0} which cannot be found.", new object[] { offerVO.RewardUIDs[i] }); } else { bool flag = true; if (optional.CurrencyRewards != null) { Dictionary <string, int> dictionary = GameUtils.ListToMap(optional.CurrencyRewards); int num = 0; dictionary.TryGetValue("crystals", out num); if (num > 0) { flag = false; } } else if (!string.IsNullOrEmpty(optional.DroidRewards)) { flag = false; } else if (optional.BuildingInstantRewards != null || optional.BuildingInstantUpgrades != null || optional.HeroResearchInstantUpgrades != null || optional.TroopResearchInstantUpgrades != null || optional.SpecAttackResearchInstantUpgrades != null) { flag = false; } if (flag) { RewardUtils.GrantInAppPurchaseRewardToHQInventory(optional); } else { RewardUtils.GrantReward(Service.Get <CurrentPlayer>(), optional); } } i++; } }
public unsafe static long $Invoke3(long instance, long *args) { RewardUtils.GrantInAppPurchaseRewardToHQInventory((RewardVO)GCHandledObjects.GCHandleToObject(*args)); return(-1L); }