Photon hangs on ConnectingToNameserver

Options
Hi there!
I'm trying to get Photon v2.16 to work in my Unity 2019 project.
When attempting to connect using settings, I seem to hang on "ConnectingToNameserver".
When trying to load a room, I get "JoinRandomRoom failed. Client is on MasterServer (must be Master Server for matchmaking) but not ready for operations (State: ConnectingToNameServer). Wait for callback: OnJoinedLobby or OnConnectedToMaster.".

So, I created a new, clean project, and here it works directly. There must be something conflicting in my project. I've tried several things, but can't seem to find out what's wrong. I have Google Play Services, MobileAd, UnityIAP integrated. Are any of these conflicting?
I've tried to import all my assets into the 'working test project', and here there isn't an issue. I also tried to import the Photon demos into my 'broken main project', and I'm confronted with the same error. I've tried disabling UnityIAP, but no change. I tried changing from IL2CPP / .NET4.x to Mono / 2.0, but this doesn't fix the issue. Likewise, setting the 'working test project' to IL2CPP / .NET4.x, it still works...

Is there a specific (project wide?) setting that might be interfering directly with the PhotonNetwork.ConnectUsingSettings attempt?

Thanks in advance!

Comments

  • Update;
    I've stripped every plugin and asset / script etc from the 'broken main project' until I only have 1 gameobject with the photon connect script attached. Still, it doesn't get any further than "Connecting to NameServer". The callback OnConnectedToMaster is never made. With the extra logging, it shows me this:

    Connect()
    UnityEngine.Debug:Log(Object)

    SocketUdpAsync, .Net, Unity.
    UnityEngine.Debug:Log(Object)

    IPhotonSocket.Connect() ns.exitgames.com:5058 this.Protocol: Udp
    UnityEngine.Debug:Log(Object)

    If I select 'start in offline mode'

    We're now connected to the server!
    UnityEngine.Debug:Log(Object)

    -- Ergo I don't feel it's a plugin conflict, but rather some project setting...
  • Any1?
  • Tobias
    Options
    That's super weird. Sounds as if you already tried everything I would have tried.
    Please zip the project and mail it: developer@exitgames.com

    Is it UWP? Then it may need "capabilities".
    You could run it with SupportLogger enabled. It may show more.
    See if there is only one instance of the ServerSettings scriptable object and check if the content of it makes sense (no server entry, appid set, etc).

    Your scripts may fail in ConnectUsingSettings, which then returns "false". But .. if there's no log to help fix that, it's hard.
  • Hello Tobias!

    Thanks for your response. I've tried zipping it and send it to developer@exitgames.com, but I got a bounce back ('developer@exitgames.com' op 24/02/2020 17:23 - 552 5.7.0 message content and attachment content guidelines). I've placed it on my webserver, and send you the URL.

    If you have any questions, or need me to test something, let me know.

    Thanks for looking into this!

    Kind regards,
    Kami.
  • Tobias wrote: »
    Is it UWP? Then it may need "capabilities".
    You could run it with SupportLogger enabled. It may show more.
    See if there is only one instance of the ServerSettings scriptable object and check if the content of it makes sense (no server entry, appid set, etc).

    Its android, but switching to uwp makes no difference. The support logger shows
    Connect()
    UnityEngine.Debug:Log(Object)

    SocketUdpAsync, .Net, Unity.
    UnityEngine.Debug:Log(Object)

    IPhotonSocket.Connect() ns.exitgames.com:5058 this.Protocol: Udp
    UnityEngine.Debug:Log(Object)

    The only item in the project is the script, with configured PhotonSettings.
    When I create a new project and copy that script and run it, it works.
  • Hello Tobias,

    I managed to find the issue.

    In the empty project, I saw some ProjectSettings files lingering, so I did the following to narrow down the culprit:

    - copied & removed all files under ProjectSettings;
    - started project, configured / installed required assets;
    - after successful run, photon works;
    - replacing copied setting files one by one;
    - found photon breaks due to TimeManager.asset file settings;

    I compared the TimeManager.asset from my 'old, not working project', and a test project in where photon works.

    The content of the non-working file was:

    %YAML 1.1
    %TAG !u! tag:unity3d.com,2011:
    --- !u!5 &1
    TimeManager:
    m_ObjectHideFlags: 0
    Fixed Timestep: 0.02
    Maximum Allowed Timestep: 0.1
    m_TimeScale: 0
    Maximum Particle Timestep: 0.03


    The content of the file that does allow Photon to connect:

    y 2019.3.0f5 þÿÿÿ ÿÿÛâw–¦/ZX\ÇÔ‹èÞ Z 7 € ¦ €² € ¡ € ¡ € ¡ €4 ¡ €@ TimeManager Fixed Timestep Maximum Allowed Timestep m_TimeScale Maximum Particle Timestep
    ×£<«ªª> €?Âõ<

    --

    After I copied the working file to the non-working project, Photon could connect.

    Hope this helps you in the development and other people that run into a similar issue.

    Kind regards,
    Kami.
  • Tobias
    Options
    We already mailed but: Thanks again for all the input!
    This will be a good reference for anyone with similar problems.

    Hope you're making progress now :)