Exemplo n.º 1
0
 private void SortByPreviouslyPlayed(MpGameRow row)
 {
     if (row._previousPlayed)
     {
         row.name += "0";
     }
     else
     {
         row.name += "1";
     }
 }
Exemplo n.º 2
0
    private void SortByNotSecure(MpGameRow row)
    {
        MpDedicatedServerRow mpDedicatedServerRow = (MpDedicatedServerRow)row;

        if (mpDedicatedServerRow)
        {
            if (!mpDedicatedServerRow._VACProtected)
            {
                MpDedicatedServerRow mpDedicatedServerRow2 = mpDedicatedServerRow;
                mpDedicatedServerRow2.name += "0";
            }
            else
            {
                MpDedicatedServerRow mpDedicatedServerRow3 = mpDedicatedServerRow;
                mpDedicatedServerRow3.name += "1";
            }
        }
    }
Exemplo n.º 3
0
    private void SortByNoVersionMismatch(MpGameRow row)
    {
        MpDedicatedServerRow mpDedicatedServerRow = (MpDedicatedServerRow)row;

        if (mpDedicatedServerRow)
        {
            if (!mpDedicatedServerRow._versionMismatch)
            {
                MpDedicatedServerRow mpDedicatedServerRow2 = mpDedicatedServerRow;
                mpDedicatedServerRow2.name += "0";
            }
            else
            {
                MpDedicatedServerRow mpDedicatedServerRow3 = mpDedicatedServerRow;
                mpDedicatedServerRow3.name += "1";
            }
        }
    }
Exemplo n.º 4
0
    private void SortByPasswordProtected(MpGameRow row)
    {
        MpDedicatedServerRow mpDedicatedServerRow = (MpDedicatedServerRow)row;

        if (mpDedicatedServerRow)
        {
            if (mpDedicatedServerRow._passwordProtected)
            {
                MpDedicatedServerRow mpDedicatedServerRow2 = mpDedicatedServerRow;
                mpDedicatedServerRow2.name += "0";
            }
            else
            {
                MpDedicatedServerRow mpDedicatedServerRow3 = mpDedicatedServerRow;
                mpDedicatedServerRow3.name += "1";
            }
        }
    }
Exemplo n.º 5
0
    private void SortByNoPlayers(MpGameRow row)
    {
        MpDedicatedServerRow mpDedicatedServerRow = (MpDedicatedServerRow)row;

        if (mpDedicatedServerRow)
        {
            if (mpDedicatedServerRow.Server.m_nPlayers == 0)
            {
                MpDedicatedServerRow mpDedicatedServerRow2 = mpDedicatedServerRow;
                mpDedicatedServerRow2.name += "0";
            }
            else
            {
                MpDedicatedServerRow mpDedicatedServerRow3 = mpDedicatedServerRow;
                mpDedicatedServerRow3.name += "1";
            }
        }
    }
Exemplo n.º 6
0
    private void UpdateGameBrowser()
    {
        bool flag = false;

        if (CoopLobby.IsInLobby)
        {
            this.OpenScreen(CoopSteamNGUI.Screens.Lobby);
            this._lobbyScreen._gameNameLabel.text = StringEx.TryFormat(UiTranslationDatabase.TranslateKey("LOBBY_GAME_NAME", "LOBBY: {0}", this._allCapsTexts), new object[]
            {
                CoopLobby.Instance.Info.Name.ToUpperInvariant()
            });
            return;
        }
        this._lobbies = (from l in this._lobbies
                         where l != null && CoopLobbyManager.Lobbies.Any((CoopLobbyInfo al) => al.LobbyId.m_SteamID == l.LobbyId.m_SteamID)
                         select l).ToList <CoopLobbyInfo>();
        IEnumerable <CoopLobbyInfo> enumerable = (from nl in CoopLobbyManager.Lobbies
                                                  where !string.IsNullOrEmpty(nl.Name) && (this._allowLegacyGames || !string.IsNullOrEmpty(nl.Guid)) && !nl.IsOwner && !this._lobbies.Any((CoopLobbyInfo l) => nl.LobbyId.m_SteamID == l.LobbyId.m_SteamID)
                                                  select nl).Take(5);

        if (enumerable != null && enumerable.Any <CoopLobbyInfo>())
        {
            Vector3 localScale = this._gameBrowserScreen._rowPrefab.transform.localScale;
            foreach (CoopLobbyInfo coopLobbyInfo in enumerable)
            {
                MpGameRow mpGameRow = UnityEngine.Object.Instantiate <MpGameRow>(this._gameBrowserScreen._rowPrefab);
                mpGameRow.transform.parent     = this._gameBrowserScreen._grid.transform;
                mpGameRow.transform.localScale = localScale;
                mpGameRow._gameName.text       = coopLobbyInfo.Name;
                mpGameRow._lobby            = coopLobbyInfo;
                mpGameRow._playerLimit.text = StringEx.TryFormat("{0} / {1}", new object[]
                {
                    coopLobbyInfo.CurrentMembers,
                    coopLobbyInfo.MemberLimit
                });
                this._gameRows[coopLobbyInfo] = mpGameRow;
                mpGameRow._previousPlayed     = this._previouslyPlayedServers.Contains(mpGameRow._lobby.Guid);
                bool flag2 = false;
                if (mpGameRow._prefabDbVersionMissmatch)
                {
                    flag2 = ("E3C26D06F07B6AB14EC25F4823E9A30D6B4ED0450527C1E768739D96C9F061AE" != coopLobbyInfo.PrefabDbVersion);
                    if (mpGameRow._prefabDbVersionMissmatch.activeSelf != flag2)
                    {
                        mpGameRow._prefabDbVersionMissmatch.SetActive(flag2);
                    }
                }
                if (mpGameRow._previousPlayed)
                {
                    mpGameRow.name = ((!flag2) ? "00" : "01");
                    if (mpGameRow._newButtonLabel.transform.parent.gameObject.activeSelf != !flag2)
                    {
                        mpGameRow._newButtonLabel.transform.parent.gameObject.SetActive(!flag2);
                    }
                    mpGameRow._continueButtonLabel.text = "Continue";
                }
                else
                {
                    if (mpGameRow._newButtonLabel.transform.parent.gameObject.activeSelf)
                    {
                        mpGameRow._newButtonLabel.transform.parent.gameObject.SetActive(false);
                    }
                    mpGameRow.name = ((!flag2) ? "10" : "11");
                }
                if (mpGameRow._continueButtonLabel.transform.parent.gameObject.activeSelf != !flag2)
                {
                    mpGameRow._continueButtonLabel.transform.parent.gameObject.SetActive(!flag2);
                }
                MpGameRow mpGameRow2 = mpGameRow;
                mpGameRow2.name += coopLobbyInfo.Name.Substring(0, 6);
            }
            this._lobbies = this._lobbies.Union(enumerable).ToList <CoopLobbyInfo>();
            flag          = true;
        }
        bool flag3 = !string.IsNullOrEmpty(this._browserFilter);

        foreach (MpGameRow mpGameRow3 in this._gameRows.Values)
        {
            if (flag3)
            {
                bool flag4 = mpGameRow3._lobby.Name.ToLowerInvariant().Contains(this._browserFilter);
                if (mpGameRow3.gameObject.activeSelf != flag4)
                {
                    mpGameRow3.transform.parent = ((!flag4) ? this._gameBrowserScreen._grid.transform.parent : this._gameBrowserScreen._grid.transform);
                    mpGameRow3.gameObject.SetActive(flag4);
                    flag = true;
                }
            }
            else if (!mpGameRow3.gameObject.activeSelf)
            {
                mpGameRow3.transform.parent = this._gameBrowserScreen._grid.transform;
                mpGameRow3.gameObject.SetActive(true);
                flag = true;
            }
        }
        if (flag)
        {
            this._gameBrowserScreen._grid.Reposition();
            this._gameBrowserScreen._scrollview.UpdateScrollbars();
            this._gameBrowserScreen._scrollview.verticalScrollBar.value = 1f;
            this._gameBrowserScreen._scrollview.verticalScrollBar.value = 0f;
            if (this._gameBrowserScreen._firstSelectControl && this._gameBrowserScreen._grid.transform.childCount > 0)
            {
                this._gameBrowserScreen._firstSelectControl.ObjectToBeSelected = this._gameBrowserScreen._grid.GetChild(0).GetComponent <MpGameRow>()._continueButtonLabel.transform.parent.gameObject;
            }
        }
    }