Hi, I can't conenct to the master server

Options

Maybe i make an error, but i checked a lot of times.

I basically use Unity 2021.2.5


I tested this, without fix :

  • remove my firewall
  • test on a fresh clean project in Unity 2020.3.24


Thanks by advance.

Best Answers

  • JohnTube
    JohnTube ✭✭✭✭✭
    Answer ✓
    Options

    Hi @hunabku94,

    Thank you for choosing Photon!

    The problem is in your Launcher code which extends MonoBehaviourPunCallbacks, you are overriding OnEnable without calling base.OnEnable so callbacks won't be fired. As you can read on the doc page here

    if you extend MonoBehaviourPunCallbacks make sure to call the base class methods if you override OnEnable() and OnDisable()

    You are connected by the way, take a look at the logs:

    Connected to masterserver.

    UnityEngine.StackTraceUtility:ExtractStackTrace () (at /home/bokken/buildslave/unity/build/Runtime/Export/Scripting/StackTrace.cs:37)

    UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])

    UnityEngine.Logger:Log (UnityEngine.LogType,object)

    UnityEngine.Debug:Log (object)

    Photon.Realtime.LoadBalancingClient:DebugReturn (ExitGames.Client.Photon.DebugLevel,string) (at Assets/Photon/PhotonRealtime/Code/LoadBalancingClient.cs:2576)

    Photon.Realtime.LoadBalancingClient:OnStatusChanged (ExitGames.Client.Photon.StatusCode) (at Assets/Photon/PhotonRealtime/Code/LoadBalancingClient.cs:2976)

    ExitGames.Client.Photon.PeerBase:InitCallback () (at D:/Dev/Work/photon-dotnet-sdk/PhotonDotNet/PeerBase.cs:602)

    ExitGames.Client.Photon.PeerBase:DeserializeMessageAndCallback (ExitGames.Client.Photon.StreamBuffer) (at D:/Dev/Work/photon-dotnet-sdk/PhotonDotNet/PeerBase.cs:927)

    ExitGames.Client.Photon.EnetPeer:DispatchIncomingCommands () (at D:/Dev/Work/photon-dotnet-sdk/PhotonDotNet/EnetPeer.cs:565)

    ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands () (at D:/Dev/Work/photon-dotnet-sdk/PhotonDotNet/PhotonPeer.cs:1771)

    Photon.Pun.PhotonHandler:Dispatch () (at Assets/Photon/PhotonUnityNetworking/Code/PhotonHandler.cs:222)

    Photon.Pun.PhotonHandler:FixedUpdate () (at Assets/Photon/PhotonUnityNetworking/Code/PhotonHandler.cs:145)


  • hunabku94
    hunabku94
    Answer ✓
    Options

    Ohh thanks a lot, i will try in Start method !

Answers

  • JohnTube
    JohnTube ✭✭✭✭✭
    Answer ✓
    Options

    Hi @hunabku94,

    Thank you for choosing Photon!

    The problem is in your Launcher code which extends MonoBehaviourPunCallbacks, you are overriding OnEnable without calling base.OnEnable so callbacks won't be fired. As you can read on the doc page here

    if you extend MonoBehaviourPunCallbacks make sure to call the base class methods if you override OnEnable() and OnDisable()

    You are connected by the way, take a look at the logs:

    Connected to masterserver.

    UnityEngine.StackTraceUtility:ExtractStackTrace () (at /home/bokken/buildslave/unity/build/Runtime/Export/Scripting/StackTrace.cs:37)

    UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])

    UnityEngine.Logger:Log (UnityEngine.LogType,object)

    UnityEngine.Debug:Log (object)

    Photon.Realtime.LoadBalancingClient:DebugReturn (ExitGames.Client.Photon.DebugLevel,string) (at Assets/Photon/PhotonRealtime/Code/LoadBalancingClient.cs:2576)

    Photon.Realtime.LoadBalancingClient:OnStatusChanged (ExitGames.Client.Photon.StatusCode) (at Assets/Photon/PhotonRealtime/Code/LoadBalancingClient.cs:2976)

    ExitGames.Client.Photon.PeerBase:InitCallback () (at D:/Dev/Work/photon-dotnet-sdk/PhotonDotNet/PeerBase.cs:602)

    ExitGames.Client.Photon.PeerBase:DeserializeMessageAndCallback (ExitGames.Client.Photon.StreamBuffer) (at D:/Dev/Work/photon-dotnet-sdk/PhotonDotNet/PeerBase.cs:927)

    ExitGames.Client.Photon.EnetPeer:DispatchIncomingCommands () (at D:/Dev/Work/photon-dotnet-sdk/PhotonDotNet/EnetPeer.cs:565)

    ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands () (at D:/Dev/Work/photon-dotnet-sdk/PhotonDotNet/PhotonPeer.cs:1771)

    Photon.Pun.PhotonHandler:Dispatch () (at Assets/Photon/PhotonUnityNetworking/Code/PhotonHandler.cs:222)

    Photon.Pun.PhotonHandler:FixedUpdate () (at Assets/Photon/PhotonUnityNetworking/Code/PhotonHandler.cs:145)


  • hunabku94
    hunabku94
    Answer ✓
    Options

    Ohh thanks a lot, i will try in Start method !