Search Unity

LAN Server Browser

Discussion in 'Multiplayer' started by Gablock, Sep 26, 2017.

  1. Gablock

    Gablock

    Joined:
    Jun 30, 2014
    Posts:
    3
    Hello,

    is there a simple way to make a LAN server broswer ?
     
  2. Gablock

    Gablock

    Joined:
    Jun 30, 2014
    Posts:
    3
    Nobody ?? D:
     
  3. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Your question is too broad, in that how a "LAN server browser" would be implemented would highly depend on what networking API you're using, and how your servers advertise their presence (if at all). The "browser" part itself would be a UI component that organizes and displays that server list after it is compiled.

    But to get you started, and assuming you choose the UNET API, you could use the NetworkDiscovery component to advertise the server to potential clients, and clients would listen to for these broadcasts using the same component. Then on your client you build up a list of all unique servers the client has received broadcasts from, and display that list to the user.

    https://docs.unity3d.com/Manual/UNetDiscovery.html
     
  4. Gablock

    Gablock

    Joined:
    Jun 30, 2014
    Posts:
    3
    Ok, thx :)