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. Join us on Thursday, June 8, for a Q&A with Unity's Content Pipeline group here on the forum, and on the Unity Discord, and discuss topics around Content Build, Import Workflows, Asset Database, and Addressables!
    Dismiss Notice

Unity Multiplayer What function is being called when the Network Manager reverts the address to localhost?

Discussion in 'Multiplayer' started by BluetoothBoy, Jun 26, 2015.

  1. BluetoothBoy

    BluetoothBoy

    Joined:
    Jun 17, 2015
    Posts:
    14
    I don't know which it is, and I need to override the default behavior for my game. Also, why is it being reverted in the first place? I would like a better understanding of this, as it is an integral part of the game's structure.
     
  2. mkmkmk

    mkmkmk

    Joined:
    Jun 14, 2015
    Posts:
    1
    Bump, I have the same problem!
     
  3. seanr

    seanr

    Unity Technologies

    Joined:
    Sep 22, 2014
    Posts:
    669
    when you call NetworkManager.StartClient(), it uses NetworkManager.networkAddress...
     
  4. BluetoothBoy

    BluetoothBoy

    Joined:
    Jun 17, 2015
    Posts:
    14
    Yes, I realize this. What I want to know is what the manager is checking that causes it to automatically revert to localhost if the desired address cannot be used. I would imagine its a try-catch of some exception, but I could be wrong. The reason why I need to know this is because I would rather the game tell the user that the address cannot be used instead of auto-starting a localhost server for them. I now understand why my address isn't working though (lack of NAT punchthrough capabilities), but hopefully that will be resolved in phase 2.