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

Network Match without relay server

Discussion in 'Multiplayer' started by pophl, Jun 6, 2017.

  1. pophl

    pophl

    Joined:
    Mar 3, 2017
    Posts:
    14
    Using the LLAPI how do I create a match without a relay server?

    MatchInfo.usingRelay tells me if this match uses one but I cannot find any parameter anywhere to indicate I want to use direct connections after joining a match.

    I still want to use the Matchmaker to setup matches but plan to use direct connections (across a LAN) by reading peer IP addresses from MatchInfoDirectConnnectSnapshot
     
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Unity doesn't natively support direct connections with their match server because almost all home computers are on a NAT, and clients connecting to a host on a NAT without the host first enabling port forwarding on their router is a non-trivial issue. That's actually the whole point of the relay server.

    There's an asset store package that supposedly gets around this by using a NAT punch through technique. I haven't used it, but it has good reviews, and the author frequents this forum.

    https://www.assetstore.unity3d.com/en/#!/content/58948

    Creating matches just between clients on the same LAN isn't really what the matchmaker service was built to do, so I don't think they planned for it.
     
  3. pophl

    pophl

    Joined:
    Mar 3, 2017
    Posts:
    14
    Thanks for the help.

    The fact that both CreateMatch and JoinMatch can take a public and private IP for each peer and MatchInfoDirectConnnectSnapshot can distribute these addresses made me think it was possible, but perhaps the support was never implemented to completion.