示例#1
0
        public bool Deserialize(JSON_LoginInfoParam json)
        {
            if (json == null)
            {
                return(false);
            }
            this.iname = json.iname;
            this.path  = json.path;
            this.scene = (LoginInfoParam.SelectScene)json.scene;
            DateTime result1 = DateTime.MinValue;
            DateTime result2 = DateTime.MaxValue;

            if (!string.IsNullOrEmpty(json.begin_at))
            {
                DateTime.TryParse(json.begin_at, out result1);
            }
            if (!string.IsNullOrEmpty(json.end_at))
            {
                DateTime.TryParse(json.end_at, out result2);
            }
            this.begin_at = TimeManager.FromDateTime(result1);
            this.end_at   = TimeManager.FromDateTime(result2);
            return(true);
        }
        private void RefreshData()
        {
            GameManager       instance       = MonoSingleton <GameManager> .Instance;
            PlayerData        player         = instance.Player;
            List <GameObject> gameObjectList = new List <GameObject>();
            int versusTowerKey = player.VersusTowerKey;
            VersusTowerParam versusTowerParam = instance.GetCurrentVersusTowerParam(-1);

            if (versusTowerParam != null)
            {
                int num = 0;
                while (num < (int)versusTowerParam.RankupNum)
                {
                    GameObject gameObject = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.template);
                    if (!UnityEngine.Object.op_Equality((UnityEngine.Object)gameObject, (UnityEngine.Object)null))
                    {
                        gameObject.SetActive(true);
                        if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.parent, (UnityEngine.Object)null))
                        {
                            gameObject.get_transform().SetParent(this.parent.get_transform(), false);
                        }
                        Transform child1 = gameObject.get_transform().FindChild("on");
                        Transform child2 = gameObject.get_transform().FindChild("off");
                        if (UnityEngine.Object.op_Inequality((UnityEngine.Object)child1, (UnityEngine.Object)null))
                        {
                            ((Component)child1).get_gameObject().SetActive(versusTowerKey > 0);
                        }
                        if (UnityEngine.Object.op_Inequality((UnityEngine.Object)child2, (UnityEngine.Object)null))
                        {
                            ((Component)child2).get_gameObject().SetActive(versusTowerKey <= 0);
                        }
                        gameObjectList.Add(gameObject);
                    }
                    ++num;
                    --versusTowerKey;
                }
                this.template.SetActive(false);
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.nowKey, (UnityEngine.Object)null))
                {
                    this.nowKey.set_text(GameUtility.HalfNum2FullNum(player.VersusTowerKey.ToString()));
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.maxKey, (UnityEngine.Object)null))
                {
                    this.maxKey.set_text(GameUtility.HalfNum2FullNum(versusTowerParam.RankupNum.ToString()));
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.floor, (UnityEngine.Object)null))
                {
                    this.floor.set_text(player.VersusTowerFloor.ToString());
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.winbonus, (UnityEngine.Object)null))
                {
                    this.winbonus.SetActive(player.VersusTowerWinBonus > 1);
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.keyrateup, (UnityEngine.Object)null))
                {
                    this.keyrateup.SetActive(player.VersusTowerWinBonus > 0 && (int)versusTowerParam.RankupNum > 0);
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.bonusRate, (UnityEngine.Object)null) && player.VersusTowerWinBonus > 0 && (int)versusTowerParam.WinNum > 0)
                {
                    this.bonusRate.set_text((((int)versusTowerParam.WinNum + (int)versusTowerParam.BonusNum) / (int)versusTowerParam.WinNum).ToString());
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.winCnt, (UnityEngine.Object)null))
                {
                    this.winCnt.set_text(player.VersusTowerWinBonus.ToString());
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.endAt, (UnityEngine.Object)null))
                {
                    DateTime dateTime = TimeManager.FromUnixTime(instance.VersusTowerMatchEndAt);
                    this.endAt.set_text(string.Format(LocalizedText.Get("sys.MULTI_VERSUS_END_AT"), (object)dateTime.Year, (object)dateTime.Month, (object)dateTime.Day, (object)dateTime.Hour, (object)dateTime.Minute));
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.keyinfo, (UnityEngine.Object)null))
                {
                    this.keyinfo.SetActive((int)versusTowerParam.RankupNum != 0);
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.keyname, (UnityEngine.Object)null))
                {
                    this.keyname.SetActive((int)versusTowerParam.RankupNum != 0);
                }
                if (!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.lastfloor, (UnityEngine.Object)null))
                {
                    return;
                }
                this.lastfloor.SetActive((int)versusTowerParam.RankupNum == 0 && instance.VersusTowerMatchBegin);
            }
            else
            {
                if (!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.lastfloor, (UnityEngine.Object)null))
                {
                    return;
                }
                this.lastfloor.SetActive(false);
            }
        }
示例#3
0
        public override void OnSuccess(WWWResult www)
        {
            if (Network.IsError)
            {
                this.OnFailed();
            }
            else
            {
                WebAPI.JSON_BodyResponse <Json_PlayerDataAll> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <Json_PlayerDataAll> >(www.text);
                DebugUtility.Assert(jsonObject != null, "res == null");
                Network.RemoveAPI();
                if (jsonObject.body == null)
                {
                    ((Behaviour)this).set_enabled(false);
                    PlayerPrefs.SetInt("lastplv", 0);
                    PlayerPrefs.SetInt("lastviplv", 0);
                    MonoSingleton <GameManager> .Instance.Player.ClearTrophies();

                    this.ActivateOutputLinks(1);
                }
                else
                {
                    GlobalVars.CustomerID = jsonObject.body.cuid;
                    int status = jsonObject.body.status;
                    if (status != 0)
                    {
                        GlobalVars.BanStatus = jsonObject.body.status;
                        if (status == 1)
                        {
                            this.ActivateOutputLinks(5);
                        }
                        else if (jsonObject.body.status > 1)
                        {
                            this.ActivateOutputLinks(6);
                        }
                        ((Behaviour)this).set_enabled(false);
                    }
                    else
                    {
                        GameManager instance           = MonoSingleton <GameManager> .Instance;
                        long        lastConnectionTime = Network.LastConnectionTime;
                        instance.Player.LoginDate     = TimeManager.FromUnixTime(lastConnectionTime);
                        instance.Player.TutorialFlags = jsonObject.body.tut;
                        try
                        {
                            instance.Deserialize(jsonObject.body.player);
                            instance.Deserialize(jsonObject.body.units);
                            instance.Deserialize(jsonObject.body.items);
                            instance.Deserialize(jsonObject.body.parties);
                            instance.Deserialize(jsonObject.body.notify);
                            instance.Deserialize(jsonObject.body.artifacts, false);
                            instance.Deserialize(jsonObject.body.skins);
                            instance.Deserialize(jsonObject.body.vs);
                        }
                        catch (Exception ex)
                        {
                            DebugUtility.LogException(ex);
                            this.Failure();
                            return;
                        }
                        if (Object.op_Inequality((Object)this, (Object)null))
                        {
                            ((Behaviour)this).set_enabled(false);
                        }
                        GlobalVars.BtlID.Set(jsonObject.body.player.btlid);
                        if (!string.IsNullOrEmpty(jsonObject.body.player.btltype))
                        {
                            GlobalVars.QuestType = QuestParam.ToQuestType(jsonObject.body.player.btltype);
                        }
                        GameUtility.Config_OkyakusamaCode = instance.Player.OkyakusamaCode;
                        if (!PlayerPrefs.HasKey("lastplv"))
                        {
                            PlayerPrefs.SetInt("lastplv", MonoSingleton <GameManager> .Instance.Player.Lv);
                        }
                        if (!PlayerPrefs.HasKey("lastviplv"))
                        {
                            PlayerPrefs.SetInt("lastviplv", MonoSingleton <GameManager> .Instance.Player.VipRank);
                        }
                        instance.PostLogin();
                        this.ActivateOutputLinks(!string.IsNullOrEmpty(jsonObject.body.player.name) ? 3 : 2);
                    }
                }
            }
        }
示例#4
0
        private void Start()
        {
            this.Chapter = MonoSingleton <GameManager> .Instance.FindArea((string)GlobalVars.SelectedChapter);

            if (this.Chapter == null)
            {
                FlowNode_GameObject.ActivateOutputLinks((Component)this, 101);
            }
            else
            {
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.ItemTemplate, (UnityEngine.Object)null) && this.ItemTemplate.get_activeInHierarchy())
                {
                    this.ItemTemplate.SetActive(false);
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Message, (UnityEngine.Object)null))
                {
                    string    str       = (string)null;
                    ItemParam itemParam = (ItemParam)null;
                    int       num1      = 0;
                    if (this.Chapter.keys.Count > 0)
                    {
                        KeyItem key = this.Chapter.keys[0];
                        itemParam = MonoSingleton <GameManager> .Instance.GetItemParam(key.iname);

                        num1 = key.num;
                    }
                    KeyQuestTypes keyQuestType     = this.Chapter.GetKeyQuestType();
                    bool          keyQuestTimeOver = GlobalVars.KeyQuestTimeOver;
                    switch (keyQuestType)
                    {
                    case KeyQuestTypes.Timer:
                        if (this.Chapter.keytime != 0L && itemParam != null)
                        {
                            DateTime dateTime1 = TimeManager.FromUnixTime(0L);
                            DateTime dateTime2;
                            if (this.Chapter.end == 0L)
                            {
                                dateTime2 = TimeManager.FromUnixTime(this.Chapter.keytime);
                            }
                            else
                            {
                                long num2 = Math.Min(this.Chapter.end - TimeManager.FromDateTime(TimeManager.ServerTime), this.Chapter.keytime);
                                dateTime2 = TimeManager.FromUnixTime(num2 >= 0L ? num2 : 0L);
                            }
                            TimeSpan timeSpan = dateTime2 - dateTime1;
                            if (timeSpan.TotalDays >= 1.0)
                            {
                                str = LocalizedText.Get(!keyQuestTimeOver ? "sys.KEYQUEST_UNLCOK_TIMER_D" : "sys.KEYQUEST_TIMEOVER_D", (object)itemParam.name, (object)num1, (object)timeSpan.Days);
                                break;
                            }
                            if (timeSpan.TotalHours >= 1.0)
                            {
                                str = LocalizedText.Get(!keyQuestTimeOver ? "sys.KEYQUEST_UNLCOK_TIMER_H" : "sys.KEYQUEST_TIMEOVER_H", (object)itemParam.name, (object)num1, (object)timeSpan.Hours);
                                break;
                            }
                            str = LocalizedText.Get(!keyQuestTimeOver ? "sys.KEYQUEST_UNLCOK_TIMER_M" : "sys.KEYQUEST_TIMEOVER_M", (object)itemParam.name, (object)num1, (object)Mathf.Max(timeSpan.Minutes, 0));
                            break;
                        }
                        break;

                    case KeyQuestTypes.Count:
                        str = LocalizedText.Get(!keyQuestTimeOver ? "sys.KEYQUEST_UNLCOK_COUNT" : "sys.KEYQUEST_TIMEOVER_COUNT", (object)itemParam.name, (object)num1);
                        break;
                    }
                    this.Message.set_text(str);
                }
                this.Refresh();
            }
        }
示例#5
0
 public static DateTime GetDropTableGeneratedDateTime()
 {
     return(TimeManager.FromUnixTime(GlobalVars.mDropTableGeneratedUnixTime));
 }
示例#6
0
        public override void OnActivate(int pinID)
        {
            GameManager instance = MonoSingleton <GameManager> .Instance;

            switch (pinID)
            {
            case 100:
                GlobalVars.SelectedMultiPlayVersusType = VERSUS_TYPE.Free;
                break;

            case 101:
                GlobalVars.SelectedMultiPlayVersusType = VERSUS_TYPE.Tower;
                break;

            case 102:
                GlobalVars.SelectedMultiPlayVersusType = VERSUS_TYPE.Friend;
                break;

            case 103:
                if (GlobalVars.SelectedMultiPlayVersusType == this.type)
                {
                    if (this.type == VERSUS_TYPE.Tower)
                    {
                        if (instance.VersusTowerMatchBegin)
                        {
                            this.ActivateOutputLinks(201);
                            return;
                        }
                    }
                    else
                    {
                        this.ActivateOutputLinks(201);
                        return;
                    }
                }
                this.ActivateOutputLinks(202);
                return;

            case 104:
                if (instance.VersusTowerMatchBegin)
                {
                    this.ActivateOutputLinks(201);
                    return;
                }
                this.ActivateOutputLinks(202);
                return;

            case 105:
                if (instance.VersusTowerMatchReceipt)
                {
                    this.ActivateOutputLinks(201);
                    return;
                }
                this.ActivateOutputLinks(202);
                return;

            case 106:
                if (instance.Player.VersusSeazonGiftReceipt)
                {
                    this.ActivateOutputLinks(201);
                    return;
                }
                this.ActivateOutputLinks(202);
                return;

            case 107:
                VsTowerMatchEndParam towerMatchEndParam = instance.GetVsTowerMatchEndParam();
                if (towerMatchEndParam != null)
                {
                    VersusTowerParam versusTowerParam = instance.GetCurrentVersusTowerParam(towerMatchEndParam.floor);
                    if (versusTowerParam != null && (int)versusTowerParam.RankupNum == 0 && !towerMatchEndParam.rankup)
                    {
                        this.ActivateOutputLinks(201);
                        return;
                    }
                }
                this.ActivateOutputLinks(202);
                return;

            case 108:
                if (instance.AudienceMode)
                {
                    this.ActivateOutputLinks(201);
                    return;
                }
                this.ActivateOutputLinks(202);
                return;

            case 109:
                if (instance.IsVSCpuBattle)
                {
                    this.ActivateOutputLinks(201);
                    return;
                }
                this.ActivateOutputLinks(202);
                return;

            case 110:
                instance.IsVSCpuBattle = true;
                break;

            case 111:
                long matchExpiredTime = instance.RankMatchExpiredTime;
                long num = TimeManager.FromDateTime(TimeManager.ServerTime);
                instance.RankMatchBegin = num < matchExpiredTime;
                if (instance.RankMatchBegin)
                {
                    this.ActivateOutputLinks(201);
                    return;
                }
                this.ActivateOutputLinks(202);
                return;

            case 112:
                GlobalVars.SelectedMultiPlayVersusType = VERSUS_TYPE.RankMatch;
                break;

            case 113:
                if (instance.VSDraftType == VersusDraftType.Draft)
                {
                    this.ActivateOutputLinks(201);
                    return;
                }
                this.ActivateOutputLinks(202);
                return;

            case 114:
                if (instance.VSDraftType == VersusDraftType.Draft || instance.VSDraftType == VersusDraftType.DraftFriend)
                {
                    this.ActivateOutputLinks(201);
                    return;
                }
                this.ActivateOutputLinks(202);
                return;
            }
            this.ActivateOutputLinks(200);
        }
        public void InitializeContentList()
        {
            this.ReleaseContentList();
            if (!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.m_ContentController, (UnityEngine.Object)null))
            {
                return;
            }
            this.m_ContentSource = new MultiInvitationSendWindow.Content.ItemSource();
            List <FriendData> list     = new List <FriendData>((IEnumerable <FriendData>)MonoSingleton <GameManager> .Instance.Player.Friends);
            MyPhoton          instance = PunMonoSingleton <MyPhoton> .Instance;

            if (UnityEngine.Object.op_Inequality((UnityEngine.Object)instance, (UnityEngine.Object)null))
            {
                List <MyPhoton.MyPlayer> roomPlayerList = instance.GetRoomPlayerList();
                for (int index1 = 0; index1 < roomPlayerList.Count; ++index1)
                {
                    if (roomPlayerList[index1] != null && !string.IsNullOrEmpty(roomPlayerList[index1].json))
                    {
                        JSON_MyPhotonPlayerParam param = JSON_MyPhotonPlayerParam.Parse(roomPlayerList[index1].json);
                        if (param != null)
                        {
                            int index2 = list.FindIndex((Predicate <FriendData>)(prop => prop.UID == param.UID));
                            if (index2 != -1)
                            {
                                list.RemoveAt(index2);
                            }
                        }
                    }
                }
            }
            for (int index = 0; index < list.Count; ++index)
            {
                FriendData data = list[index];
                bool       flag = false;
                if (data != null)
                {
                    if (MultiInvitationSendWindow.m_Invited.FindIndex((Predicate <string>)(prop => prop == data.UID)) != -1)
                    {
                        flag = true;
                    }
                    else if (!data.MultiPush)
                    {
                        flag = true;
                    }
                    else if (TimeManager.GetUnixSec(DateTime.Now) - data.LastLogin > 86400L)
                    {
                        flag = true;
                    }
                }
                else
                {
                    flag = true;
                }
                if (flag)
                {
                    list.RemoveAt(index);
                    --index;
                }
            }
            SortUtility.StableSort <FriendData>(list, (Comparison <FriendData>)((p1, p2) => (!p1.IsFavorite ? p1.LastLogin : long.MaxValue).CompareTo(!p2.IsFavorite ? p2.LastLogin : long.MaxValue)));
            list.Reverse();
            for (int index = 0; index < list.Count; ++index)
            {
                FriendData friend = list[index];
                if (friend != null)
                {
                    MultiInvitationSendWindow.Content.ItemSource.ItemParam itemParam = new MultiInvitationSendWindow.Content.ItemSource.ItemParam(friend);
                    if (itemParam.IsValid())
                    {
                        this.m_ContentSource.Add(itemParam);
                    }
                }
            }
            this.m_ContentController.Initialize((ContentSource)this.m_ContentSource, Vector2.get_zero());
        }
示例#8
0
        private BannerParam[] makeValidBannerParams()
        {
            GameManager instance = MonoSingleton <GameManager> .Instance;

            BannerParam[] banners = instance.MasterParam.Banners;
            if (banners == null)
            {
                return(new BannerParam[0]);
            }
            List <BannerParam> bannerParamList = new List <BannerParam>();

            GachaParam[] gachas          = instance.Gachas;
            QuestParam[] availableQuests = instance.Player.AvailableQuests;
            QuestParam   lastStoryQuest  = instance.Player.FindLastStoryQuest();
            long         serverTime      = Network.GetServerTime();
            DateTime     now             = TimeManager.FromUnixTime(serverTime);

            for (int index = 0; index < banners.Length; ++index)
            {
                // ISSUE: object of a compiler-generated type is created
                // ISSUE: variable of a compiler-generated type
                EventBannerScroll.\u003CmakeValidBannerParams\u003Ec__AnonStorey243 paramsCAnonStorey243 = new EventBannerScroll.\u003CmakeValidBannerParams\u003Ec__AnonStorey243();
                // ISSUE: reference to a compiler-generated field
                paramsCAnonStorey243.banner = banners[index];
                // ISSUE: reference to a compiler-generated field
                // ISSUE: reference to a compiler-generated method
                if (!string.IsNullOrEmpty(paramsCAnonStorey243.banner.banner) && bannerParamList.FindIndex(new Predicate <BannerParam>(paramsCAnonStorey243.\u003C\u003Em__270)) == -1)
                {
                    // ISSUE: reference to a compiler-generated field
                    if (paramsCAnonStorey243.banner.type == BannerType.shop)
                    {
                        // ISSUE: reference to a compiler-generated field
                        if (!string.IsNullOrEmpty(paramsCAnonStorey243.banner.sval))
                        {
                            // ISSUE: reference to a compiler-generated method
                            Array.Find <JSON_ShopListArray.Shops>(instance.LimitedShopList, new Predicate <JSON_ShopListArray.Shops>(paramsCAnonStorey243.\u003C\u003Em__271));
                        }
                        // ISSUE: reference to a compiler-generated field
                        if (!paramsCAnonStorey243.banner.IsAvailablePeriod(now))
                        {
                            continue;
                        }
                    }
                    else
                    {
                        // ISSUE: reference to a compiler-generated field
                        if (paramsCAnonStorey243.banner.type == BannerType.storyQuest)
                        {
                            if (lastStoryQuest != null)
                            {
                                QuestParam questParam;
                                // ISSUE: reference to a compiler-generated field
                                if (string.IsNullOrEmpty(paramsCAnonStorey243.banner.sval))
                                {
                                    questParam = lastStoryQuest;
                                }
                                else
                                {
                                    // ISSUE: reference to a compiler-generated method
                                    questParam = Array.Find <QuestParam>(availableQuests, new Predicate <QuestParam>(paramsCAnonStorey243.\u003C\u003Em__272));
                                    if (questParam == null || questParam.iname != lastStoryQuest.iname && questParam.state == QuestStates.New)
                                    {
                                        questParam = lastStoryQuest;
                                    }
                                }
                                if (!questParam.IsDateUnlock(serverTime))
                                {
                                    continue;
                                }
                            }
                            else
                            {
                                continue;
                            }
                        }
                        else
                        {
                            // ISSUE: reference to a compiler-generated field
                            // ISSUE: reference to a compiler-generated field
                            if (paramsCAnonStorey243.banner.type == BannerType.eventQuest || paramsCAnonStorey243.banner.type == BannerType.multiQuest)
                            {
                                // ISSUE: reference to a compiler-generated field
                                if (!string.IsNullOrEmpty(paramsCAnonStorey243.banner.sval))
                                {
                                    // ISSUE: reference to a compiler-generated method
                                    QuestParam questParam = Array.Find <QuestParam>(availableQuests, new Predicate <QuestParam>(paramsCAnonStorey243.\u003C\u003Em__273));
                                    if (questParam == null || !questParam.IsDateUnlock(serverTime))
                                    {
                                        continue;
                                    }
                                }
                            }
                            else
                            {
                                // ISSUE: reference to a compiler-generated field
                                if (paramsCAnonStorey243.banner.type == BannerType.gacha)
                                {
                                    // ISSUE: reference to a compiler-generated field
                                    if (!string.IsNullOrEmpty(paramsCAnonStorey243.banner.sval))
                                    {
                                        // ISSUE: reference to a compiler-generated method
                                        GachaParam gachaParam = Array.Find <GachaParam>(gachas, new Predicate <GachaParam>(paramsCAnonStorey243.\u003C\u003Em__274));
                                        if (gachaParam != null)
                                        {
                                            // ISSUE: reference to a compiler-generated field
                                            paramsCAnonStorey243.banner.begin_at = TimeManager.FromUnixTime(gachaParam.startat).ToString();
                                            // ISSUE: reference to a compiler-generated field
                                            paramsCAnonStorey243.banner.end_at = TimeManager.FromUnixTime(gachaParam.endat).ToString();
                                            // ISSUE: reference to a compiler-generated field
                                            if (!paramsCAnonStorey243.banner.IsAvailablePeriod(now))
                                            {
                                                continue;
                                            }
                                        }
                                        else
                                        {
                                            continue;
                                        }
                                    }
                                }
                                else
                                {
                                    // ISSUE: reference to a compiler-generated field
                                    // ISSUE: reference to a compiler-generated field
                                    // ISSUE: reference to a compiler-generated field
                                    if (paramsCAnonStorey243.banner.type == BannerType.url && (string.IsNullOrEmpty(paramsCAnonStorey243.banner.sval) || !paramsCAnonStorey243.banner.IsAvailablePeriod(now)))
                                    {
                                        continue;
                                    }
                                }
                            }
                        }
                    }
                    // ISSUE: reference to a compiler-generated field
                    bannerParamList.Add(paramsCAnonStorey243.banner);
                }
            }
            for (int index1 = 0; index1 < bannerParamList.Count - 1; ++index1)
            {
                for (int index2 = index1 + 1; index2 < bannerParamList.Count; ++index2)
                {
                    if (bannerParamList[index1].priority > bannerParamList[index2].priority)
                    {
                        BannerParam bannerParam = bannerParamList[index1];
                        bannerParamList[index1] = bannerParamList[index2];
                        bannerParamList[index2] = bannerParam;
                    }
                }
            }
            return(bannerParamList.ToArray());
        }
示例#9
0
        private void ResponseCallback(WWWResult www)
        {
            if (FlowNode_Network.HasCommonError(www))
            {
                return;
            }
            if (Network.IsError)
            {
                Network.EErrCode errCode = Network.ErrCode;
                switch (errCode)
                {
                case Network.EErrCode.MultiMaintenance:
                case Network.EErrCode.VsMaintenance:
                case Network.EErrCode.MultiVersionMaintenance:
                case Network.EErrCode.MultiTowerMaintenance:
                    Network.RemoveAPI();
                    ((Behaviour)this).set_enabled(false);
                    break;

                default:
                    if (errCode != Network.EErrCode.OutOfDateQuest)
                    {
                        if (errCode == Network.EErrCode.MultiVersionMismatch || errCode == Network.EErrCode.VS_Version)
                        {
                            Network.RemoveAPI();
                            Network.ResetError();
                            ((Behaviour)this).set_enabled(false);
                            break;
                        }
                        FlowNode_Network.Retry();
                        break;
                    }
                    Network.RemoveAPI();
                    Network.ResetError();
                    ((Behaviour)this).set_enabled(false);
                    break;
                }
            }
            else
            {
                WebAPI.JSON_BodyResponse <ReqRankMatchHistory.Response> jsonBodyResponse = (WebAPI.JSON_BodyResponse <ReqRankMatchHistory.Response>)JsonUtility.FromJson <WebAPI.JSON_BodyResponse <ReqRankMatchHistory.Response> >(www.text);
                DebugUtility.Assert(jsonBodyResponse != null, "res == null");
                if (jsonBodyResponse.body == null)
                {
                    Network.RemoveAPI();
                }
                else
                {
                    if (jsonBodyResponse.body.histories == null || jsonBodyResponse.body.histories.list == null)
                    {
                        return;
                    }
                    long unixtime = 0;
                    for (int index = 0; index < jsonBodyResponse.body.histories.list.Length; ++index)
                    {
                        ReqRankMatchHistory.ResponceHistoryList data1 = jsonBodyResponse.body.histories.list[index];
                        ListItemEvents listItemEvents = (ListItemEvents)Object.Instantiate <ListItemEvents>((M0)this.ListItem);
                        DataSource.Bind <ReqRankMatchHistory.ResponceHistoryList>(((Component)listItemEvents).get_gameObject(), data1);
                        FriendData data2 = new FriendData();
                        data2.Deserialize(data1.enemy);
                        DataSource.Bind <FriendData>(((Component)listItemEvents).get_gameObject(), data2);
                        DataSource.Bind <UnitData>(((Component)listItemEvents).get_gameObject(), data2.Unit);
                        this.AddItem(listItemEvents);
                        ((Component)listItemEvents).get_transform().SetParent(((Component)this).get_transform(), false);
                        ((Component)listItemEvents).get_gameObject().SetActive(true);
                        if (unixtime < data1.time_end)
                        {
                            unixtime = data1.time_end;
                        }
                    }
                    if (Object.op_Inequality((Object)this.LastBattleDate, (Object)null) && unixtime > 0L)
                    {
                        this.LastBattleDate.set_text(TimeManager.FromUnixTime(unixtime).ToString("MM/dd HH:mm"));
                    }
                    Network.RemoveAPI();
                }
            }
        }