Is it possible to create and to detect LAN servers avoiding MasterServer?
Quake uses broadcast pings to detect servers. I mean, client sends broadcast request (to the whole LAN) and a server (if exists) responds to the client. So they find each other.
Is it possible to use this scheme in Unity?
asked Oct 26 '10 at 05:12 AM
Use .Net Socket.
Create two Udpclient with two ports, one for listening and one for sending. The Udpclient for sending should connect to 255.255.255.255 when broadcasting. However in this way u can only broadcast messages in the same network segment, (eg. if your ip is 192.168.1.#, u can't broadcast message to 192.168.0.# in this way). I haven't figure it out how to broadcast msg across routers.
Anyway it's pretty simple, because basicly u just need to broadcast your ipAddress to others, and once you got the host's ip you can use Unity's Network to do the rest of things