Exemple #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());
    }
    /// <summary>
    /// 提升装备数据处理
    /// </summary>
    private void doRemakeEquip(ErlArray erlArray, int index)
    {
        string msgInfo = erlArray.Value [index++].getValueString();

        if (msgInfo == "ok")
        {
            int noticeSid = StringKit.toInt(erlArray.Value [index++].getValueString());
            NoticeActiveManagerment manager = NoticeActiveManagerment.Instance;
            DoubleRMBInfo           info    = manager.getActiveInfoBySid(noticeSid) as DoubleRMBInfo;
            if (info != null)
            {
                info.state = true;
            }
            else
            {
                manager.putActiveInfo(noticeSid, new DoubleRMBInfo(noticeSid, true));
            }
            if (callback != null)
            {
                callback();
                callback = null;
            }
        }
        else
        {
            MessageWindow.ShowAlert(msgInfo);
        }
    }
    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);
    }