private bool IsDuplicateFeaturedItem(CommandCenterVO vo) { int count = this.FeaturedItems.Count; for (int i = 0; i < count; i++) { if (this.FeaturedItems[i].Uid == vo.Uid) { return(true); } } return(false); }
public bool HasNewPromoEntry() { int i = 0; int count = this.FeaturedItems.Count; while (i < count) { CommandCenterVO commandCenterVO = this.FeaturedItems[i]; if (commandCenterVO.IsPromo && commandCenterVO.StartTime > this.lastTimeCCViewed) { return(true); } i++; } return(false); }
private void OnSuccess(HolonetGetCommandCenterEntriesResponse response, object cookie) { int num = 0; int num2 = (int)cookie; int serverTime = (int)Service.Get <ServerAPI>().ServerTime; int i = 0; int count = response.CCVOs.Count; while (i < count) { CommandCenterVO commandCenterVO = response.CCVOs[i]; if (!this.IsDuplicateFeaturedItem(commandCenterVO)) { if (commandCenterVO.StartTime <= serverTime && serverTime < commandCenterVO.EndTime && AudienceConditionUtils.IsValidForClient(commandCenterVO.AudienceConditions)) { this.FeaturedItems.Add(commandCenterVO); if (commandCenterVO.StartTime > num2) { num++; } } } else { Service.Get <StaRTSLogger>().Error("Duplicate entry in commander center featured items repsonse: " + commandCenterVO.Uid); } i++; } HolonetController holonetController = Service.Get <HolonetController>(); this.FeaturedItems.Sort(new Comparison <CommandCenterVO>(this.ComparePriority)); InventoryCrates crates = Service.Get <CurrentPlayer>().Prizes.Crates; CrateData dailyCrateIfAvailable = crates.GetDailyCrateIfAvailable(); if (dailyCrateIfAvailable != null && (ulong)dailyCrateIfAvailable.ReceivedTimeStamp > (ulong)((long)num2)) { num++; } holonetController.ContentPrepared(this, num); }
private int ComparePriority(CommandCenterVO a, CommandCenterVO b) { return(a.Priority - b.Priority); }