コード例 #1
0
 // Token: 0x06000058 RID: 88 RVA: 0x00006618 File Offset: 0x00004818
 private void PlayerTabUpdate(int CheckResult)
 {
     this.ListViewPlayers.Items.Clear();
     foreach (SteamData.Player player in SteamData.PlayerList)
     {
         string[] array = new string[2];
         array[0] = player.name;
         int   num     = 1;
         ulong steamId = player.steamId;
         array[num] = steamId.ToString();
         ListViewItem listViewItem = new ListViewItem(array);
         if (CheckResult == 2 && InternalConfig.Restricted)
         {
             listViewItem.SubItems[1].Text = "Private";
         }
         if (player.steamId == SteamData.LobbyHost.steamId)
         {
             listViewItem.ForeColor = Color.Magenta;
         }
         else if (CurrentLobbyUI.CheckFriend(player.steamId))
         {
             listViewItem.ForeColor = Color.Green;
         }
         else if (CurrentLobbyUI.CheckBan(player.steamId))
         {
             listViewItem.ForeColor = Color.Red;
         }
         this.ListViewPlayers.Items.Add(listViewItem);
     }
     this.LabelPlayerTotal.Text     = "Player Total: " + SteamData.playerCount;
     this.LabelFriends.Text         = "Friends: " + SteamData.lobbyFriendCount;
     this.LabelBannedPlayers.Text   = "Banned Players: " + SteamData.lobbyBanCount;
     this.ButtonViewProfile.Enabled = (CheckResult != 2 || !InternalConfig.Restricted);
 }
コード例 #2
0
        // Token: 0x0600000B RID: 11 RVA: 0x000026F4 File Offset: 0x000008F4
        public void UpdateActive()
        {
            int num = this.ListView.Items.Count - 1;

            if ((int)GameData.onlinePlayerCount < this.ListView.Items.Count)
            {
                for (int i = (int)GameData.onlinePlayerCount; i <= num; i++)
                {
                    this.ListView.Items.RemoveAt((int)GameData.onlinePlayerCount);
                }
            }
            else if ((int)GameData.onlinePlayerCount > this.ListView.Items.Count)
            {
                for (int j = this.ListView.Items.Count; j <= (int)(GameData.onlinePlayerCount - 1); j++)
                {
                    ListViewItem value = new ListViewItem(new string[]
                    {
                        "",
                        "",
                        "",
                        ""
                    });
                    this.ListView.Items.Add(value);
                }
            }
            if (GameData.onlinePlayerCount > 0)
            {
                int num2 = 0;
                int num3 = 0;
                for (int k = 0; k <= (int)(GameData.onlinePlayerCount - 1); k++)
                {
                    this.ListView.Items[k].SubItems[0].Text = GameData.PlayerList[k].LocalList[Math.Max((int)(GameData.PlayerList[k].LocalCount - 1), 0)].Name;
                    this.ListView.Items[k].SubItems[1].Text = GameData.PlayerList[k].SteamId.ToString();
                    this.ListView.Items[k].SubItems[2].Text = GameData.PlayerList[k].Ping + "ms";
                    if (k == (int)GameData.hostIndex)
                    {
                        this.ListView.Items[k].ForeColor = Color.Magenta;
                    }
                    else if (CurrentLobbyUI.CheckBan(GameData.PlayerList[k].SteamId))
                    {
                        num2++;
                        this.ListView.Items[k].ForeColor = Color.Red;
                    }
                    else if (CurrentLobbyUI.CheckFriend(GameData.PlayerList[k].SteamId))
                    {
                        num3++;
                        this.ListView.Items[k].ForeColor = Color.Green;
                    }
                    else
                    {
                        this.ListView.Items[k].ForeColor = Color.Black;
                    }
                }
                this.LabelLobbyIdValue.Text           = GameData.lobbyId.ToString();
                this.LabelHostValue.Text              = GameData.Host.LocalList[Math.Max((int)(GameData.Host.LocalCount - 1), 0)].Name;
                this.LabelSLTProtectedValue.Text      = (GameData.SLTProtected ? "Yes" : "No");
                this.LabelSLTProtectedValue.ForeColor = (GameData.SLTProtected ? Color.Green : Color.Red);
                this.LabelSLTProtected.ForeColor      = (GameData.SLTProtected ? Color.Green : Color.Red);
                this.LabelPlayerTotalValue.Text       = GameData.totalPlayerCount.ToString();
                this.LabelFriendsValue.Text           = num3.ToString();
                this.LabelBannedPlayersValue.Text     = num2.ToString();
                this.ButtonAdd.Enabled         = !InternalConfig.Restricted;
                this.ButtonViewProfile.Enabled = true;
                this.ButtonMigrateHost.Enabled = GameData.youAreHost;
                return;
            }
            this.LabelLobbyIdValue.Text       = "";
            this.LabelHostValue.Text          = "";
            this.LabelSLTProtectedValue.Text  = "";
            this.LabelSLTProtected.ForeColor  = Color.Black;
            this.LabelFriendsValue.Text       = "";
            this.LabelBannedPlayersValue.Text = "";
            this.LabelPlayerTotalValue.Text   = "";
            this.ButtonAdd.Enabled            = false;
            this.ButtonViewProfile.Enabled    = false;
            this.ButtonMigrateHost.Enabled    = false;
        }