예제 #1
0
 private IEnumerator CreateMembersOnResume()
 {
     if (MonoBehaviourSingleton <LoungeMatchingManager> .I.loungeData != null)
     {
         List <LoungeModel.SlotInfo> slots = MonoBehaviourSingleton <LoungeMatchingManager> .I.loungeData.slotInfos;
         for (int i = 0; i < slots.Count; i++)
         {
             if (slots[i].userInfo != null)
             {
                 int userId = slots[i].userInfo.userId;
                 if (userId != MonoBehaviourSingleton <UserInfoManager> .I.userInfo.id && MonoBehaviourSingleton <LoungeMatchingManager> .I.loungeMemberStatus != null)
                 {
                     LoungeMemberStatus status = MonoBehaviourSingleton <LoungeMatchingManager> .I.loungeMemberStatus[userId];
                     if (status != null)
                     {
                         LoungeMemberStatus.MEMBER_STATUS partyStatus = status.GetStatus();
                         if (partyStatus == LoungeMemberStatus.MEMBER_STATUS.LOUNGE || partyStatus == LoungeMemberStatus.MEMBER_STATUS.QUEST_READY)
                         {
                             HomePeople.CreateLoungePlayer(slots[i], false, true);
                             yield return((object)null);
                         }
                     }
                 }
             }
         }
     }
 }
예제 #2
0
    private void UpdateLoungeUI()
    {
        if (!CheckExistTarget())
        {
            DispatchEvent("NON_TARGET_PLAYER", null);
        }
        else
        {
            int ownerUserId = MonoBehaviourSingleton <LoungeMatchingManager> .I.GetOwnerUserId();

            bool is_visible = ownerUserId == MonoBehaviourSingleton <UserInfoManager> .I.userInfo.id;
            SetActive((Enum)UI.BTN_KICK, is_visible);
            if (MonoBehaviourSingleton <LoungeMatchingManager> .I.loungeMemberStatus != null)
            {
                SetActive((Enum)UI.BTN_JOIN, false);
                status = MonoBehaviourSingleton <LoungeMatchingManager> .I.loungeMemberStatus[data.userId];
                switch (status.GetStatus())
                {
                case LoungeMemberStatus.MEMBER_STATUS.QUEST_READY:
                case LoungeMemberStatus.MEMBER_STATUS.FIELD:
                    SetActive((Enum)UI.BTN_JOIN, true);
                    break;

                case LoungeMemberStatus.MEMBER_STATUS.QUEST:
                    SetActive((Enum)UI.BTN_JOIN, !CheckRush(status.questId));
                    break;

                case LoungeMemberStatus.MEMBER_STATUS.ARENA:
                    SetActive((Enum)UI.BTN_JOIN, false);
                    break;
                }
            }
        }
    }
예제 #3
0
    private void DestoryMembersOnResume()
    {
        if (!(HomePeople == null) && HomePeople.loungePlayers != null)
        {
            for (int i = 0; i < HomePeople.loungePlayers.Count; i++)
            {
                int userId = HomePeople.loungePlayers[i].GetUserId();
                if (userId != 0)
                {
                    LoungeModel.SlotInfo slotInfoByUserId = MonoBehaviourSingleton <LoungeMatchingManager> .I.GetSlotInfoByUserId(userId);

                    if (slotInfoByUserId == null)
                    {
                        HomePeople.DestroyLoungePlayer(userId);
                    }
                    else if (MonoBehaviourSingleton <LoungeMatchingManager> .I.loungeMemberStatus != null)
                    {
                        LoungeMemberStatus loungeMemberStatus   = MonoBehaviourSingleton <LoungeMatchingManager> .I.loungeMemberStatus[userId];
                        LoungeMemberStatus.MEMBER_STATUS status = loungeMemberStatus.GetStatus();
                        if (status == LoungeMemberStatus.MEMBER_STATUS.QUEST || status == LoungeMemberStatus.MEMBER_STATUS.FIELD)
                        {
                            HomePeople.DestroyLoungePlayer(userId);
                        }
                    }
                }
            }
        }
    }
예제 #4
0
    private void OnChangeMemberStatus(LoungeMemberStatus status)
    {
        //IL_006e: Unknown result type (might be due to invalid IL or missing references)
        int userId = status.userId;

        switch (status.GetStatus())
        {
        case LoungeMemberStatus.MEMBER_STATUS.QUEST_READY:
            if (status.isHost)
            {
                CreatePartyAnnounce(userId);
            }
            break;

        case LoungeMemberStatus.MEMBER_STATUS.QUEST:
        case LoungeMemberStatus.MEMBER_STATUS.FIELD:
        case LoungeMemberStatus.MEMBER_STATUS.ARENA:
            HomePeople.DestroyLoungePlayer(userId);
            break;

        case LoungeMemberStatus.MEMBER_STATUS.LOUNGE:
            SendRoomPosition(userId);
            NeedLoungeQuestBalloonUpdate = true;
            this.StartCoroutine(CreatePlayerOnChangedStatus(userId));
            break;
        }
    }
    private void OnQuery_JOIN()
    {
        int       index     = (int)GameSection.GetEventData();
        CharaInfo charaInfo = memberInfo[index];

        if (MonoBehaviourSingleton <LoungeMatchingManager> .I.loungeMemberStatus != null)
        {
            LoungeMemberStatus loungeMemberStatus = MonoBehaviourSingleton <LoungeMatchingManager> .I.loungeMemberStatus[charaInfo.userId];
            switch (loungeMemberStatus.GetStatus())
            {
            case LoungeMemberStatus.MEMBER_STATUS.LOUNGE:
                OnQuery_MAIN_MENU_LOUNGE();
                break;

            case LoungeMemberStatus.MEMBER_STATUS.QUEST_READY:
            case LoungeMemberStatus.MEMBER_STATUS.QUEST:
                JoinParty(loungeMemberStatus.partyId);
                break;

            case LoungeMemberStatus.MEMBER_STATUS.FIELD:
                JoinField(loungeMemberStatus.fieldMapId);
                break;
            }
        }
    }
    private void SetPlayingStatus(Transform root, int userId)
    {
        SetActive(root, UI.OBJ_LOUNGE, false);
        SetActive(root, UI.OBJ_FIELD, false);
        SetActive(root, UI.OBJ_QUEST, false);
        if (MonoBehaviourSingleton <LoungeMatchingManager> .I.loungeMemberStatus != null)
        {
            LoungeMemberStatus loungeMemberStatus = MonoBehaviourSingleton <LoungeMatchingManager> .I.loungeMemberStatus[userId];
            if (loungeMemberStatus != null)
            {
                switch (loungeMemberStatus.GetStatus())
                {
                case LoungeMemberStatus.MEMBER_STATUS.LOUNGE:
                    SetActive(root, UI.OBJ_LOUNGE, true);
                    break;

                case LoungeMemberStatus.MEMBER_STATUS.QUEST:
                    SetQuestInfo(root, loungeMemberStatus.questId);
                    SetActive(root, UI.BTN_JOIN, !CheckRush(loungeMemberStatus.questId));
                    SetActive(root, UI.LBL_PLAYING_QUEST, true);
                    SetActive(root, UI.LBL_PLAYING_READY, false);
                    break;

                case LoungeMemberStatus.MEMBER_STATUS.QUEST_READY:
                    SetQuestInfo(root, loungeMemberStatus.questId);
                    SetActive(root, UI.LBL_PLAYING_QUEST, false);
                    SetActive(root, UI.LBL_PLAYING_READY, true);
                    break;

                case LoungeMemberStatus.MEMBER_STATUS.FIELD:
                {
                    SetActive(root, UI.OBJ_FIELD, true);
                    FieldMapTable.FieldMapTableData fieldMapData = Singleton <FieldMapTable> .I.GetFieldMapData((uint)loungeMemberStatus.fieldMapId);

                    if (fieldMapData == null)
                    {
                        SetLabelText(root, UI.LBL_AREA_NAME, string.Empty);
                    }
                    else
                    {
                        RegionTable.Data data = Singleton <RegionTable> .I.GetData(fieldMapData.regionId);

                        if (data == null)
                        {
                            SetLabelText(root, UI.LBL_AREA_NAME, fieldMapData.mapName);
                        }
                        else
                        {
                            SetLabelText(root, UI.LBL_AREA_NAME, data.regionName + " - " + fieldMapData.mapName);
                        }
                    }
                    break;
                }
                }
            }
        }
    }
예제 #7
0
    private void OnQuery_JOIN()
    {
        switch (status.GetStatus())
        {
        case LoungeMemberStatus.MEMBER_STATUS.QUEST_READY:
        case LoungeMemberStatus.MEMBER_STATUS.QUEST:
            JoinParty(status.partyId);
            break;

        case LoungeMemberStatus.MEMBER_STATUS.FIELD:
            JoinField(status.fieldMapId);
            break;
        }
    }
예제 #8
0
    private void OnQuery_JOIN_MAP()
    {
        int num    = (int)GameSection.GetEventData();
        int userId = rallyInvites[num].userInfo.userId;
        LoungeMemberStatus loungeMemberStatus = MonoBehaviourSingleton <LoungeMatchingManager> .I.loungeMemberStatus[userId];

        switch (loungeMemberStatus.GetStatus())
        {
        case LoungeMemberStatus.MEMBER_STATUS.QUEST_READY:
        case LoungeMemberStatus.MEMBER_STATUS.QUEST:
            JoinParty(loungeMemberStatus.partyId, loungeMemberStatus.questId);
            break;

        case LoungeMemberStatus.MEMBER_STATUS.FIELD:
            JoinField(loungeMemberStatus.fieldMapId);
            break;
        }
    }
예제 #9
0
 public void OnRecvMemberMoveArena(Lounge_Model_MemberArena model)
 {
     if (this.loungeMemberStatus != null)
     {
         LoungeMemberStatus loungeMemberStatus   = this.loungeMemberStatus[model.cid];
         LoungeMemberStatus.MEMBER_STATUS status = loungeMemberStatus.GetStatus();
         loungeMemberStatus.ToArena(model.aid);
         if (loungeMemberStatus != null)
         {
             OnChangeMemberStatus.SafeInvoke(loungeMemberStatus);
             if (MonoBehaviourSingleton <LoungeNetworkManager> .IsValid())
             {
                 MonoBehaviourSingleton <LoungeNetworkManager> .I.MoveLoungeNotification(status, loungeMemberStatus);
             }
         }
         AFKCheck();
     }
 }
예제 #10
0
 public void OnRecvMemberMoveQuest(Lounge_Model_MemberQuest model)
 {
     if (this.loungeMemberStatus != null)
     {
         LoungeMemberStatus loungeMemberStatus   = this.loungeMemberStatus[model.cid];
         LoungeMemberStatus.MEMBER_STATUS status = loungeMemberStatus.GetStatus();
         if (loungeMemberStatus != null)
         {
             loungeMemberStatus.ToQuest(model.pid.ToString(), model.qid, model.h);
             OnChangeMemberStatus.SafeInvoke(loungeMemberStatus);
             if (MonoBehaviourSingleton <LoungeNetworkManager> .IsValid())
             {
                 MonoBehaviourSingleton <LoungeNetworkManager> .I.MoveLoungeNotification(status, loungeMemberStatus);
             }
         }
         AFKCheck();
     }
 }
예제 #11
0
 public void OnRecvMemberMoveLounge(int userId)
 {
     if (this.loungeMemberStatus != null)
     {
         LoungeMemberStatus loungeMemberStatus   = this.loungeMemberStatus[userId];
         LoungeMemberStatus.MEMBER_STATUS status = loungeMemberStatus.GetStatus();
         if (loungeMemberStatus != null)
         {
             loungeMemberStatus.ToLounge();
             OnChangeMemberStatus.SafeInvoke(loungeMemberStatus);
             if (MonoBehaviourSingleton <LoungeNetworkManager> .IsValid())
             {
                 MonoBehaviourSingleton <LoungeNetworkManager> .I.MoveLoungeNotification(status, loungeMemberStatus);
             }
         }
         AFKCheck();
     }
 }
예제 #12
0
 private IEnumerator CreateLoungePlayerFromSlotInfo()
 {
     if (MonoBehaviourSingleton <LoungeMatchingManager> .I.loungeData != null)
     {
         List <LoungeModel.SlotInfo> data = MonoBehaviourSingleton <LoungeMatchingManager> .I.loungeData.slotInfos;
         for (int i = 0; i < data.Count; i++)
         {
             if (data[i].userInfo != null && data[i].userInfo.userId != MonoBehaviourSingleton <UserInfoManager> .I.userInfo.id)
             {
                 if (MonoBehaviourSingleton <LoungeMatchingManager> .I.loungeMemberStatus == null)
                 {
                     break;
                 }
                 LoungeMemberStatus status = MonoBehaviourSingleton <LoungeMatchingManager> .I.loungeMemberStatus[data[i].userInfo.userId];
                 LoungeMemberStatus.MEMBER_STATUS partyStatus = status.GetStatus();
                 if (partyStatus == LoungeMemberStatus.MEMBER_STATUS.LOUNGE || partyStatus == LoungeMemberStatus.MEMBER_STATUS.QUEST_READY)
                 {
                     HomePeople.CreateLoungePlayer(data[i], false, false);
                     yield return((object)null);
                 }
             }
         }
     }
 }
예제 #13
0
    public void MoveLoungeNotification(LoungeMemberStatus.MEMBER_STATUS beforeStatus, LoungeMemberStatus after)
    {
        if (MonoBehaviourSingleton <LoungeMatchingManager> .I.IsUserInLounge(after.userId))
        {
            LoungeMemberStatus.MEMBER_STATUS status           = after.GetStatus();
            LoungeModel.SlotInfo             slotInfoByUserId = MonoBehaviourSingleton <LoungeMatchingManager> .I.GetSlotInfoByUserId(after.userId);

            switch (beforeStatus)
            {
            case LoungeMemberStatus.MEMBER_STATUS.LOUNGE:
                switch (status)
                {
                case LoungeMemberStatus.MEMBER_STATUS.QUEST:
                    break;

                case LoungeMemberStatus.MEMBER_STATUS.QUEST_READY:
                    if (after.isHost)
                    {
                        chatConnection.OnReceiveNotification(StringTable.Format(STRING_CATEGORY.LOUNGE, 14u, slotInfoByUserId.userInfo.name));
                    }
                    break;

                case LoungeMemberStatus.MEMBER_STATUS.FIELD:
                    chatConnection.OnReceiveNotification(StringTable.Format(STRING_CATEGORY.LOUNGE, 15u, slotInfoByUserId.userInfo.name));
                    break;

                case LoungeMemberStatus.MEMBER_STATUS.ARENA:
                    chatConnection.OnReceiveNotification(StringTable.Format(STRING_CATEGORY.LOUNGE, 20u, slotInfoByUserId.userInfo.name));
                    break;
                }
                break;

            case LoungeMemberStatus.MEMBER_STATUS.QUEST_READY:
                if (status == LoungeMemberStatus.MEMBER_STATUS.QUEST)
                {
                    chatConnection.OnReceiveNotification(StringTable.Format(STRING_CATEGORY.LOUNGE, 16u, slotInfoByUserId.userInfo.name));
                }
                break;

            case LoungeMemberStatus.MEMBER_STATUS.QUEST:
                if (status == LoungeMemberStatus.MEMBER_STATUS.LOUNGE)
                {
                    chatConnection.OnReceiveNotification(StringTable.Format(STRING_CATEGORY.LOUNGE, 17u, slotInfoByUserId.userInfo.name));
                }
                break;

            case LoungeMemberStatus.MEMBER_STATUS.ARENA:
                if (status == LoungeMemberStatus.MEMBER_STATUS.LOUNGE)
                {
                    chatConnection.OnReceiveNotification(StringTable.Format(STRING_CATEGORY.LOUNGE, 21u, slotInfoByUserId.userInfo.name));
                }
                break;

            default:
                if (status == LoungeMemberStatus.MEMBER_STATUS.LOUNGE)
                {
                    chatConnection.OnReceiveNotification(StringTable.Format(STRING_CATEGORY.LOUNGE, 18u, slotInfoByUserId.userInfo.name));
                }
                break;
            }
        }
    }