A very simple LAN network discovery component for Fish-Networking (Asset Store | GitHub)
- Download the code in this repo as a zip
- Extract the code inside your project folder (FISH-NETWORKING MUST BE ALREADY INSTALLED)
- Create an empty game object
- Add a
NetworkManager
component to the game object you just created - Add a
NetworkDiscovery
component to the game object you just created - Set the
secret
,port
, andsearchTimeout
fields - Add a
NetworkDiscoveryHud
component - Enter play mode
- If you want to begin advertising a server
- Press "Start" under the "Server" group
- Press "Start" under the "Advertising" group
- If you want to stop advertising a server
- Press "Stop" under the "Advertising" group
- If you want to begin searching for servers
- Press "Start" under the "Searching" group
- If you want to stop searching for servers
- Press "Stop" under the "Searching" group
- If you want to begin advertising a server
- Download the code in this repo as a zip
- Extract the code inside your project folder (FISH-NETWORKING MUST BE ALREADY INSTALLED)
- Create an empty game object
- Add a
NetworkManager
component to the game object you just created - Add a
NetworkDiscovery
component to the game object you just created - Set the
secret
,port
, andsearchTimeout
fields - Enter play mode
- If you want begin advertising a server
- Call
InstanceFinder.ServerManager.StartConnection()
- Call
FindObjectOfType<NetworkDiscovery>().AdvertiseServer()
- Call
- If you want to stop advertising a server
- Call
FindObjectOfType<NetworkDiscovery>().StopSearchingOrAdvertising()
- Call
- If you want to start searching for servers
- Call
FindObjectOfType<NetworkDiscovery>().SearchForServers()
- Call
- If you want to stop seaching for servers
- Call
FindObjectOfType<NetworkDiscovery>().StopSearchingOrAdvertising()
- Call
- If you want begin advertising a server
- Automatically start/stop advertising server
- Automatically remove servers that are no longer alive
- Introduce Unity coroutines for all
NetworkDiscovery
methods
If you found my project helpful, I would greatly appreciate your support through a donation to help me continue improving and maintaining it!