コード例 #1
0
        // Token: 0x0600007A RID: 122 RVA: 0x0000CEE4 File Offset: 0x0000B0E4
        public static int CheckLobby(ulong Id)
        {
            DebugTools.Print("Begin lobby Check (" + Id + ")");
            SteamData.GetLobbyList();
            int lobbyIndex = SteamData.GetLobbyIndex(Id);

            if (lobbyIndex == -1)
            {
                DebugTools.Print("Lobby Check: The lobby does not exist.");
                return(1);
            }
            if (Id == GameData.lobbyId && GameData.onlinePlayerCount > 0)
            {
                DebugTools.Print("Lobby Check: You are in this lobby.");
                return(0);
            }
            SteamData.GetLobbyPlayers(Id);
            if (SteamData.playerCount < 0)
            {
                return(SteamData.playerCount);
            }
            DebugTools.Write("Lobby Check: ");
            if (SteamData.lobbyFriendCount == 0 && SteamData.LobbyList[lobbyIndex].typeId == 3)
            {
                Debug.Print("You do not have permission to join this lobby.");
                return(2);
            }
            if (SteamData.lobbyBanCount > 0)
            {
                Debug.Print("This lobby contains a banned player.");
                return(3);
            }
            Debug.Print("No issues.");
            return(4);
        }
コード例 #2
0
        // Token: 0x0600007F RID: 127 RVA: 0x0000D15C File Offset: 0x0000B35C
        public static SteamData.Lobby GetLobby(ulong Id)
        {
            int lobbyIndex = SteamData.GetLobbyIndex(Id);

            if (lobbyIndex > 0)
            {
                return(SteamData.LobbyList[lobbyIndex]);
            }
            return(default(SteamData.Lobby));
        }
コード例 #3
0
        // 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;
            }
            }
        }