Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bypassing MasterServer

Discussion in 'Multiplayer' started by phoekiel, Apr 13, 2014.

  1. phoekiel

    phoekiel

    Joined:
    Oct 20, 2012
    Posts:
    51
    Hi! I am doing a simple multiplayer game and I was wondering if there was a way to connect to a server pc just by putting the ip address and not using the MasterServer, just the way you would do if playing a game of Age of Empires 2, for example. Is it possible? Does anyone know how to do this?

    Thank you for your time.
     
  2. Crystalline

    Crystalline

    Joined:
    Sep 11, 2013
    Posts:
    168
    Make that server pc host a mastersever and you are done.
     
  3. phoekiel

    phoekiel

    Joined:
    Oct 20, 2012
    Posts:
    51
    but then ill have to ship a master server with every copy of the game... Is it there any other way to do it?
     
  4. appels

    appels

    Joined:
    Jun 25, 2010
    Posts:
    2,687
    Network.Connect(); takes a string for the ip address you wan't to connect to.
    Note that on the LAN this will work but not if you need NAT.
    If you need NAT then you need a masterserver that is reachable on the internet and that can do the NAT punchthrough.
     
  5. phoekiel

    phoekiel

    Joined:
    Oct 20, 2012
    Posts:
    51
    Thank you so much for this! One last question: NAT is used to figure out the real address of a PC inside a network, right? Is it a way to deal with routers and internal IPs?