private void GrantReward(int identifier) { RewardTag rewardTag = this.rewardTags[identifier]; RewardUtils.GrantReward(this.cp, rewardTag.Vo); this.rewardTags.Remove(identifier); if (rewardTag.GlobalSuccess != null) { rewardTag.GlobalSuccess(rewardTag.Cookie); } }
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 $Invoke8(long instance, long *args) { RewardUtils.GrantReward((CurrentPlayer)GCHandledObjects.GCHandleToObject(*args), (RewardVO)GCHandledObjects.GCHandleToObject(args[1]), *(double *)(args + 2)); return(-1L); }
public static void GrantReward(CurrentPlayer cp, RewardVO reward) { RewardUtils.GrantReward(cp, reward, 1.0); }