We’re working on a multiplayer enabled game, and we’d like to connect only the devices on the same local area network.
We’re having some problems showing the host list for all the created servers.
Using the Unity MasterServer, it shows all running multiplayer sessions across the globe in the host list.
We’d like to offer a similar functionality to the Master Server, where one creates a server, and the other devices see the servers (host) list, but only those on the same local area network.
We’d rather do this than ask the users to manually input the IP address.
Can you please tell me what would be the easiest way to achieve this?
Might be able to hack the masterserver solution you’re using already – just filter to show only servers that have the same public IP. Downside to this would be that the user would still need internet connectivity. If you want true LAN support (doesn’t need internet/doesn’t rely on master server), you’d have to scan your LAN for computers hosting games and I don’t know how to do that.
That would most likely be .NET stuff. Each server would have to have a listener of some sort on a known port, right? That is where I would start. Oh, and probably using UDP is a good idea as it is easier to be spammy and you can get replies from every server listening.