/Fish-Networking-Discovery

A very simple LAN network discovery component for Fish-Networking

Primary LanguageC#MIT LicenseMIT

Fish-Networking-Discovery

A very simple LAN network discovery component for Fish-Networking (Asset Store | GitHub)

Getting Started (GUI)

  1. Download the code in this repo as a zip
  2. Extract the code inside your project folder (FISH-NETWORKING MUST BE ALREADY INSTALLED)
  3. Create an empty game object
  4. Add a NetworkManager component to the game object you just created
  5. Add a NetworkDiscovery component to the game object you just created
  6. Set the secret, port, and searchTimeout fields
  7. Add a NetworkDiscoveryHud component
  8. Enter play mode
    • If you want to begin advertising a server
      1. Press "Start" under the "Server" group
      2. 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

Getting Started (Code)

  1. Download the code in this repo as a zip
  2. Extract the code inside your project folder (FISH-NETWORKING MUST BE ALREADY INSTALLED)
  3. Create an empty game object
  4. Add a NetworkManager component to the game object you just created
  5. Add a NetworkDiscovery component to the game object you just created
  6. Set the secret, port, and searchTimeout fields
  7. Enter play mode
    • If you want begin advertising a server
      1. Call InstanceFinder.ServerManager.StartConnection()
      2. Call FindObjectOfType<NetworkDiscovery>().AdvertiseServer()
    • If you want to stop advertising a server
      • Call FindObjectOfType<NetworkDiscovery>().StopSearchingOrAdvertising()
    • If you want to start searching for servers
      • Call FindObjectOfType<NetworkDiscovery>().SearchForServers()
    • If you want to stop seaching for servers
      • Call FindObjectOfType<NetworkDiscovery>().StopSearchingOrAdvertising()

Planned Features

  • Automatically start/stop advertising server
  • Automatically remove servers that are no longer alive
  • Introduce Unity coroutines for all NetworkDiscovery methods

Donating

If you found my project helpful, I would greatly appreciate your support through a donation to help me continue improving and maintaining it!