Exemplo n.º 1
0
    /** 是否有效 */
    public override bool isValid()
    {
        NoticeSample             noticeSample  = getSample();
        EquipRemakeNoticeContent noticeContent = noticeSample.content as EquipRemakeNoticeContent;

        if (noticeContent != null)
        {
            User user = UserManager.Instance.self;
            if (user.getVipLevel() < noticeContent.getShowVipLevel() || user.getUserLevel() < noticeContent.getShowUserLevel())
            {
                return(false);
            }
        }
        activeTime = ActiveTime.getActiveTimeByID(getSample().timeID);
        if (activeTime.getIsFinish())
        {
            return(false);
        }
        object obj = NoticeActiveManagerment.Instance.getActiveInfoBySid(sid);

        if (obj is DoubleRMBInfo)
        {
            DoubleRMBInfo doubleRMBInfo = obj as DoubleRMBInfo;
            if (doubleRMBInfo != null && doubleRMBInfo.state)
            {
                return(false);
            }
        }
        return(ServerTimeKit.getSecondTime() >= activeTime.getPreShowTime());
    }
Exemplo n.º 2
0
 public void initContent(NoticeWindow win, Notice notice)
 {
     mFatherWindow = win;
     this.notice   = notice as DoubleRMBNotice;
     activeTime    = ActiveTime.getActiveTimeByID(notice.sid);
     NoticeSample sample = notice.getSample();
 }
    //显示样本
    public List <Exchange> getExchangeList(NoticeActiveAndSid[] actives)
    {
        List <Exchange>        list = new List <Exchange>();
        NoticeActiveServerInfo serverInfo;
        NewExchange            exchange;
        ActiveTime             activeTime;
        List <int>             closeSidList = NoticeManagerment.Instance.CloseNoticeSidList;
        int now = ServerTimeKit.getSecondTime();

        foreach (NoticeActiveAndSid active in actives)
        {
            activeTime = ActiveTime.getActiveTimeByID(active.activeID);
            if (activeTime.getIsFinish() || activeTime.getPreShowTime() > now || now > activeTime.getEndTime())
            {
                continue;
            }
            serverInfo = activeInfo.get(active.activeID) as NoticeActiveServerInfo;
            foreach (int sid in active.exchangeSids)
            {
                if (closeSidList.Contains(sid))
                {
                    continue;
                }
                exchange = serverInfo.goodsList.get(sid) as NewExchange;
                if (exchange == null)
                {
                    exchange        = new NewExchange(sid, 0);
                    exchange.timeID = active.activeID;
                    serverInfo.goodsList.put(sid, exchange);
                }
                list.Add(exchange);
            }
        }
        return(list);
    }
 /// <summary>
 /// 设置活动开启时间
 /// </summary>
 public void setNoticeOpenTime()
 {
     this.openTimeNoticeText  = LanguageConfigManager.Instance.getLanguage("LuckyCardContent_timeOpen");
     this.closeTimeNoticeText = LanguageConfigManager.Instance.getLanguage("superDraw_14");
     activeTime      = ActiveTime.getActiveTimeByID(this.notice.getSample().timeID);
     noticeOpenTime  = activeTime.getDetailStartTime();
     noticeCloseTime = activeTime.getDetailEndTime();
 }
Exemplo n.º 5
0
 /** 是否有效 */
 public override bool isValid()
 {
     activeTime = ActiveTime.getActiveTimeByID(getSample().timeID);
     if (activeTime.getIsFinish())
     {
         return(false);
     }
     return(ServerTimeKit.getSecondTime() >= activeTime.getPreShowTime());
 }
    private void startTimer()  //开始计时
    {
        timer = TimerManager.Instance.getTimer(UserManager.TIMER_DELAY);
        NoticeSample sample = NoticeSampleManager.Instance.getNoticeSampleBySid(notice.sid);

        activeTime = ActiveTime.getActiveTimeByID(sample.timeID);
        timer.addOnTimer(updateNoticeWindow);
        timer.start();
    }
Exemplo n.º 7
0
    /// <summary>
    /// 开启计时器
    /// </summary>
    private void startTimer()
    {
        if (timer1 == null)
        {
            timer1 = TimerManager.Instance.getTimer(UserManager.TIMER_DELAY);
        }
        NoticeSample sample = NoticeSampleManager.Instance.getNoticeSampleBySid(notice.sid);

        activeTime1 = ActiveTime.getActiveTimeByID(sample.timeID);
        timer1.addOnTimer(updateNotice);
        timer1.start();
    }
Exemplo n.º 8
0
 public ActiveTime getActiveTime()
 {
     if (activeTime == null)
     {
         activeTime = ActiveTime.getActiveTimeByID(getSample().timeID);
     }
     else
     {
         activeTime.doRefresh();
     }
     return(activeTime);
 }
Exemplo n.º 9
0
 public override bool isValid()
 {
     activeTime = ActiveTime.getActiveTimeByID(getSample().timeID);
     if (activeTime.getIsFinish())
     {
         return(false);
     }
     if (UserManager.Instance.self.getUserLevel() < getSample().levelLimit)
     {
         return(false);
     }
     return(ServerTimeKit.getSecondTime() >= activeTime.getPreShowTime());
 }
Exemplo n.º 10
0
 /// <summary>
 /// 是否有效,请先初始化奖品数据
 /// </summary>
 public bool isValid()
 {
     if (timeID == -1)
     {
         return(false);
     }
     activeTime = ActiveTime.getActiveTimeByID(timeID);
     if (activeTime.getIsFinish())
     {
         return(false);
     }
     return(ServerTimeKit.getSecondTime() >= activeTime.getPreShowTime());
 }
    public void initContent(Notice notice, WindowBase win)
    {
        this.notice              = notice as LimitCollectNotice;
        this.win                 = win;
        this.openTimeNoticeText  = LanguageConfigManager.Instance.getLanguage("LuckyCardContent_timeOpen");
        this.closeTimeNoticeText = LanguageConfigManager.Instance.getLanguage("LuckyCardContent_timeOver");
        datas = new List <LimitCollectSample>();
        NoticeSample sample = NoticeSampleManager.Instance.getNoticeSampleBySid(notice.sid);

        sids       = (sample.content as SidNoticeContent).sids;
        activeTime = ActiveTime.getActiveTimeByID(this.notice.getSample().timeID);
        setNoticeOpenTime();
        updateData(sids);
    }
Exemplo n.º 12
0
    public override string ToString()
    {
        string     timeInfo   = "";
        ActiveTime activeTime = ActiveTime.getActiveTimeByID(getSample().timeID);

        if (activeTime != null)
        {
            timeInfo = activeTime.ToString();
            Log.info("下次开始" + TimeKit.getDateTime(activeTime.getDetailStartTime()).ToString("yyyy-MM-dd HH:mm:ss"));
        }
        else
        {
            timeInfo = "永久";
        }
        return(base.ToString() + "\t" + getSample().sid + "\t" + getSample().name + "\t" + getSample().activiteDesc + "\t" + timeInfo + "\t" + getSample().content);
    }
Exemplo n.º 13
0
    public override bool isValid()
    {
        //TODO   取时间
//		activeTime = ActiveTime.getActiveTimeByID (getSample ().timeID);
        //这里用兑换商店的持续时间来确定活动的开启
        int[] sids = (getSample().content as SidNoticeContent).sids;        //获取商店的时间sid
        activeTime = ActiveTime.getActiveTimeByID(sids[0]);
        if (activeTime.getIsFinish())
        {
            return(false);
        }
        if (UserManager.Instance.self.getUserLevel() < getSample().levelLimit)
        {
            return(false);
        }
        return(ServerTimeKit.getSecondTime() >= activeTime.getPreShowTime());
    }
Exemplo n.º 14
0
    public override bool isValid()
    {
        NoticeSample sample = NoticeSampleManager.Instance.getNoticeSampleBySid(sid);

        activeTime = ActiveTime.getActiveTimeByID(sample.timeID);
        if (activeTime.getIsFinish())
        {
            return(false);
        }
        if (activeTime.getEndTime() == 0)
        {
            return(true);
        }
        int now = ServerTimeKit.getSecondTime();

        return(now >= activeTime.getStartTime() && now <= activeTime.getDetailEndTime() && hasInfo());
    }
Exemplo n.º 15
0
    public void setNoticeSetting()
    {
        if (notice.isTimeLimit())       //如果是限时活动
        {
            xs_textureTitle.gameObject.SetActive(true);

            this.openTimeNoticeText  = LanguageConfigManager.Instance.getLanguage("LuckyCardContent_timeOpen");
            this.closeTimeNoticeText = LanguageConfigManager.Instance.getLanguage("LuckyCardContent_timeOver");
            activeTime = ActiveTime.getActiveTimeByID(this.notice.getSample().timeID);
            setNoticeOpenTime();
            refreshNoticeTime();
            startTimer1();
        }
        else
        {
            textureTitle.gameObject.SetActive(true);
        }
    }
    /// <summary>
    /// 刷新活动时间
    /// </summary>
    private void refreshNoticeTime()
    {
        long remainTime = noticeOpenTime - ServerTimeKit.getSecondTime();

        if (remainTime <= 0)
        {
            long remainCloseTime = noticeCloseTime - ServerTimeKit.getSecondTime();
            if (remainCloseTime >= 0)
            {
                timeLabel.text = closeTimeNoticeText.Replace("%1", TimeKit.timeTransformDHMS(remainCloseTime));
            }
            else
            {
                //抽奖时间结束,进入只有兑换的阶段
                timeLabel.gameObject.SetActive(true);
                this.closeTimeNoticeText = LanguageConfigManager.Instance.getLanguage("superDraw_15");
                int[] sids = (notice.getSample().content as SidNoticeContent).sids;                //获取商店的时间sid
                activeTime = ActiveTime.getActiveTimeByID(sids[0]);
                int  shopCloseTime       = activeTime.getDetailEndTime();
                long remainShopClosetime = shopCloseTime - ServerTimeKit.getSecondTime();                //获取兑换商店剩余持续时间
                timeLabel.text = closeTimeNoticeText.Replace("%1", TimeKit.timeTransformDHMS(remainShopClosetime));

                endBottom.gameObject.SetActive(false);
                endTip.gameObject.SetActive(true);
                drawButton.disableButton(true);
                rechargeButton.gameObject.SetActive(false);

                if (remainShopClosetime <= 0)
                {
                    timeLabel.gameObject.SetActive(false);
                    timer1.stop();
                    timer1 = null;
                }
            }
        }
        //还没开启
        else
        {
            timeLabel.gameObject.SetActive(true);
            timeLabel.text = openTimeNoticeText.Replace("%1", TimeKit.timeTransformDHMS(remainTime));
        }
    }
Exemplo n.º 17
0
    private void onReceiveInit()
    {
        System.Collections.Hashtable table = HappySundaySampleManager.Instance.samples;
        System.DateTime date      = TimeKit.getDateTime(ServerTimeKit.getSecondTime());
        int             onlineDay = (ServerTimeKit.getSecondTime() - ServerTimeKit.onlineTime) / 3600 / 24;

        foreach (System.Collections.DictionaryEntry item in table)
        {
            HappySundaySample sample     = item.Value as HappySundaySample;
            ActiveTime        activeTime = ActiveTime.getActiveTimeByID(sample.timeID);
            if (sample.OnlineDay > onlineDay || activeTime.getIsFinish())
            {
                continue;
            }
            HappySundayContentItem target = Instantiate(UI_ItemTemplate) as HappySundayContentItem;
            target.transform.parent     = UI_ItemContainer;
            target.transform.localScale = Vector3.one;
            target.SetData(sample, mFatherWindow);
        }
        UI_ItemContainer.GetComponent <UIGrid>().Reposition();
    }
Exemplo n.º 18
0
    public List <Recharge> getRechargeList(int[] sids)
    {
        List <Recharge> list = new List <Recharge>();
        ActiveTime      activeTime;
        int             now          = ServerTimeKit.getSecondTime();
        List <int>      closeSidList = NoticeManagerment.Instance.CloseNoticeSidList;

        foreach (int sid in sids)
        {
            activeTime = ActiveTime.getActiveTimeByID(sid);
            if (activeTime == null)
            {
                continue;
            }
            if (activeTime.getIsFinish() || activeTime.getPreShowTime() > now || (now > activeTime.getEndTime() && activeTime.getEndTime() > 0) || closeSidList.Contains(sid))
            {
                continue;
            }
            list.Add(activeInfo.get(sid) as Recharge);
        }
        return(list);
    }
Exemplo n.º 19
0
    public override bool isValid()
    {
        //bool isShow = false;
        //       System.Collections.Hashtable table = HappySundaySampleManager.Instance.samples;
//        System.DateTime date = TimeKit.getDateTime(ServerTimeKit.getSecondTime());
//        foreach (System.Collections.DictionaryEntry item in table)
//        {
//            HappySundaySample sample = item.Value as HappySundaySample;
//            if (sample.Week == (int)date.DayOfWeek)
//            {
//                isShow = true;
//                break;
//            }
//        }
        //if (!isShow) return false;
        //TODO   取时间
        activeTime = ActiveTime.getActiveTimeByID(getSample().timeID);
        if (activeTime.getIsFinish())
        {
            return(false);
        }
        if (UserManager.Instance.self.getUserLevel() < getSample().levelLimit)
        {
            return(false);
        }
        return(ServerTimeKit.getSecondTime() >= activeTime.getPreShowTime());

        if (activeTime.getStartTime() > ServerTimeKit.getSecondTime())
        {
            return(false);
        }
        int onlineDay = (ServerTimeKit.getSecondTime() - ServerTimeKit.onlineTime) / 3600 / 24;

        if (HappySundaySampleManager.Instance.getDataBySid(1).OnlineDay > onlineDay)
        {
            return(false);
        }
        return(true);
    }
Exemplo n.º 20
0
    public bool IsCanShow(int activeID)
    {
        DoubleRMBInfo info = NoticeActiveManagerment.Instance.getActiveInfoBySid(activeID) as DoubleRMBInfo;
        //if (info.state)
        //return false;
        ActiveTime activeTime = ActiveTime.getActiveTimeByID(NoticeSampleManager.Instance.getNoticeSampleBySid(activeID).timeID);

        int now = ServerTimeKit.getSecondTime();

        if (now > activeTime.getPreShowTime() && now < activeTime.getStartTime() && activeTime.getStartTime() != -1)
        {
            return(true);
        }
        if (activeTime.getIsFinish())
        {
            return(false);
        }
        if (now < activeTime.getPreShowTime() || (now > activeTime.getEndTime() && activeTime.getEndTime() != -1))
        {
            return(false);
        }
        return(true);
    }
Exemplo n.º 21
0
 /// <summary>
 /// 设置活动开启时间
 /// </summary>
 public void setNoticeOpenTime()
 {
     activeTime      = ActiveTime.getActiveTimeByID(this.notice.getSample().timeID);
     noticeOpenTime  = activeTime.getDetailStartTime();
     noticeCloseTime = activeTime.getDetailEndTime();
 }