コード例 #1
0
        void Test_OnFindLobbies(bool result)
        {
            Console.WriteLine(result);

            if (result)
            {
                Console.WriteLine("Failure during lobby search.");
                return;
            }

            int n = SteamMatches.NumLobbies();

            Console.WriteLine("Found {0} lobbies", n);

            for (int i = 0; i < n; i++)
            {
                Console.WriteLine(SteamMatches.GetLobbyData(i, "name"));
            }

            SteamMatches.JoinCreatedLobby(Test_OnJoinLobby, Test_OnLobbyChatUpdate, Test_OnLobbyChatMsg, Test_OnLobbyDataUpdate);
        }
コード例 #2
0
        public void OnCreateLobby(bool result)
        {
            if (result)
            {
                Console.WriteLine("Failure during lobby creation.");
                return;
            }

            Program.GameStarted = false;

            SteamMatches.SetLobbyMemberLimit(64);
            SetLobbyName();
            SteamMatches.SetLobbyData("NumPlayers", "1");
            SteamMatches.SetLobbyData("NumSpectators", "0");
            SteamMatches.SetLobbyData("MaxPlayers", "4");

            if (InTrainingLobby)
            {
                SteamMatches.SetLobbyJoinable(false);
            }

            Console.WriteLine("Trying to join the created lobby.");
            SteamMatches.JoinCreatedLobby(OnJoinLobby, OnLobbyChatUpdate, OnLobbyChatMsg, OnLobbyDataUpdate);
        }