public ItemParam(FriendData friend)
 {
     this.m_Accessor.Setup(friend);
 }
Beispiel #2
0
 public void Setup(string uid)
 {
     this.m_FriendData = MonoSingleton <GameManager> .Instance.Player.Friends.Find((Predicate <FriendData>)(prop => prop.UID == uid));
 }
 public void Setup(FriendData friend)
 {
     this.m_Friend = friend;
 }
Beispiel #4
0
        private void entryItems()
        {
            List <FriendData> friendDataList = new List <FriendData>();
            List <FriendData> lists;

            switch (this.FriendType)
            {
            case FriendStates.Friend:
                lists = MonoSingleton <GameManager> .Instance.Player.Friends;
                break;

            case FriendStates.Follow:
                lists = MonoSingleton <GameManager> .Instance.Player.FriendsFollow;
                break;

            case FriendStates.Follwer:
                lists = MonoSingleton <GameManager> .Instance.Player.FriendsFollower;
                break;

            default:
                return;
            }
            if (lists.Count == 0)
            {
                return;
            }
            switch (this.mSortType)
            {
            case FriendList.eSortType.MIN:
                this.SortByEntryDate(lists);
                break;

            case FriendList.eSortType.LAST_LOGIN:
                this.SortByLastLogin(lists);
                break;

            case FriendList.eSortType.PLAYER_LEVEL:
                this.SortByPlayerLevel(lists);
                break;
            }
            Transform transform = ((Component)this).get_transform();

            using (List <FriendData> .Enumerator enumerator = lists.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    FriendData current    = enumerator.Current;
                    GameObject gameObject = (GameObject)Object.Instantiate <GameObject>((M0)this.ItemTemplate);
                    if (Object.op_Implicit((Object)gameObject))
                    {
                        gameObject.get_transform().SetParent(transform, false);
                        ListItemEvents component = (ListItemEvents)gameObject.GetComponent <ListItemEvents>();
                        if (Object.op_Inequality((Object)component, (Object)null))
                        {
                            component.OnSelect = new ListItemEvents.ListItemEvent(this.OnSelectItem);
                        }
                        DataSource.Bind <FriendData>(gameObject, current);
                        DataSource.Bind <UnitData>(gameObject, current.Unit);
                        gameObject.SetActive(true);
                        this.mItems.Add(gameObject);
                    }
                }
            }
        }
        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());
        }
        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))
                    {
                        // ISSUE: object of a compiler-generated type is created
                        // ISSUE: variable of a compiler-generated type
                        MultiInvitationSendWindow.\u003CInitializeContentList\u003Ec__AnonStorey34A listCAnonStorey34A = new MultiInvitationSendWindow.\u003CInitializeContentList\u003Ec__AnonStorey34A();
                        // ISSUE: reference to a compiler-generated field
                        listCAnonStorey34A.param = JSON_MyPhotonPlayerParam.Parse(roomPlayerList[index1].json);
                        // ISSUE: reference to a compiler-generated field
                        if (listCAnonStorey34A.param != null)
                        {
                            // ISSUE: reference to a compiler-generated method
                            int index2 = list.FindIndex(new Predicate <FriendData>(listCAnonStorey34A.\u003C\u003Em__3AA));
                            if (index2 != -1)
                            {
                                list.RemoveAt(index2);
                            }
                        }
                    }
                }
            }
            for (int index = 0; index < list.Count; ++index)
            {
                // ISSUE: object of a compiler-generated type is created
                // ISSUE: variable of a compiler-generated type
                MultiInvitationSendWindow.\u003CInitializeContentList\u003Ec__AnonStorey34B listCAnonStorey34B = new MultiInvitationSendWindow.\u003CInitializeContentList\u003Ec__AnonStorey34B();
                // ISSUE: reference to a compiler-generated field
                listCAnonStorey34B.data = list[index];
                bool flag = false;
                // ISSUE: reference to a compiler-generated field
                if (listCAnonStorey34B.data != null)
                {
                    // ISSUE: reference to a compiler-generated method
                    if (MultiInvitationSendWindow.m_Invited.FindIndex(new Predicate <string>(listCAnonStorey34B.\u003C\u003Em__3AB)) != -1)
                    {
                        flag = true;
                    }
                    else
                    {
                        // ISSUE: reference to a compiler-generated field
                        if (!listCAnonStorey34B.data.MultiPush)
                        {
                            flag = true;
                        }
                        else
                        {
                            // ISSUE: reference to a compiler-generated field
                            if (TimeManager.GetUnixSec(DateTime.Now) - listCAnonStorey34B.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());
        }
        public override void OnActivate(int pinID)
        {
            if (((Behaviour)this).get_enabled())
            {
                return;
            }
            List <string>     friendApplyList = new List <string>();
            List <string>     stringList      = new List <string>();
            List <FriendData> friends         = MonoSingleton <GameManager> .Instance.Player.Friends;

            if (pinID == 0)
            {
                if (!string.IsNullOrEmpty(GlobalVars.SelectedFriendID))
                {
                    friendApplyList.Add(GlobalVars.SelectedFriendID);
                }
                else if (GlobalVars.FoundFriend != null && !string.IsNullOrEmpty(GlobalVars.FoundFriend.FUID))
                {
                    friendApplyList.Add(GlobalVars.FoundFriend.FUID);
                }
            }
            else
            {
                FriendWindowItem[] componentsInChildren = (FriendWindowItem[])((Component)this).GetComponentsInChildren <FriendWindowItem>();
                if (componentsInChildren != null && componentsInChildren.Length > 0)
                {
                    for (int index = 0; index < componentsInChildren.Length; ++index)
                    {
                        FriendWindowItem friendWindowItem = componentsInChildren[index];
                        if (friendWindowItem.IsOn)
                        {
                            friendApplyList.Add(friendWindowItem.Support == null ? friendWindowItem.PlayerParam.FUID : friendWindowItem.Support.FUID);
                        }
                        else if (friendWindowItem.IsBlockOn)
                        {
                            stringList.Add(friendWindowItem.Support == null ? friendWindowItem.PlayerParam.FUID : friendWindowItem.Support.FUID);
                        }
                    }
                }
            }
            if (friendApplyList.Count > 0 || stringList.Count > 0)
            {
                for (int i = 0; i < friendApplyList.Count; ++i)
                {
                    FriendData friendData = friends.Find((Predicate <FriendData>)(f => f.FUID == friendApplyList[i]));
                    if (friendData != null && friendData.State == FriendStates.Friend)
                    {
                        UIUtility.SystemMessage((string)null, LocalizedText.Get("sys.FRIEND_ALREADY_FRIEND"), (UIUtility.DialogResultEvent)(go => this.ActivateOutputLinks(6)), (GameObject)null, false, -1);
                        return;
                    }
                    this.apiType |= 2;
                }
                if (stringList != null && stringList.Count > 0)
                {
                    this.apiType |= 4;
                }
                this.ExecRequest((WebAPI) new ReqFriendBlockApply(friendApplyList.ToArray(), stringList.ToArray(), new Network.ResponseCallback(((FlowNode_Network)this).ResponseCallback)));
                ((Behaviour)this).set_enabled(true);
            }
            else
            {
                ((Behaviour)this).set_enabled(false);
                this.ActivateOutputLinks(10);
            }
        }
Beispiel #8
0
        private bool Test()
        {
            PlayerData player = MonoSingleton <GameManager> .Instance.Player;

            switch (this.Condition)
            {
            case FlowNode_Condition.Conditions.QUEST_HASENOUGHSTAMINA:
                QuestParam quest1 = MonoSingleton <GameManager> .Instance.FindQuest(GlobalVars.SelectedQuestID);

                if (quest1 != null)
                {
                    return(MonoSingleton <GameManager> .Instance.Player.Stamina >= quest1.RequiredApWithPlayerLv(player.Lv, true));
                }
                break;

            case FlowNode_Condition.Conditions.FRIEND_ISFRIEND:
                SupportData supportData1;
                if ((supportData1 = this.GetSupportData()) != null)
                {
                    return(supportData1.IsFriend());
                }
                return(false);

            case FlowNode_Condition.Conditions.PARTY_LEADERSKILLAVAIL:
                PartyData dataOfClass1;
                if ((dataOfClass1 = DataSource.FindDataOfClass <PartyData>(((Component)this).get_gameObject(), (PartyData)null)) != null)
                {
                    return(this.GetLeaderSkill(dataOfClass1) != null);
                }
                break;

            case FlowNode_Condition.Conditions.FRIEND_LEADERSKILLAVAIL:
                SupportData supportData2;
                if ((supportData2 = this.GetSupportData()) != null)
                {
                    return(supportData2.LeaderSkill != null);
                }
                break;

            case FlowNode_Condition.Conditions.PARTY_LEADEREXIST:
                for (int index = 0; index < player.Partys.Count; ++index)
                {
                    if (player.Partys[index].GetUnitUniqueID(player.Partys[index].LeaderIndex) == 0L)
                    {
                        return(false);
                    }
                }
                return(true);

            case FlowNode_Condition.Conditions.TARGET_COMMANDVALID:
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null))
                {
                    return(SceneBattle.Instance.UIParam_TargetValid);
                }
                break;

            case FlowNode_Condition.Conditions.QUEST_DROPSKAKERA:
                QuestParam dataOfClass2;
                if ((dataOfClass2 = DataSource.FindDataOfClass <QuestParam>(((Component)this).get_gameObject(), (QuestParam)null)) != null && !UnityEngine.Object.op_Equality((UnityEngine.Object)QuestDropParam.Instance, (UnityEngine.Object)null))
                {
                    return(QuestDropParam.Instance.GetHardDropPiece(dataOfClass2.iname, GlobalVars.GetDropTableGeneratedDateTime()) != null);
                }
                break;

            case FlowNode_Condition.Conditions.QUEST_FIRSTTURN:
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null))
                {
                    return(SceneBattle.Instance.UnitStartCount <= 1);
                }
                break;

            case FlowNode_Condition.Conditions.QUEST_NEEDFRIENDREQUEST:
                // ISSUE: object of a compiler-generated type is created
                // ISSUE: variable of a compiler-generated type
                FlowNode_Condition.\u003CTest\u003Ec__AnonStorey2C7 testCAnonStorey2C7 = new FlowNode_Condition.\u003CTest\u003Ec__AnonStorey2C7();
                // ISSUE: reference to a compiler-generated field
                testCAnonStorey2C7.support = (SupportData)GlobalVars.SelectedSupport;
                // ISSUE: reference to a compiler-generated field
                // ISSUE: reference to a compiler-generated field
                if (testCAnonStorey2C7.support == null || testCAnonStorey2C7.support.IsFriend())
                {
                    return(false);
                }
                // ISSUE: reference to a compiler-generated method
                FriendData friendData = player.Friends.Find(new Predicate <FriendData>(testCAnonStorey2C7.\u003C\u003Em__2A0));
                if (friendData == null)
                {
                    return(true);
                }
                return(friendData.State == FriendStates.Friend || friendData.State != FriendStates.Follow ? false : false);

            case FlowNode_Condition.Conditions.PLAYER_LEVELCHANGED:
                return((bool)GlobalVars.PlayerLevelChanged);

            case FlowNode_Condition.Conditions.NEWGAME:
                return(GameUtility.Config_NewGame.Value);

            case FlowNode_Condition.Conditions.BTLIDSET:
                return((long)GlobalVars.BtlID != 0L);

            case FlowNode_Condition.Conditions.QUEST_ISMULTIPLAY:
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null))
                {
                    return(SceneBattle.Instance.IsPlayingMultiQuest);
                }
                break;

            case FlowNode_Condition.Conditions.QUEST_ISARENA:
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null))
                {
                    return(SceneBattle.Instance.IsPlayingArenaQuest);
                }
                break;

            case FlowNode_Condition.Conditions.ARENA_RANKUP:
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null))
                {
                    return(SceneBattle.Instance.IsArenaRankupInfo());
                }
                break;

            case FlowNode_Condition.Conditions.QUEST_HASREWARD:
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null))
                {
                    return(!SceneBattle.Instance.Battle.GetQuestRecord().IsZero);
                }
                break;

            case FlowNode_Condition.Conditions.TERMSOFUSE_AGREED:
                return(MonoSingleton <GameManager> .Instance.IsAgreeTermsOfUse());

            case FlowNode_Condition.Conditions.FRIEND_VALID:
                return(this.GetSupportData() != null);

            case FlowNode_Condition.Conditions.QUEST_ENDSILENT:
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null))
                {
                    return(SceneBattle.Instance.CurrentQuest.Silent);
                }
                break;

            case FlowNode_Condition.Conditions.IS_NOT_ENOUGH_SUPPORT_COST:
                SupportData supportData3 = this.GetSupportData();
                if (supportData3 != null)
                {
                    int gold = player.Gold;
                    if (supportData3.GetCost() > gold)
                    {
                        return(true);
                    }
                    break;
                }
                break;

            case FlowNode_Condition.Conditions.MULTI_PLAY_IS_UNLOCKED:
                return(MonoSingleton <GameManager> .Instance.Player.CheckUnlock(UnlockTargets.MultiPlay));

            case FlowNode_Condition.Conditions.QUEST_IS_ENABLE_AUTOBATTLE:
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null))
                {
                    QuestParam quest2 = SceneBattle.Instance.Battle.GetQuest();
                    if (quest2 != null)
                    {
                        return(quest2.CheckAllowedAutoBattle());
                    }
                    return(false);
                }
                break;

            case FlowNode_Condition.Conditions.QUEST_IS_AUTOBATTLE:
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null))
                {
                    return(SceneBattle.Instance.Battle.IsAutoBattle);
                }
                break;

            case FlowNode_Condition.Conditions.DEBUGBUILD:
                return(GameUtility.IsDebugBuild);

            case FlowNode_Condition.Conditions.IS_BEGINNER:
                return(MonoSingleton <GameManager> .Instance.Player.IsBeginner());

            case FlowNode_Condition.Conditions.IS_END_TUTORIAL:
                return((MonoSingleton <GameManager> .Instance.Player.TutorialFlags & 1L) != 0L);

            case FlowNode_Condition.Conditions.IS_GET_UNIT:
                return(MonoSingleton <GameManager> .Instance.Player.FindUnitDataByUnitID(DataSource.FindDataOfClass <UnitParam>(((Component)this).get_gameObject(), (UnitParam)null).iname) != null);

            case FlowNode_Condition.Conditions.VERSUS_UNLOCK:
                return(MonoSingleton <GameManager> .Instance.Player.CheckUnlock(UnlockTargets.MultiVS));

            case FlowNode_Condition.Conditions.QUEST_IS_SHOW_REVIEW:
                if (!string.IsNullOrEmpty(GlobalVars.SelectedQuestID))
                {
                    QuestParam quest2 = MonoSingleton <GameManager> .Instance.FindQuest(GlobalVars.SelectedQuestID);

                    if (quest2 != null)
                    {
                        return(quest2.ShowReviewPopup);
                    }
                    break;
                }
                break;

            case FlowNode_Condition.Conditions.QUEST_IS_FIRST_CLEAR:
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null))
                {
                    return(SceneBattle.Instance.IsFirstWin);
                }
                break;

            case FlowNode_Condition.Conditions.QUEST_IS_GPS:
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null) && SceneBattle.Instance.CurrentQuest != null && SceneBattle.Instance.CurrentQuest.type == QuestTypes.Gps)
                {
                    return(true);
                }
                break;

            case FlowNode_Condition.Conditions.QUEST_IS_GPSCHAPTER_HEAD:
                if (!string.IsNullOrEmpty((string)GlobalVars.SelectedChapter))
                {
                    ChapterParam area = MonoSingleton <GameManager> .Instance.FindArea((string)GlobalVars.SelectedChapter);

                    if (area != null && area.IsGpsQuest())
                    {
                        return(area.children.Count > 0);
                    }
                    break;
                }
                break;

            case FlowNode_Condition.Conditions.QUEST_IS_GPSCHAPTER_QUEST:
                if (!string.IsNullOrEmpty((string)GlobalVars.SelectedChapter))
                {
                    ChapterParam area = MonoSingleton <GameManager> .Instance.FindArea((string)GlobalVars.SelectedChapter);

                    if (area != null)
                    {
                        return(area.IsGpsQuest());
                    }
                    break;
                }
                break;

            case FlowNode_Condition.Conditions.QUEST_IS_GPSCHAPTER_QUEST_VALID:
                if (!string.IsNullOrEmpty((string)GlobalVars.SelectedChapter))
                {
                    ChapterParam area = MonoSingleton <GameManager> .Instance.FindArea((string)GlobalVars.SelectedChapter);

                    if (area != null)
                    {
                        return(area.HasGpsQuest());
                    }
                    break;
                }
                break;

            case FlowNode_Condition.Conditions.VALID_GPSGIFT:
                return(MonoSingleton <GameManager> .Instance.Player.ValidGpsGift);

            case FlowNode_Condition.Conditions.SCENE_CHANGING:
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)HomeWindow.Current, (UnityEngine.Object)null))
                {
                    return(HomeWindow.Current.IsSceneChanging);
                }
                return(false);

            case FlowNode_Condition.Conditions.QUEST_IS_PLAY_LAST_DEMO:
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null))
                {
                    return(SceneBattle.Instance.IsPlayLastDemo);
                }
                break;

            case FlowNode_Condition.Conditions.QUEST_IS_RANKINGQUEST:
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null))
                {
                    return(SceneBattle.Instance.Battle.IsRankingQuest);
                }
                break;

            case FlowNode_Condition.Conditions.QUEST_IS_RANKINGQUEST_NEWSCORE:
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null))
                {
                    return(SceneBattle.Instance.IsRankingQuestNewScore);
                }
                break;

            case FlowNode_Condition.Conditions.QUEST_IS_RANKINGQUEST_JOIN_REWARD:
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null))
                {
                    return(SceneBattle.Instance.IsRankingQuestJoinReward);
                }
                break;

            case FlowNode_Condition.Conditions.QUEST_IS_RANKINGQUEST_RESULT_VALIDRANK:
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null))
                {
                    return(SceneBattle.Instance.ValidateRankingQuestRank);
                }
                break;

            case FlowNode_Condition.Conditions.SG_LANGUAGE:
                if (!GameUtility.ForceLanguageSelection && !(GameUtility.Config_Language == "None"))
                {
                    return(false);
                }
                if (GameUtility.ForceLanguageSelection)
                {
                    GameUtility.ForceLanguageSelection = false;
                }
                return(true);

            case FlowNode_Condition.Conditions.SG_CHECK_ACCOUNT_LINK:
                return(PlayerPrefs.GetInt("AccountLinked", 0) != 1 && (MonoSingleton <GameManager> .Instance.Player.TutorialFlags & 1L) != 0L && PlayerPrefs.HasKey("LastLoginTime") && (DateTime.Now - DateTime.ParseExact(PlayerPrefs.GetString("LastLoginTime"), "O", (IFormatProvider)CultureInfo.InvariantCulture)).TotalHours > 24.0);

            case FlowNode_Condition.Conditions.SG_CHECK_ANDROID_PERMISSION:
                return(!AndroidPermissionsManager.IsPermissionGranted("android.permission.WRITE_EXTERNAL_STORAGE"));

            case FlowNode_Condition.Conditions.SG_DISK_SPACE_AVAILABLE:
                return((MonoSingleton <GameManager> .Instance.Player.TutorialFlags & 1L) != 0L || DiskUtils.CheckAvailableSpace(true) >= 500);

            case FlowNode_Condition.Conditions.SG_AUTO_BATTLE_ENABLED:
                return(GameUtility.Config_UseAutoPlay.Value);

            case FlowNode_Condition.Conditions.SG_SPEEDUP_ENABLED:
                return(PlayerPrefs.GetInt("SPEED_UP", 0) != 0);
            }
            return(false);
        }
Beispiel #9
0
        private bool Test()
        {
            PlayerData player = MonoSingleton <GameManager> .Instance.Player;

            switch (this.Condition)
            {
            case FlowNode_Condition.Conditions.QUEST_HASENOUGHSTAMINA:
                QuestParam quest1 = MonoSingleton <GameManager> .Instance.FindQuest(GlobalVars.SelectedQuestID);

                if (quest1 != null)
                {
                    return(MonoSingleton <GameManager> .Instance.Player.Stamina >= quest1.RequiredApWithPlayerLv(player.Lv, true));
                }
                break;

            case FlowNode_Condition.Conditions.FRIEND_ISFRIEND:
                SupportData supportData1;
                if ((supportData1 = this.GetSupportData()) != null)
                {
                    return(supportData1.IsFriend());
                }
                return(false);

            case FlowNode_Condition.Conditions.PARTY_LEADERSKILLAVAIL:
                PartyData dataOfClass1;
                if ((dataOfClass1 = DataSource.FindDataOfClass <PartyData>(((Component)this).get_gameObject(), (PartyData)null)) != null)
                {
                    return(this.GetLeaderSkill(dataOfClass1) != null);
                }
                break;

            case FlowNode_Condition.Conditions.FRIEND_LEADERSKILLAVAIL:
                SupportData supportData2;
                if ((supportData2 = this.GetSupportData()) != null)
                {
                    return(supportData2.LeaderSkill != null);
                }
                break;

            case FlowNode_Condition.Conditions.PARTY_LEADEREXIST:
                for (int index = 0; index < player.Partys.Count; ++index)
                {
                    if (player.Partys[index].GetUnitUniqueID(player.Partys[index].LeaderIndex) == 0L)
                    {
                        return(false);
                    }
                }
                return(true);

            case FlowNode_Condition.Conditions.TARGET_COMMANDVALID:
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null))
                {
                    return(SceneBattle.Instance.UIParam_TargetValid);
                }
                break;

            case FlowNode_Condition.Conditions.QUEST_DROPSKAKERA:
                QuestParam dataOfClass2;
                if ((dataOfClass2 = DataSource.FindDataOfClass <QuestParam>(((Component)this).get_gameObject(), (QuestParam)null)) != null && !UnityEngine.Object.op_Equality((UnityEngine.Object)QuestDropParam.Instance, (UnityEngine.Object)null))
                {
                    return(QuestDropParam.Instance.GetHardDropPiece(dataOfClass2.iname, GlobalVars.GetDropTableGeneratedDateTime()) != null);
                }
                break;

            case FlowNode_Condition.Conditions.QUEST_FIRSTTURN:
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null))
                {
                    return(SceneBattle.Instance.UnitStartCount <= 1);
                }
                break;

            case FlowNode_Condition.Conditions.QUEST_NEEDFRIENDREQUEST:
                SupportData support = (SupportData)GlobalVars.SelectedSupport;
                if (support == null || support.IsFriend())
                {
                    return(false);
                }
                FriendData friendData = player.Friends.Find((Predicate <FriendData>)(f => f.FUID == support.FUID));
                if (friendData == null)
                {
                    return(true);
                }
                return(friendData.State == FriendStates.Friend || friendData.State != FriendStates.Follow ? false : false);

            case FlowNode_Condition.Conditions.PLAYER_LEVELCHANGED:
                return((bool)GlobalVars.PlayerLevelChanged);

            case FlowNode_Condition.Conditions.NEWGAME:
                return(GameUtility.Config_NewGame.Value);

            case FlowNode_Condition.Conditions.BTLIDSET:
                return((long)GlobalVars.BtlID != 0L);

            case FlowNode_Condition.Conditions.QUEST_ISMULTIPLAY:
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null))
                {
                    return(SceneBattle.Instance.IsPlayingMultiQuest);
                }
                break;

            case FlowNode_Condition.Conditions.QUEST_ISARENA:
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null))
                {
                    return(SceneBattle.Instance.IsPlayingArenaQuest);
                }
                break;

            case FlowNode_Condition.Conditions.ARENA_RANKUP:
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null))
                {
                    return(SceneBattle.Instance.IsArenaRankupInfo());
                }
                break;

            case FlowNode_Condition.Conditions.QUEST_HASREWARD:
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null))
                {
                    return(!SceneBattle.Instance.Battle.GetQuestRecord().IsZero);
                }
                break;

            case FlowNode_Condition.Conditions.TERMSOFUSE_AGREED:
                return(MonoSingleton <GameManager> .Instance.IsAgreeTermsOfUse());

            case FlowNode_Condition.Conditions.FRIEND_VALID:
                return(this.GetSupportData() != null);

            case FlowNode_Condition.Conditions.QUEST_ENDSILENT:
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null))
                {
                    return(SceneBattle.Instance.CurrentQuest.Silent);
                }
                break;

            case FlowNode_Condition.Conditions.IS_NOT_ENOUGH_SUPPORT_COST:
                SupportData supportData3 = this.GetSupportData();
                if (supportData3 != null)
                {
                    int gold = player.Gold;
                    if (supportData3.GetCost() > gold)
                    {
                        return(true);
                    }
                    break;
                }
                break;

            case FlowNode_Condition.Conditions.MULTI_PLAY_IS_UNLOCKED:
                return(MonoSingleton <GameManager> .Instance.Player.CheckUnlock(UnlockTargets.MultiPlay));

            case FlowNode_Condition.Conditions.QUEST_IS_ENABLE_AUTOBATTLE:
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null))
                {
                    QuestParam quest2 = SceneBattle.Instance.Battle.GetQuest();
                    if (quest2 != null)
                    {
                        return(quest2.CheckAllowedAutoBattle());
                    }
                    return(false);
                }
                break;

            case FlowNode_Condition.Conditions.QUEST_IS_AUTOBATTLE:
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null))
                {
                    return(SceneBattle.Instance.Battle.IsAutoBattle);
                }
                break;

            case FlowNode_Condition.Conditions.DEBUGBUILD:
                return(GameUtility.IsDebugBuild);

            case FlowNode_Condition.Conditions.IS_BEGINNER:
                return(MonoSingleton <GameManager> .Instance.Player.IsBeginner());

            case FlowNode_Condition.Conditions.IS_END_TUTORIAL:
                return((MonoSingleton <GameManager> .Instance.Player.TutorialFlags & 1L) != 0L);

            case FlowNode_Condition.Conditions.IS_GET_UNIT:
                return(MonoSingleton <GameManager> .Instance.Player.FindUnitDataByUnitID(DataSource.FindDataOfClass <UnitParam>(((Component)this).get_gameObject(), (UnitParam)null).iname) != null);

            case FlowNode_Condition.Conditions.VERSUS_UNLOCK:
                return(MonoSingleton <GameManager> .Instance.Player.CheckUnlock(UnlockTargets.MultiVS));

            case FlowNode_Condition.Conditions.QUEST_IS_SHOW_REVIEW:
                if (!string.IsNullOrEmpty(GlobalVars.SelectedQuestID))
                {
                    QuestParam quest2 = MonoSingleton <GameManager> .Instance.FindQuest(GlobalVars.SelectedQuestID);

                    if (quest2 != null)
                    {
                        return(quest2.ShowReviewPopup);
                    }
                    break;
                }
                break;

            case FlowNode_Condition.Conditions.QUEST_IS_FIRST_CLEAR:
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null))
                {
                    return(SceneBattle.Instance.IsFirstWin);
                }
                break;

            case FlowNode_Condition.Conditions.QUEST_IS_GPS:
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null) && SceneBattle.Instance.CurrentQuest != null && SceneBattle.Instance.CurrentQuest.type == QuestTypes.Gps)
                {
                    return(true);
                }
                break;

            case FlowNode_Condition.Conditions.QUEST_IS_GPSCHAPTER_HEAD:
                if (!string.IsNullOrEmpty((string)GlobalVars.SelectedChapter))
                {
                    ChapterParam area = MonoSingleton <GameManager> .Instance.FindArea((string)GlobalVars.SelectedChapter);

                    if (area != null && area.IsGpsQuest())
                    {
                        return(area.children.Count > 0);
                    }
                    break;
                }
                break;

            case FlowNode_Condition.Conditions.QUEST_IS_GPSCHAPTER_QUEST:
                if (!string.IsNullOrEmpty((string)GlobalVars.SelectedChapter))
                {
                    ChapterParam area = MonoSingleton <GameManager> .Instance.FindArea((string)GlobalVars.SelectedChapter);

                    if (area != null)
                    {
                        return(area.IsGpsQuest());
                    }
                    break;
                }
                break;

            case FlowNode_Condition.Conditions.QUEST_IS_GPSCHAPTER_QUEST_VALID:
                if (!string.IsNullOrEmpty((string)GlobalVars.SelectedChapter))
                {
                    ChapterParam area = MonoSingleton <GameManager> .Instance.FindArea((string)GlobalVars.SelectedChapter);

                    if (area != null)
                    {
                        return(area.HasGpsQuest());
                    }
                    break;
                }
                break;

            case FlowNode_Condition.Conditions.VALID_GPSGIFT:
                return(MonoSingleton <GameManager> .Instance.Player.ValidGpsGift);

            case FlowNode_Condition.Conditions.SCENE_CHANGING:
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)HomeWindow.Current, (UnityEngine.Object)null))
                {
                    return(HomeWindow.Current.IsSceneChanging);
                }
                return(false);

            case FlowNode_Condition.Conditions.QUEST_IS_PLAY_LAST_DEMO:
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null))
                {
                    return(SceneBattle.Instance.IsPlayLastDemo);
                }
                break;

            case FlowNode_Condition.Conditions.QUEST_IS_RANKINGQUEST:
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null))
                {
                    return(SceneBattle.Instance.Battle.IsRankingQuest);
                }
                break;

            case FlowNode_Condition.Conditions.QUEST_IS_RANKINGQUEST_NEWSCORE:
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null))
                {
                    return(SceneBattle.Instance.IsRankingQuestNewScore);
                }
                break;

            case FlowNode_Condition.Conditions.QUEST_IS_RANKINGQUEST_JOIN_REWARD:
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null))
                {
                    return(SceneBattle.Instance.IsRankingQuestJoinReward);
                }
                break;

            case FlowNode_Condition.Conditions.QUEST_IS_RANKINGQUEST_RESULT_VALIDRANK:
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null))
                {
                    return(SceneBattle.Instance.ValidateRankingQuestRank);
                }
                break;

            case FlowNode_Condition.Conditions.DIFFERENT_VERSION:
                string version = MyApplicationPlugin.get_version();
                string strB    = PlayerPrefsUtility.GetString(PlayerPrefsUtility.AWAKE_VERSION, string.Empty);
                PlayerPrefsUtility.SetString(PlayerPrefsUtility.AWAKE_VERSION, version, true);
                return(string.Compare(version, strB) != 0);

            case FlowNode_Condition.Conditions.SELECTQUEST_IS_MULTIGPS:
                if (!string.IsNullOrEmpty(GlobalVars.SelectedQuestID))
                {
                    QuestParam quest2 = MonoSingleton <GameManager> .Instance.FindQuest(GlobalVars.SelectedQuestID);

                    if (quest2 != null)
                    {
                        return(quest2.IsMultiAreaQuest);
                    }
                    break;
                }
                break;

            case FlowNode_Condition.Conditions.LINEQUEST_IS_MULTIGPS:
                if (!string.IsNullOrEmpty(FlowNode_OnUrlSchemeLaunch.LINEParam_Pending.iname))
                {
                    QuestParam quest2 = MonoSingleton <GameManager> .Instance.FindQuest(FlowNode_OnUrlSchemeLaunch.LINEParam_Pending.iname);

                    if (quest2 != null)
                    {
                        return(quest2.IsMultiAreaQuest);
                    }
                    break;
                }
                break;

            case FlowNode_Condition.Conditions.GPSQUEST_IS_VALID:
                return(MonoSingleton <GameManager> .Instance.IsValidAreaQuest());

            case FlowNode_Condition.Conditions.MULTI_GPSQUEST_IS_VALID:
                return(MonoSingleton <GameManager> .Instance.IsValidMultiAreaQuest());

            case FlowNode_Condition.Conditions.QUEST_IS_ORDEAL:
                if (UnityEngine.Object.op_Implicit((UnityEngine.Object)SceneBattle.Instance))
                {
                    return(SceneBattle.Instance.IsOrdealQuest);
                }
                break;

            case FlowNode_Condition.Conditions.QUEST_IS_GET_UNIT:
                if (UnityEngine.Object.op_Implicit((UnityEngine.Object)SceneBattle.Instance))
                {
                    return(SceneBattle.Instance.IsGetFirstClearItem);
                }
                break;

            case FlowNode_Condition.Conditions.VALID_FIRST_CHARGE_CAMPAIGN:
                if ((byte)MonoSingleton <GameManager> .Instance.Player.FirstChargeStatus != (byte)1)
                {
                    return((byte)MonoSingleton <GameManager> .Instance.Player.FirstChargeStatus == (byte)2);
                }
                return(true);

            case FlowNode_Condition.Conditions.GUERRILLASHOP_IS_STARTED:
                return(MonoSingleton <GameManager> .Instance.Player.IsGuerrillaShopStarted);

            case FlowNode_Condition.Conditions.QUEST_END_CARD_IS_SENDMAIL:
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null))
                {
                    return(SceneBattle.Instance.IsCardSendMail);
                }
                break;

            case FlowNode_Condition.Conditions.TOWER_QUEST_HAVE_MISSION:
                QuestParam quest3 = MonoSingleton <GameManager> .Instance.FindQuest(GlobalVars.SelectedQuestID);

                if (quest3 != null && quest3.HasMission())
                {
                    return(true);
                }
                break;

            case FlowNode_Condition.Conditions.SHOW_BEGINNER_TOP_NOTIFY:
                if (player.IsBeginner() && PlayerPrefsUtility.GetInt(PlayerPrefsUtility.BEGINNER_TOP_HAS_VISITED, 0) == 0)
                {
                    return(true);
                }
                break;
            }
            return(false);
        }
 private void SetFriendData(FriendData data)
 {
     this.m_FriendData = data;
 }
Beispiel #11
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();
                }
            }
        }