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
NetworkManagercomponent to the game object you just created - Add a
NetworkDiscoverycomponent to the game object you just created - Set the
secret,port, andsearchTimeoutfields - Add a
NetworkDiscoveryHudcomponent - 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
NetworkManagercomponent to the game object you just created - Add a
NetworkDiscoverycomponent to the game object you just created - Set the
secret,port, andsearchTimeoutfields - 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
- All Unity versions that support .NET Standard 2.0 (or higher) are supported.
- All modern Fish-Networking versions are supported.
- Automatically start/stop advertising server
- Automatically remove servers that are no longer alive
If you found my project helpful, I would greatly appreciate your support through a donation to help me continue improving and maintaining it!