Search Unity

Hosting a game both locally (LAN) and via Match Making (online)

Discussion in 'Multiplayer' started by Bunkerbewohner, Jun 22, 2017.

  1. Bunkerbewohner

    Bunkerbewohner

    Joined:
    May 20, 2013
    Posts:
    3
    Hi,

    I have a multiplayer game that so far has been hosted for LAN (using NetworkManager and NetworkDiscovery) and it works. However, I also want to allow people that are not in the LAN to join the game and for this I now use the Multiplayer service and matchmaking through networkManager.StartMatchMaker() etc.

    In the first version where only local computers can join I started the host without parameters, i.e. networkManager.StartHost(), whereas now I start it using the MatchInfo passed in from the CreateMatch callback, i.e. networkManager.StartHost(matchInfo).

    The problem is that now if the game is started with the match maker I cannot join locally through the LAN IP any more. Does anyone know how to fix this?

    Thanks in advance!