Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We’re making changes to the Unity Runtime Fee pricing policy that we announced on September 12th. Access our latest thread for more information!
    Dismiss Notice
  3. Dismiss Notice

Facepunch MLAPI Transport

Discussion in 'Multiplayer' started by justinwhelan, Nov 7, 2021.

  1. justinwhelan

    justinwhelan

    Joined:
    Aug 3, 2021
    Posts:
    1
    Hi all,

    I'm currently trying to migrate away from SteamP2P transport to Facepunch for MLAPI (0.1.0). It worked fine in SteamP2P, but I'm having problems connecting to a lobby using Facepunch.

    I've verified the lobby is being created, and is accessible. The remote user sees me joining the lobby (callback when member joins log entry) but nothing happens after that, and after approximately 30 seconds I get disconnected. Under SteamP2P, this would have then handed off to MLAPI to move the user into the "lobby" scene.

    The join code is:

    public async Task JoinLobby(Lobby joinedLobby)
    {
    Friend lobbyOwner = joinedLobby.Owner;

    Debug.Log($"[{nameof(SteamManager)}] joining lobby {lobbyOwner.Id}");
    GetComponent<FacepunchTransport>().targetSteamId = lobbyOwner.Id;
    NetworkManager.Singleton.StartClient();

    RoomEnter joinedLobbySuccess = await joinedLobby.Join();
    if (joinedLobbySuccess != RoomEnter.Success)
    {
    Debug.LogError($"[{nameof(SteamManager)}] failed to join lobby {joinedLobby.Id}");
    }
    else
    {
    Debug.Log($"[{nameof(SteamManager)}] successfully joined lobby {lobbyOwner.Id}");
    currentLobby = joinedLobby;
    }
    }

    I recevie teh "successfully joined lobby {id}" log file.

    I also enter the on lobby entered callback, which attempts to:

    private void OnLobbyEnteredCallback(Lobby obj)
    {
    Debug.Log($"[{nameof(SteamManager)}] Entered Lobby " + obj.Id);
    if(!isTutorial)
    {
    Debug.Log($"[{nameof(SteamManager)}] Swapping to Lobby with " + obj.Id);
    NetworkManager.Singleton.SceneManager.LoadScene("Lobby", LoadSceneMode.Single);
    }
    }

    but, 30 seconds later. Gone. Does anyone have an actual implementation guide for Facepunch with MLAPI?

    ta.
     
  2. wirsbo64

    wirsbo64

    Joined:
    Dec 26, 2021
    Posts:
    9
    Sorry to revive an old post, but did you find a solution to this? I have the exact same issue, and there is hardly any documentation to read.

    EDIT: Okay, so it works when I test it on two separate computers with different Steam users. Maybe the problem is caused by connecting to a server with two identical Steam users? How are we supposed to test our game without being able to connect twice from the same computer? Is there any debugging option accessible?
     
    Last edited: Dec 27, 2022