public bool Equals(RoomConnectionStateData other)
 {
     return(localUser == other.localUser &&
            EnumerableExtension.SafeSequenceEquals(users, other.users) &&
            vivoxManager == other.vivoxManager &&
            userToMute == other.userToMute);
 }
コード例 #2
0
        void OnConnectionStateChanged(RoomConnectionStateData connectionState)
        {
            var userIds = connectionState.users.Select(u => u.matchmakerId);

            if (EnumerableExtension.SafeSequenceEquals(m_UserIds, userIds))
            {
                m_UserIds = userIds;
                m_CollaboratorsList.UpdateUserList(m_UserIds.ToArray());
            }
        }
        void OnUsersChanged(List <NetworkUserData> users)
        {
            var userIds = users.Select(u => u.matchmakerId);

            if (!EnumerableExtension.SafeSequenceEquals(m_UserIds, userIds))
            {
                m_UserIds = new List <string>(userIds);
                m_CollaboratorsList.UpdateUserList(m_UserIds.ToArray());
            }

            m_CollaboratorsList.UpdateUsers(m_UserIds.ToArray());
        }
コード例 #4
0
        void OnSessionStateDataChanged(UISessionStateData data)
        {
            if (m_LoginState != data.sessionState.loggedState)
            {
                switch (data.sessionState.loggedState)
                {
                case LoginState.LoggedIn:
                    UIStateManager.current.Dispatcher.Dispatch(
                        Payload <ActionTypes> .From(ActionTypes.OpenDialog, DialogType.LandingScreen));
                    m_WelcomePanel.SetActive(false);
                    m_NoProjectPanel.SetActive(false);
                    m_FetchingProjectsPanel.SetActive(true);
                    m_RefreshButton.gameObject.SetActive(true);
                    break;

                case LoginState.LoggedOut:
                    ClearProjectListItem();
                    UIStateManager.current.Dispatcher.Dispatch(
                        Payload <ActionTypes> .From(ActionTypes.OpenDialog, DialogType.LandingScreen));
                    UIStateManager.current.Dispatcher.Dispatch(Payload <ActionTypes> .From(ActionTypes.CloseProject,
                                                                                           UIStateManager.current.projectStateData.activeProject));
                    m_WelcomePanel.SetActive(true);
                    m_NoProjectPanel.SetActive(false);
                    m_FetchingProjectsPanel.SetActive(false);
                    m_RefreshButton.gameObject.SetActive(false);
                    break;

                case LoginState.LoggingIn:
                case LoginState.LoggingOut:
                    // todo put spinner
                    break;
                }

                m_LoginState = data.sessionState.loggedState;
            }

            if (m_LoginState == LoginState.LoggedIn)
            {
                if (m_Projects != data.sessionState.projects && !EnumerableExtension.SafeSequenceEquals(m_Projects, data.sessionState.projects))
                {
                    InstantiateProjectItems(data.sessionState.projects);
                    m_Projects = data.sessionState.projects;
                }
                else if (UIStateManager.current.stateData.progressData.progressState == ProgressData.ProgressState.NoPendingRequest && data.sessionState.projects.Length == 0)
                {
                    m_NoProjectPanel.SetActive(true);
                    m_FetchingProjectsPanel.SetActive(false);
                }
            }
        }
コード例 #5
0
 public bool Equals(ProjectRoom other)
 {
     return
         (this.project == other.project &&
          EnumerableExtension.SafeSequenceEquals(users, other.users));
 }
コード例 #6
0
        void OnSessionStateDataChanged(UISessionStateData data)
        {
            if (m_LoginState != data.sessionState.loggedState)
            {
                switch (data.sessionState.loggedState)
                {
                case LoginState.LoggedIn:
                    m_NoProjectPanel.SetActive(false);
                    m_FetchingProjectsPanel.SetActive(true);
                    break;

                case LoginState.LoggedOut:
                    ClearProjectListItem();
                    m_NoProjectPanel.SetActive(false);
                    m_FetchingProjectsPanel.SetActive(false);
                    break;

                case LoginState.LoggingIn:
                case LoginState.LoggingOut:
                    // todo put spinner
                    break;
                }

                m_LoginState = data.sessionState.loggedState;
            }

            if (m_LoginState == LoginState.LoggedIn)
            {
                // Display Cloud environment debug info when it's not "Production"
                var environmentInfo = LocaleUtils.GetEnvironmentInfo();
                if (environmentInfo.cloudEnvironment != CloudEnvironment.Production)
                {
                    m_CloudSettingDebugInfo.gameObject.SetActive(true);

                    if (environmentInfo.cloudEnvironment == CloudEnvironment.Other)
                    {
                        if (PlayerPrefs.HasKey(LocaleUtils.SettingsKeys.CloudEnvironment))
                        {
                            m_CloudSettingDebugInfo.text = $"Environment: {environmentInfo.customUrl}";
                        }
                        else
                        {
                            m_CloudSettingDebugInfo.text =
                                $"Environment: {ProjectServerClient.ProjectServerAddress(environmentInfo.provider)}";
                        }
                    }
                    else
                    {
                        m_CloudSettingDebugInfo.text = $"Environment: {environmentInfo.cloudEnvironment}";
                    }
                }
                else
                {
                    m_CloudSettingDebugInfo.gameObject.SetActive(false);
                }

                UpdateProjectItems(data.sessionState.rooms);

                if (m_Rooms != data.sessionState.rooms || !EnumerableExtension.SafeSequenceEquals(m_Rooms, data.sessionState.rooms))
                {
                    m_Rooms = data.sessionState.rooms;
                }
                else if (HasNoProjectsAvailable())
                {
                    m_NoProjectPanel.SetActive(true);
                    m_FetchingProjectsPanel.SetActive(false);
                }
            }
        }
コード例 #7
0
        void OnProjectStateDataChanged(UIProjectStateData data)
        {
            if (!EnumerableExtension.SafeSequenceEquals(data.filterGroupList, m_CurrentFilterGroupList))
            {
                // fill filter group Dropdown
                m_FilterGroupDropdown.options.Clear();

                if (data.filterGroupList.Count == 0)
                {
                    // show no data
                    ClearFilterList();
                    m_FilterGroupDropdown.interactable = false;
                    m_FilterGroupDropdown.options.Add(k_NoCategoryOption);
                    m_NoDataText.gameObject.SetActive(true);
                    m_DropdownMask.SetActive(true);
                }
                else
                {
                    m_FilterGroupDropdown.interactable = true;
                    m_NoDataText.gameObject.SetActive(false);
                    m_DropdownMask.SetActive(false);

                    var filterGroupList = data.filterGroupList;
                    foreach (string group in filterGroupList)
                    {
                        m_FilterGroupDropdown.options.Add(new TMP_Dropdown.OptionData(group));
                    }

                    // default select index = 0,
                    StartCoroutine(SetDefaultGroup());
                }
                m_CurrentFilterGroupList = data.filterGroupList;
            }

            if (!EnumerableExtension.SafeSequenceEquals(data.filterItemInfos, m_CurrentFilterKeys))
            {
                ClearFilterList();
                foreach (var filterItemInfo in data.filterItemInfos)
                {
                    CreateFilterListItem(filterItemInfo);
                }

                m_CurrentFilterKeys = data.filterItemInfos;
            }

            if (data.lastChangedFilterItem != m_LastChangedFilterItem)
            {
                var filterItemInfo = data.lastChangedFilterItem;
                var filterListItem = m_ActiveFilterListItem.SingleOrDefault(e =>
                                                                            e.groupKey == filterItemInfo.groupKey && e.filterKey == filterItemInfo.filterKey);

                if (filterListItem != null)
                {
                    filterListItem.SetVisible(filterItemInfo.visible);
                }

                m_LastChangedFilterItem = data.lastChangedFilterItem;
            }

            if (data.highlightFilter != m_CurrentHighlightFilter)
            {
                var filterListItem = m_ActiveFilterListItem.SingleOrDefault(e =>
                                                                            e.groupKey == m_CurrentHighlightFilter.groupKey &&
                                                                            e.filterKey == m_CurrentHighlightFilter.filterKey);
                if (filterListItem != null)
                {
                    filterListItem.SetHighlight(false);
                }

                filterListItem = m_ActiveFilterListItem.SingleOrDefault(e =>
                                                                        e.groupKey == data.highlightFilter.groupKey && e.filterKey == data.highlightFilter.filterKey);
                if (filterListItem != null)
                {
                    filterListItem.SetHighlight(true);
                }

                m_CurrentHighlightFilter = data.highlightFilter;
            }
        }
コード例 #8
0
 public bool Equals(RoomConnectionStateData other)
 {
     return(localUser == other.localUser &&
            EnumerableExtension.SafeSequenceEquals(users, other.users));
 }