Unity-Technologies / com.unity.netcode.gameobjects

Netcode for GameObjects is a high-level netcode SDK that provides networking capabilities to GameObject/MonoBehaviour workflows within Unity and sits on top of underlying transport layer.
MIT License
2.13k stars 433 forks source link

Network Discovery in NGO #2564

Open saqibkhan2523 opened 1 year ago

saqibkhan2523 commented 1 year ago

Is your feature request related to a problem? Please describe. Currently NGO does not provide network discovery feature for LAN and that is a problem when users want to have multiple servers and game sessions.

Describe the solution you'd like Network Discovery feature would allow the server to broadcast it self on network and client gets list of available servers. And it choses to join one of them.

Describe alternatives you've considered Network Discovery on multiplayer-community-contributions

Additional context The above mentioned alternative lists all the servers but client is unable to connect to any one of them. And while attempting to connect client timeout and connection fails.

NoelStephensUnity commented 1 year ago

@saqibkhan2523 If your LAN has internet then you might think about using the Lobby Service for this. When a server starts, it would create a lobby and populate the lobby data with its LAN address and port. So a list of lobbies could represent the list of LAN sessions and upon joining a lobby a non-server-host would look at the response's data to get the LAN address and port, apply that information to the NetworkConfig.Transport, and then start the client.

That is...if your LAN has an connection to the internet.

We will definitely take this feature into consideration. 👍