Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 public unsafe static long $Invoke0(long instance, long *args)
 {
     return(GCHandledObjects.ObjectToGCHandle(AudienceConditionUtils.IsValidForClient((List <AudienceCondition>)GCHandledObjects.GCHandleToObject(*args))));
 }