Search Unity

Question Client Build to Client Build Connects but Client Build to Editor Host does not

Discussion in 'Netcode for GameObjects' started by sh0v0r, Feb 13, 2024.

  1. sh0v0r

    sh0v0r

    Joined:
    Nov 29, 2010
    Posts:
    325
    If I make a build and deploy it on two different machines on the same network or remote, they are able to connect fine as Host/Client

    If I run as Host in the Editor and try to connect to it from the Client Build on another machine the client times out and fails to connect.
     
  2. NoelStephens_Unity

    NoelStephens_Unity

    Unity Technologies

    Joined:
    Feb 12, 2022
    Posts:
    259
    This could be a known issue with using the default network prefab list.

    If you are using the default network prefab list (either by directly assigning it in the NetworkManager or if no list is assigned to the Network Prefabs List the default network prefabs list is used), then try to create a unique network prefab list (right click in any folder within the Assets folder while in the project file explorer and select Create-->Netcode--> Network Prefabs List and then populate that with the network prefabs used in your project).

    Once the unique network pefab list has been assigned to your NetworkManager, rebuild your stand alone build and try to connect a client to a host running within the editor.

    If you had already assigned a unique network prefab list (other than the default) when you experienced this issue, then if you could set the NetworkManager Log Level to developer and repeat the steps you outlined above (host in editor client on a different computer) and post the console log (or better yet the log files for both the host and the client) it would help me further troubleshoot the issue for you.
     
  3. sh0v0r

    sh0v0r

    Joined:
    Nov 29, 2010
    Posts:
    325
    Hi Noel, thanks for responding, I have tried your suggestion of creating a non 'default' prefab list. This did not resolve the problem. It seems as though the Client just cannot get any response from the Host and the Host does not receive a connection attempt from the Client. This used to work and I am curious if it is a bug that was introduced with the last Netcode Version Release. I am considering rolling back to an earlier version to see.

    I am using the latest NGO and using Unity 2022.3.13

    Regarding the logs,
    I have checked through the Editor log and there is nothing relevant to the network connection state aside from the standard initialisation when the Host starts.

    The Client Log is as such:
    [Netcode] Start Client
    [Netcode] Initialize
    Failed to connect to server.
    [Netcode] Disconnect Event From 0
    [Netcode] Shutdown
    [Netcode] ShutdownInternal
    [Netcode] NetworkConnectionManager.Shutdown() -> IsListening && NetworkTransport != null -> NetworkTransport.Shutdown()
     
    Last edited: Feb 17, 2024
  4. sh0v0r

    sh0v0r

    Joined:
    Nov 29, 2010
    Posts:
    325
    OK, I have resolved this problem.
    I'm not sure which of these changes fixed the issue, but I changed the Address in the UnityTransport component to 0.0.0.0 and I also checked in the Windows Firewall Settings for the Unity application that it was allowed to be open.
     
    NoelStephens_Unity likes this.
  5. NoelStephens_Unity

    NoelStephens_Unity

    Unity Technologies

    Joined:
    Feb 12, 2022
    Posts:
    259
    Ahhh, yeah that would also be an issue.