Пример #1
0
 // Token: 0x0600007D RID: 125 RVA: 0x0000D074 File Offset: 0x0000B274
 public static string GetActivity(SteamData.Lobby Lobby)
 {
     if (Lobby.state == 255)
     {
         return("Unknown");
     }
     if (Lobby.state == 0)
     {
         return("Waiting");
     }
     if (Lobby.state == 1)
     {
         return("Waiting (" + Lobby.countdown + "s)");
     }
     if (Lobby.state == 2)
     {
         return("Voting (" + Lobby.countdown + "s)");
     }
     if (Lobby.raceProgress == 0)
     {
         return("Race starting");
     }
     if (Lobby.raceProgress == 100)
     {
         return("Race finishing");
     }
     return("Racing (" + Lobby.raceProgress + "%)");
 }
Пример #2
0
 // Token: 0x06000078 RID: 120 RVA: 0x0000CD08 File Offset: 0x0000AF08
 private static void ProcessLobbyList(string[] lines)
 {
     DebugTools.Write("Steam Data: Processing lobby list... ");
     SteamData.lobbyCount = Convert.ToInt32(lines[0]);
     SteamData.LobbyList  = new SteamData.Lobby[SteamData.lobbyCount];
     for (int i = 0; i < SteamData.lobbyCount; i++)
     {
         SteamData.Lobby lobby = new SteamData.Lobby
         {
             id           = Convert.ToUInt64(lines[6 * i + 1]),
             creator      = lines[6 * i + 2],
             typeId       = Convert.ToByte(lines[6 * i + 3]),
             playerCount  = Convert.ToByte(lines[6 * i + 4]),
             SLTProtected = (Convert.ToByte(lines[6 * i + 5]) > 10)
         };
         byte[] array = SteamData.DecodeInfo(lines[6 * i + 6]);
         if (array.Length != 0)
         {
             lobby.matchModeId  = SteamData.ExtractByte(array, 8);
             lobby.raceProgress = SteamData.ExtractByte(array, 77);
             lobby.countdown    = Convert.ToByte(SteamData.ExtractByte(array, 60) & 63);
             lobby.state        = Convert.ToByte(SteamData.ExtractByte(array, 22) & 3);
             lobby.difficultyId = Convert.ToByte(SteamData.ExtractByte(array, 62) & 3);
         }
         else
         {
             lobby.state = 4;
         }
         SteamData.LobbyList[i] = lobby;
     }
     Debug.Print("done.");
     DebugTools.Print("Steam Data: Got " + SteamData.lobbyCount + " lobbies.");
 }
 // Token: 0x06000056 RID: 86 RVA: 0x0000644C File Offset: 0x0000464C
 private void InfoTabUpdate(SteamData.Lobby Lobby, int CheckResult)
 {
     if (CheckResult != 2 || !InternalConfig.Restricted)
     {
         this.LabelIdValue.Text = Lobby.id.ToString();
     }
     else
     {
         this.LabelIdValue.Text = "Private";
     }
     this.LabelTypeValue.Text        = SteamData.lobbyTypes[(int)Lobby.typeId];
     this.LabelCreatorValue.Text     = Lobby.creator;
     this.LabelPlayerCountValue.Text = Lobby.playerCount.ToString();
     if (Lobby.state != 4)
     {
         this.LabelActivityValue.Text = SteamData.GetActivity(Lobby);
         this.LabelEventValue.Text    = PlayerTable.GetEvent(Lobby.typeId, Lobby.matchModeId, false);
         string[] array = PlayerTable.GetTrack(Lobby.typeId, Lobby.matchModeId, false).Split(" ".ToCharArray(), 2);
         this.LabelTrack.Text           = array[0];
         this.LabelTrackValue.Text      = array[1];
         this.LabelDifficultyValue.Text = PlayerTable.GetDifficulty(Lobby.difficultyId, false);
         return;
     }
     this.LabelActivityValue.Text   = "Unknown";
     this.LabelEventValue.Text      = "Unknown";
     this.LabelTrackValue.Text      = "Unknown";
     this.LabelDifficultyValue.Text = "Unknown";
 }
 // Token: 0x06000057 RID: 87 RVA: 0x000065A0 File Offset: 0x000047A0
 private void HostDetailsTabUpdate(SteamData.Lobby Lobby, int CheckResult)
 {
     this.LabelHostNameValue.Text = SteamData.LobbyHost.name;
     if (CheckResult != 2 || !InternalConfig.Restricted)
     {
         this.LabelHostSteamIdValue.Text = SteamData.LobbyHost.steamId.ToString();
     }
     else
     {
         this.LabelHostSteamIdValue.Text = "Private";
     }
     this.LabelSLTProtectedValue.Text = (Lobby.SLTProtected ? "Yes" : "No");
 }
        // Token: 0x06000055 RID: 85 RVA: 0x00006350 File Offset: 0x00004550
        private void ButtonRefresh_Click(object sender, EventArgs e)
        {
            this.ButtonRefresh.Enabled = false;
            this.ButtonRefresh.Text    = "Refreshing...";
            this.ButtonRefresh.Update();
            int checkResult = SteamData.CheckLobby(this.lobbyId);

            MainForm.AllLobbiesUI.UpdateStatic();
            this.ButtonRefresh.Enabled = true;
            this.ButtonRefresh.Text    = "Refresh";
            switch (checkResult)
            {
            case -2:
                base.Close();
                return;

            case -1:
                base.Close();
                return;

            case 0:
                DebugTools.Print("Warning: Will not retrieve lobby details.");
                MessageBox.Show("You are already in this lobby.", "Lobby details unneccesary.", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                base.Close();
                return;

            case 1:
                MessageBox.Show("This lobby no longer exists.", "Could not retrieve details.", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                base.Close();
                return;

            default:
            {
                SteamData.Lobby lobby = SteamData.LobbyList[SteamData.GetLobbyIndex(this.lobbyId)];
                this.InfoTabUpdate(lobby, checkResult);
                this.HostDetailsTabUpdate(lobby, checkResult);
                this.PlayerTabUpdate(checkResult);
                return;
            }
            }
        }