private bool IsCanLook(HuoDongZhongXin activityInfo)
    {
        int num         = this.ToTimeStamp(DateTime.get_Now());
        int openTimeEnd = this.GetOpenTimeEnd(activityInfo);

        return(num <= openTimeEnd + activityInfo.delaytime * 60);
    }
Example #2
0
 public int GetActivityRemainTime()
 {
     if (ActivityCenterManager.Instance.CheckActivityIsOpen(10006))
     {
         HuoDongZhongXin activityCfgData = ActivityCenterManager.Instance.GetActivityCfgData(ActivityType.MultiPVP);
         if (activityCfgData != null)
         {
             DateTime preciseServerTime = TimeManager.Instance.PreciseServerTime;
             for (int i = 0; i < activityCfgData.starttime.get_Count(); i++)
             {
                 string[] array = activityCfgData.starttime.get_Item(i).Split(new char[]
                 {
                     ':'
                 });
                 int      num    = int.Parse((!array[0].StartsWith("0")) ? array[0] : array[0].Substring(1));
                 int      num2   = int.Parse((!array[1].StartsWith("0")) ? array[1] : array[1].Substring(1));
                 string[] array2 = activityCfgData.endtime.get_Item(i).Split(new char[]
                 {
                     ':'
                 });
                 int      num3      = int.Parse((!array2[0].StartsWith("0")) ? array2[0] : array2[0].Substring(1));
                 int      num4      = int.Parse((!array2[1].StartsWith("0")) ? array2[1] : array2[1].Substring(1));
                 DateTime dateTime  = new DateTime(preciseServerTime.get_Year(), preciseServerTime.get_Month(), preciseServerTime.get_Day(), num, num2, 0);
                 DateTime dateTime2 = new DateTime(preciseServerTime.get_Year(), preciseServerTime.get_Month(), preciseServerTime.get_Day(), num3, num4, 0);
                 if (dateTime <= preciseServerTime && preciseServerTime <= dateTime2)
                 {
                     return((int)(dateTime2 - preciseServerTime).get_TotalSeconds());
                 }
             }
         }
     }
     return(0);
 }
    private void SetOneActivity(Transform cell, int activityId)
    {
        Debug.LogError("SetOneActivity activityId=" + activityId);
        HuoDongZhongXin huoDongZhongXin = DataReader <HuoDongZhongXin> .Get(activityId);

        ResourceManager.SetTexture(cell.Find("imgIcon").GetComponent <RawImage>(), huoDongZhongXin.picture);
        cell.Find("imgIcon").GetComponent <RawImage>().SetNativeSize();
        Button component = cell.Find("imgIcon").GetComponent <Button>();

        component.get_onClick().RemoveAllListeners();
        component.get_onClick().AddListener(delegate
        {
            this.OnClickImgIcon(int.Parse(cell.get_name()));
        });
        ActiveCenterInfo activeCenterInfo = ActivityCenterManager.infoDict.get_Item(activityId);

        cell.Find("txtOpenTime").GetComponent <Text>().set_text(this.GetFormatOpenTime(huoDongZhongXin));
        string text = (activeCenterInfo.remainTimes != -1) ? activeCenterInfo.remainTimes.ToString() : "不限";

        cell.Find("txtRemainNum").GetComponent <Text>().set_text(text);
        cell.Find("txtPeopleNum").GetComponent <Text>().set_text(huoDongZhongXin.people.ToString());
        for (int i = 0; i < huoDongZhongXin.award.get_Count(); i++)
        {
            int icon = DataReader <Items> .Get(huoDongZhongXin.award.get_Item(i)).icon;

            Debug.LogError("itemIconId=" + icon);
            GameObject gameObject = ItemShow.ShowItem(cell, huoDongZhongXin.award.get_Item(i), -1L, false, null, 2001);
            gameObject.get_transform().set_localScale(new Vector3(0.8f, 0.8f, 0.8f));
            float num = this.itemIconPositionX[huoDongZhongXin.award.get_Count() - 1].get_Item(i);
            gameObject.get_transform().set_localPosition(new Vector3(num, -201f));
        }
        this.SetActivityWithState(cell, activityId, ActivityCenterManager.infoDict.get_Item(activityId).status);
    }
    public string GetActivityOpenTimeByActivityType(ActivityType type)
    {
        HuoDongZhongXin activityCfgData = this.GetActivityCfgData(type);

        if (activityCfgData == null)
        {
            return(string.Empty);
        }
        return(this.GetFormatOpenTime(activityCfgData, false, false, string.Empty));
    }
    private int GetTimeWeight(int activityId)
    {
        HuoDongZhongXin activityInfo = DataReader <HuoDongZhongXin> .Get(activityId);

        ActiveCenterInfo.ActiveStatus.AS status = ActivityCenterManager.infoDict.get_Item(activityId).status;
        if (status == ActiveCenterInfo.ActiveStatus.AS.Wait || status == ActiveCenterInfo.ActiveStatus.AS.NotOpen || status == ActiveCenterInfo.ActiveStatus.AS.Close)
        {
            return(this.GetOpenTimeStart(activityInfo));
        }
        return(-1);
    }
    private int GetOpenTimeSection(HuoDongZhongXin activityInfo)
    {
        int num = this.ToTimeStamp(DateTime.get_Now());

        for (int i = 0; i < activityInfo.starttime.get_Count(); i++)
        {
            if (num <= this.GetTimeStamp(activityInfo.starttime.get_Item(i)) || num <= this.GetTimeStamp(activityInfo.endtime.get_Item(i)))
            {
                return(i);
            }
        }
        return(Math.Max(0, activityInfo.starttime.get_Count() - 1));
    }
Example #7
0
    private void UpdateMultiPVPActInfo()
    {
        HuoDongZhongXin activityCfgData = ActivityCenterManager.Instance.GetActivityCfgData(ActivityType.MultiPVP);

        if (activityCfgData != null)
        {
            this.lvLimitText.set_text(string.Format(GameDataUtils.GetChineseContent(503102, false), activityCfgData.minLv));
            string text = (activityCfgData.num > 0) ? (activityCfgData.num + string.Empty) : "无限制";
            this.joinTimesText.set_text(string.Format(GameDataUtils.GetChineseContent(503103, false), text));
            this.openTimeText.set_text(MultiPVPManager.Instance.GetMultiPvpOpenTimeText(0));
            this.openTime2Text.set_text(MultiPVPManager.Instance.GetMultiPvpOpenTimeText(1));
            this.UpdateActivityRewardList(activityCfgData.award);
            int activityRemainTime = MultiPVPManager.Instance.GetActivityRemainTime();
            this.SetRemainTimeCD(activityRemainTime);
        }
    }
Example #8
0
    public void NotificationActivity(int pushId)
    {
        if (!this.IsLocalPushOn(pushId))
        {
            return;
        }
        if (!this.IsSystemOn(pushId))
        {
            return;
        }
        TuiSongTongZhi tuiSongTongZhi = DataReader <TuiSongTongZhi> .Get(pushId);

        if (tuiSongTongZhi != null && tuiSongTongZhi.activityid > 0)
        {
            HuoDongZhongXin huoDongZhongXin = DataReader <HuoDongZhongXin> .Get(tuiSongTongZhi.activityid);

            if (huoDongZhongXin != null)
            {
                if (huoDongZhongXin.date.get_Count() == 7)
                {
                    int num = 0;
                    for (int i = 0; i < huoDongZhongXin.starttime.get_Count(); i++)
                    {
                        DateTime dateTime       = this.GetDateTime(0, huoDongZhongXin.starttime.get_Item(i));
                        int      notificationID = this.GetNotificationID(tuiSongTongZhi, num++);
                        NativeCallManager.NotificationMessage(notificationID, GameDataUtils.GetChineseContent(tuiSongTongZhi.detail, false), dateTime, NotificationRepeatInterval.Day);
                    }
                }
                else
                {
                    int num2 = 0;
                    for (int j = 0; j < huoDongZhongXin.date.get_Count(); j++)
                    {
                        for (int k = 0; k < huoDongZhongXin.starttime.get_Count(); k++)
                        {
                            DateTime dateTime2       = this.GetDateTime(huoDongZhongXin.date.get_Item(j), huoDongZhongXin.starttime.get_Item(k));
                            int      notificationID2 = this.GetNotificationID(tuiSongTongZhi, num2++);
                            NativeCallManager.NotificationMessage(notificationID2, GameDataUtils.GetChineseContent(tuiSongTongZhi.detail, false), dateTime2, NotificationRepeatInterval.Week);
                        }
                    }
                }
            }
        }
    }
Example #9
0
    public string GetMultiPvpOpenTimeText(int index = 0)
    {
        HuoDongZhongXin activityCfgData = ActivityCenterManager.Instance.GetActivityCfgData(ActivityType.MultiPVP);

        if (activityCfgData != null)
        {
            DateTime preciseServerTime = TimeManager.Instance.PreciseServerTime;
            int      i = 0;
            while (i < activityCfgData.starttime.get_Count())
            {
                string[] array = activityCfgData.starttime.get_Item(i).Split(new char[]
                {
                    ':'
                });
                int      num    = int.Parse((!array[0].StartsWith("0")) ? array[0] : array[0].Substring(1));
                int      num2   = int.Parse((!array[1].StartsWith("0")) ? array[1] : array[1].Substring(1));
                string[] array2 = activityCfgData.endtime.get_Item(i).Split(new char[]
                {
                    ':'
                });
                int      num3      = int.Parse((!array2[0].StartsWith("0")) ? array2[0] : array2[0].Substring(1));
                int      num4      = int.Parse((!array2[1].StartsWith("0")) ? array2[1] : array2[1].Substring(1));
                DateTime dateTime  = new DateTime(preciseServerTime.get_Year(), preciseServerTime.get_Month(), preciseServerTime.get_Day(), num, num2, 0);
                DateTime dateTime2 = new DateTime(preciseServerTime.get_Year(), preciseServerTime.get_Month(), preciseServerTime.get_Day(), num3, num4, 0);
                if (index == i)
                {
                    if (ActivityCenterManager.Instance.CheckActivityIsOpen(10006) && dateTime <= preciseServerTime && preciseServerTime <= dateTime2)
                    {
                        string text = activityCfgData.starttime.get_Item(i) + "-" + activityCfgData.endtime.get_Item(i) + "(进行中)";
                        return(TextColorMgr.GetColor(text, "fffae6", string.Empty));
                    }
                    string text2 = activityCfgData.starttime.get_Item(i) + "-" + activityCfgData.endtime.get_Item(i) + "(未开始)";
                    return(TextColorMgr.GetColor(text2, "4d2a1a", string.Empty));
                }
                else
                {
                    i++;
                }
            }
        }
        return(string.Empty);
    }
    private void OnClickImgIcon(int activityId)
    {
        Debug.LogError("OnClickImgIcon activityId=" + activityId);
        HuoDongZhongXin huoDongZhongXin = DataReader <HuoDongZhongXin> .Get(activityId);

        if (huoDongZhongXin == null)
        {
            return;
        }
        if (huoDongZhongXin.minLv > EntityWorld.Instance.EntSelf.Lv)
        {
            string text = string.Format(GameDataUtils.GetChineseContent(513512, false), huoDongZhongXin.minLv);
            UIManagerControl.Instance.ShowToastText(text);
            return;
        }
        if (ActivityCenterManager.infoDict.get_Item(activityId).status == ActiveCenterInfo.ActiveStatus.AS.Close)
        {
            if (!this.IsCanLook(huoDongZhongXin))
            {
                UIManagerControl.Instance.ShowToastText(GameDataUtils.GetChineseContent(513538, false), 2f, 2f);
                return;
            }
        }
        else if (ActivityCenterManager.infoDict.get_Item(activityId).status != ActiveCenterInfo.ActiveStatus.AS.Start)
        {
            UIManagerControl.Instance.ShowToastText(GameDataUtils.GetChineseContent(513526, false), 2f, 2f);
            return;
        }
        if (activityId == 10001)
        {
            InstanceManagerUI.OpenGangFightUI();
        }
        else if (activityId == 10002)
        {
            MultiPlayerManager.Instance.OpenMultiPlayerUI(10002, "多人活动");
        }
    }
    private void SetActivityWithState(Transform cell, int activityId, ActiveCenterInfo.ActiveStatus.AS activityState)
    {
        this.Reset(cell);
        HuoDongZhongXin huoDongZhongXin = DataReader <HuoDongZhongXin> .Get(activityId);

        if (activityState == ActiveCenterInfo.ActiveStatus.AS.NotOpen)
        {
            cell.Find("imgLock").get_gameObject().SetActive(true);
            cell.Find("imgLock").Find("txtRequireLv").GetComponent <Text>().set_text(huoDongZhongXin.minLv + "级开启");
        }
        else if (activityState == ActiveCenterInfo.ActiveStatus.AS.Wait || activityState == ActiveCenterInfo.ActiveStatus.AS.PrepareOpen)
        {
            cell.Find("txtOprate").GetComponent <Text>().set_text("时间未到");
        }
        else if (activityState == ActiveCenterInfo.ActiveStatus.AS.Start)
        {
            cell.Find("txtOprate").GetComponent <Text>().set_text("点击参加");
            cell.Find("txtOprate").GetComponent <Text>().set_color(Color.get_green());
        }
        else if (activityState == ActiveCenterInfo.ActiveStatus.AS.Close)
        {
            cell.Find("txtOprate").GetComponent <Text>().set_text("已经结束");
        }
    }
Example #12
0
    public void SettingUI(int id, string arg)
    {
        if (id == 10002)
        {
            string value = DataReader <MultiCopy> .Get("Background").value;

            string     activityOpenTimeByActivityType = ActivityCenterManager.Instance.GetActivityOpenTimeByActivityType(ActivityType.MultiPeople);
            List <int> list    = new List <int>();
            List <int> itemIds = DataReader <TongGuanDiaoLuo> .DataList.get_Item(0).ItemIds;

            if (itemIds != null)
            {
                list.AddRange(itemIds);
            }
            int             descID          = (int)float.Parse(DataReader <MultiCopy> .Get("introduction").value);
            int             challegeCount   = 3;
            HuoDongZhongXin activityCfgData = ActivityCenterManager.Instance.GetActivityCfgData(ActivityType.MultiPeople);
            if (activityCfgData != null)
            {
                challegeCount = activityCfgData.num;
            }
            this.SetActivityInfo(value, activityOpenTimeByActivityType, descID, challegeCount, list, null);
        }
    }
Example #13
0
    private void SetTimeData(MeiRiMuBiao dailyData)
    {
        this.SetDailyData(dailyData);
        this.mTxLiveness.get_gameObject().SetActive(false);
        this.mGoGoto.SetActive(false);
        this.GuildWarOpen = false;
        int id = dailyData.id;

        if (id != 12030)
        {
            if (id != 12050)
            {
                this.CurrentLimit = this.GetActiveIdByDailyId(dailyData.id);
                HuoDongZhongXin huoDongZhongXin = DataReader <HuoDongZhongXin> .Get(this.CurrentLimit);

                if (huoDongZhongXin != null)
                {
                    this.mTxDesc.set_text(GameDataUtils.GetChineseContent(513518, false) + " " + ActivityCenterManager.Instance.GetFormatOpenTime(huoDongZhongXin, true, true, "\n"));
                }
                if (!this.mTxLvTips.get_transform().get_parent().get_gameObject().get_activeSelf())
                {
                    ActiveCenterInfo activeCenterInfo = null;
                    if (this.CurrentLimit > 0 && ActivityCenterManager.infoDict.TryGetValue(this.CurrentLimit, ref activeCenterInfo) && activeCenterInfo.status == ActiveCenterInfo.ActiveStatus.AS.Start)
                    {
                        this.ShowGotoButton();
                    }
                }
            }
            else if (!GuildManager.Instance.IsJoinInGuild())
            {
                this.mTxLvTips.get_transform().get_parent().get_gameObject().SetActive(true);
                this.mTxLvTips.set_text(GameDataUtils.GetChineseContent(301049, false));
            }
            else if (!this.mTxLvTips.get_transform().get_parent().get_gameObject().get_activeSelf())
            {
                string[] guildWarOpenTime;
                if (GuildWarManager.Instance.GuildWarTimeStep >= GuildWarTimeStep.GWTS.HALF_MATCH2_END && GuildWarManager.Instance.GuildWarTimeStep < GuildWarTimeStep.GWTS.FINAL_MATCH_END)
                {
                    guildWarOpenTime = GuildWarManager.Instance.GetGuildWarOpenTime(4);
                }
                else if (GuildWarManager.Instance.GuildWarTimeStep >= GuildWarTimeStep.GWTS.HALF_MATCH1_END && GuildWarManager.Instance.GuildWarTimeStep < GuildWarTimeStep.GWTS.HALF_MATCH2_END)
                {
                    guildWarOpenTime = GuildWarManager.Instance.GetGuildWarOpenTime(3);
                }
                else
                {
                    guildWarOpenTime = GuildWarManager.Instance.GetGuildWarOpenTime(2);
                }
                this.mTxDesc.set_text(string.Concat(new string[]
                {
                    GameDataUtils.GetChineseContent(513518, false),
                    " ",
                    GameDataUtils.GetChineseContent(513518 + int.Parse(guildWarOpenTime[0]), false),
                    "\n",
                    guildWarOpenTime[1],
                    "-",
                    guildWarOpenTime[3]
                }));
                if (GuildWarManager.Instance.GuildWarTimeStep == GuildWarTimeStep.GWTS.HALF_MATCH2_BEG || GuildWarManager.Instance.GuildWarTimeStep == GuildWarTimeStep.GWTS.FINAL_MATCH_BEG || GuildWarManager.Instance.GuildWarTimeStep == GuildWarTimeStep.GWTS.HALF_MATCH1_BEG)
                {
                    this.GuildWarOpen = true;
                    this.ShowGotoButton();
                }
            }
        }
        else if (!GuildManager.Instance.IsJoinInGuild())
        {
            this.mTxLvTips.get_transform().get_parent().get_gameObject().SetActive(true);
            this.mTxLvTips.set_text(GameDataUtils.GetChineseContent(301049, false));
        }
        else if (!this.mTxLvTips.get_transform().get_parent().get_gameObject().get_activeSelf())
        {
            string[] array = DataReader <GongHuiXinXi> .Get("ExpTime").value.Split(new char[]
            {
                ','
            });

            if (array != null && array.Length == 2)
            {
                this.mTxDesc.set_text(string.Concat(new string[]
                {
                    GameDataUtils.GetChineseContent(513518, false),
                    " 每天\n",
                    array[0],
                    "-",
                    array[1]
                }));
                if (GuildManager.Instance.IsGuildFieldOpen)
                {
                    this.ShowGotoButton();
                }
            }
        }
    }
    public string GetFormatOpenTime(HuoDongZhongXin activityInfo, bool showAll = false, bool showWeek = false, string weekdayGap = "")
    {
        string text = string.Empty;

        if (activityInfo.activityid == 10005)
        {
            return(GuildWarManager.Instance.GetGuildWarCurrentShowTime());
        }
        if (activityInfo.activityid == 10004)
        {
            return(string.Empty + GuildManager.Instance.GetGuildFieldOpenTime());
        }
        if (showWeek)
        {
            if (activityInfo.date.get_Count() >= 7)
            {
                text = "每天";
            }
            else
            {
                text = GameDataUtils.GetChineseContent(513518 + activityInfo.date.get_Item(0), false) + "至" + GameDataUtils.GetChineseContent(513518 + activityInfo.date.get_Item(activityInfo.date.get_Count() - 1), false);
            }
        }
        if (showAll)
        {
            string text2 = string.Empty;
            for (int i = 0; i < activityInfo.starttime.get_Count(); i++)
            {
                if (text2 == string.Empty)
                {
                    text2 = text2 + activityInfo.starttime.get_Item(i) + "-" + activityInfo.endtime.get_Item(i);
                }
                else
                {
                    string text3 = text2;
                    text2 = string.Concat(new string[]
                    {
                        text3,
                        "、",
                        activityInfo.starttime.get_Item(i),
                        "-",
                        activityInfo.endtime.get_Item(i)
                    });
                }
            }
            return(text + weekdayGap + text2);
        }
        DateTime preciseServerTime = TimeManager.Instance.PreciseServerTime;

        for (int j = activityInfo.starttime.get_Count() - 1; j >= 0; j--)
        {
            string[] array = activityInfo.starttime.get_Item(j).Split(new char[]
            {
                ':'
            });
            int      num    = int.Parse((!array[0].StartsWith("0")) ? array[0] : array[0].Substring(1));
            int      num2   = int.Parse((!array[1].StartsWith("0")) ? array[1] : array[1].Substring(1));
            string[] array2 = activityInfo.endtime.get_Item(j).Split(new char[]
            {
                ':'
            });
            int      num3      = int.Parse((!array2[0].StartsWith("0")) ? array2[0] : array2[0].Substring(1));
            int      num4      = int.Parse((!array2[1].StartsWith("0")) ? array2[1] : array2[1].Substring(1));
            DateTime dateTime  = new DateTime(preciseServerTime.get_Year(), preciseServerTime.get_Month(), preciseServerTime.get_Day(), num, num2, 0);
            DateTime dateTime2 = new DateTime(preciseServerTime.get_Year(), preciseServerTime.get_Month(), preciseServerTime.get_Day(), num3, num4, 0);
            if (ActivityCenterManager.Instance.CheckActivityIsOpen(activityInfo.activityid) && dateTime <= preciseServerTime && preciseServerTime <= dateTime2)
            {
                return(string.Concat(new string[]
                {
                    text,
                    weekdayGap,
                    activityInfo.starttime.get_Item(j),
                    "-",
                    activityInfo.endtime.get_Item(j)
                }));
            }
        }
        return(string.Concat(new string[]
        {
            text,
            weekdayGap,
            activityInfo.starttime.get_Item(0),
            "-",
            activityInfo.endtime.get_Item(0)
        }));
    }
    public void OpenCurrentActivityUI(int activityID)
    {
        if (!this.CurrentACInfoDic.ContainsKey(activityID) || this.CurrentACInfoDic.get_Item(activityID).status != ActiveCenterInfo.ActiveStatus.AS.Start)
        {
            UIManagerControl.Instance.ShowToastText(GameDataUtils.GetChineseContent(513526, false), 2f, 2f);
            return;
        }
        if (!DataReader <HuoDongZhongXin> .Contains(activityID))
        {
            return;
        }
        HuoDongZhongXin huoDongZhongXin = DataReader <HuoDongZhongXin> .Get(activityID);

        if (huoDongZhongXin == null)
        {
            return;
        }
        if (activityID == 10004 || activityID == 10005)
        {
            if (!GuildManager.Instance.IsJoinInGuild())
            {
                UIManagerControl.Instance.ShowToastText(GameDataUtils.GetChineseContent(34157, false));
                return;
            }
            if (activityID == 10004)
            {
                GuildActivityCenterUI guildActivityCenterUI = UIManagerControl.Instance.OpenUI("GuildActivityCenterUI", UINodesManager.MiddleUIRoot, false, UIType.NonPush) as GuildActivityCenterUI;
                guildActivityCenterUI.get_transform().SetAsLastSibling();
            }
            else if (activityID == 10005)
            {
                GuildWarVSInfoUI guildWarVSInfoUI = UIManagerControl.Instance.OpenUI("GuildWarVSInfoUI", UINodesManager.MiddleUIRoot, false, UIType.NonPush) as GuildWarVSInfoUI;
                guildWarVSInfoUI.get_transform().SetAsLastSibling();
            }
            return;
        }
        else
        {
            if (huoDongZhongXin.minLv > EntityWorld.Instance.EntSelf.Lv)
            {
                string text = string.Format(GameDataUtils.GetChineseContent(513512, false), huoDongZhongXin.minLv);
                UIManagerControl.Instance.ShowToastText(text);
                return;
            }
            if (activityID == 10001)
            {
                InstanceManagerUI.OpenGangFightUI();
            }
            else if (activityID == 10002)
            {
                MultiPlayerManager.Instance.OpenMultiPlayerUI(10002, "多人活动");
            }
            else if (activityID == 10003)
            {
                LinkNavigationManager.OpenMushroomHitUI();
            }
            else if (activityID == 10006)
            {
                LinkNavigationManager.OpenMultiPVPUI();
            }
            else if (activityID == 10007)
            {
                LinkNavigationManager.SystemLink(55, true, null);
            }
            return;
        }
    }
    private int GetOpenTimeEnd(HuoDongZhongXin activityInfo)
    {
        int openTimeSection = this.GetOpenTimeSection(activityInfo);

        return(this.GetTimeStamp(activityInfo.endtime.get_Item(openTimeSection)));
    }
    private string GetFormatOpenTime(HuoDongZhongXin activityInfo)
    {
        int openTimeSection = this.GetOpenTimeSection(activityInfo);

        return(activityInfo.starttime.get_Item(openTimeSection) + "-" + activityInfo.endtime.get_Item(openTimeSection));
    }