예제 #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());
    }
예제 #2
0
 /** 是否有效 */
 public override bool isValid()
 {
     activeTime = ActiveTime.getActiveTimeByID(getSample().timeID);
     if (activeTime.getIsFinish())
     {
         return(false);
     }
     return(ServerTimeKit.getSecondTime() >= activeTime.getPreShowTime());
 }
예제 #3
0
    public override bool isInTimeLimit()
    {
        activeTime = getActiveTime();
        if (activeTime.getIsFinish())
        {
            return(false);
        }
        int now = ServerTimeKit.getSecondTime();

        return(activeTime.getDetailStartTime() < now && now < activeTime.getDetailEndTime());
    }
예제 #4
0
    public override bool isValid()
    {
        //显示规则策划定
        activeTime = getActiveTime();
        if (activeTime.getIsFinish())
        {
            return(false);
        }
        int now = ServerTimeKit.getSecondTime();

        return(activeTime.getPreShowTime() < now && now < activeTime.getEndTime());
    }
예제 #5
0
 public override int[] getTimeLimit()
 {
     activeTime = getActiveTime();
     if (activeTime.getIsFinish())
     {
         return(null);
     }
     return(new int[] {
         activeTime.getDetailStartTime(),
         activeTime.getDetailEndTime()
     });
 }
예제 #6
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());
 }
예제 #7
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());
 }
예제 #8
0
    public override bool isValid()
    {
        TimeInfoSample tsample = TimeConfigManager.Instance.getTimeInfoSampleBySid(getSample().timeID);

        if (activeTime == null)
        {
            activeTime = ActiveTime.getActiveTimeByType(tsample);
            activeTime.initTime(ServerTimeKit.getSecondTime());
        }
        if (activeTime.getIsFinish())
        {
            return(false);
        }
        return(ServerTimeKit.getSecondTime() >= activeTime.getPreShowTime());
    }
예제 #9
0
    /// <summary>
    /// 获得时间描述
    /// </summary>
    public string getTimeDesc()
    {
        int        nowTime    = ServerTimeKit.getSecondTime();
        ExamSample examSample = QuizManagerment.Instance.getExamSampleBySid(this);

        if (examSample == null)
        {
            return(LanguageConfigManager.Instance.getLanguage("notice_quiz01"));            //活动已经结束
        }
        SidNoticeContent content = getSample().content as SidNoticeContent;
        TimeInfoSample   tsample = TimeConfigManager.Instance.getTimeInfoSampleBySid(getSample().timeID);

        if (activeTime == null)
        {
            activeTime = ActiveTime.getActiveTimeByType(tsample);
            activeTime.initTime(ServerTimeKit.getSecondTime());
        }
        else
        {
            activeTime.doRefresh();
        }
        //具体开始时间
        int detailStartTime = activeTime.getDetailStartTime();
        //具体结束时间
        int detailEndTime = activeTime.getDetailEndTime();

        if (detailStartTime < nowTime && detailEndTime > nowTime && examSample.getAwardType == 1)
        {
            return(LanguageConfigManager.Instance.getLanguage("notice09"));            //可以答题
        }
        else if (DateKit.isInSameDay(detailStartTime, nowTime) && detailStartTime > nowTime)
        {
            return(LanguageConfigManager.Instance.getLanguage("notice08", TimeKit.dateToFormat(detailStartTime, LanguageConfigManager.Instance.getLanguage("notice05"))));              //尚未开启
        }
        else if (activeTime.getIsFinish())
        {
            return(LanguageConfigManager.Instance.getLanguage("notice_quiz01"));            //活动已经结束
        }
        else if (detailEndTime < nowTime)
        {
            return(LanguageConfigManager.Instance.getLanguage("notice_quiz01"));            //活动已经结束
        }
        else
        {
            return(LanguageConfigManager.Instance.getLanguage("notice_quiz01"));            //活动已经结束
        }
    }
예제 #10
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());
    }
예제 #11
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());
    }
예제 #12
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();
    }
예제 #13
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);
    }
예제 #14
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);
    }