Ejemplo n.º 1
0
        /// <summary>
        /// Callback called when client accepts lobby join request from other steam user.
        /// </summary>
        /// <param name="request">The request.</param>
        private void OnGameLobbyJoinRequested(Steamworks.GameLobbyJoinRequested_t request)
        {
            Steamworks.SteamAPICall_t apiCall = Steamworks.SteamMatchmaking.JoinLobby(request.m_steamIDLobby);
            if (apiCall == Steamworks.SteamAPICall_t.Invalid)
            {
                Logger.Log("Unable to join lobby.");
                return;
            }

            Logger.Log("Setup player.");

            // Setup remote player. The HOST.
            timeSinceLastHeartbeat = 0.0f;
            players[1]             = new NetPlayer(this, netWorld, request.m_steamIDFriend);

            lobbyEnterCallResult.Set(apiCall);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Callback called when client accepts lobby join request from other steam user.
        /// </summary>
        /// <param name="request">The request.</param>
        private void OnGameLobbyJoinRequested(Steamworks.GameLobbyJoinRequested_t request)
        {
            Steamworks.SteamAPICall_t apiCall = Steamworks.SteamMatchmaking.JoinLobby(request.m_steamIDLobby);
            if (apiCall == Steamworks.SteamAPICall_t.Invalid)
            {
                Logger.Error($"Unable to join lobby {request.m_steamIDLobby}. JoinLobby call failed.");
                MPGUI.Instance.ShowMessageBox($"Failed to join lobby.\nPlease try again later.");
                return;
            }

            Logger.Debug("Setup player.");

            // Setup remote player. The HOST.
            timeSinceLastHeartbeat = 0.0f;
            players[1]             = new NetPlayer(this, netWorld, request.m_steamIDFriend);

            lobbyEnterCallResult.Set(apiCall);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Callback called when client accepts lobby join request from other steam user.
 /// </summary>
 /// <param name="request">The request.</param>
 private void OnGameLobbyJoinRequested(Steamworks.GameLobbyJoinRequested_t request)
 {
     JoinLobby(request.m_steamIDLobby, request.m_steamIDFriend);
 }