[java] Networking for RTS

Started by
3 comments, last by alaskamatt17 21 years ago
How do I get a client in a Real-time Strategy to give a list of all available hosts to connect to for a game being hosted on a Local Area Network? I do not know the IP address of the host.
Advertisement
You can:

1) Have all hosts register their IPs on a central database and have the clients read from that. IPs are registered when the host starts and are deregistered\ flaged off when the host is closed\ limit reached.

2) Scan every IP address in existance and see if they''re running your software =P


#Old Steve, he said to Xerox "Boys, turn your heads and cough"
And when no-one was looking he ripped their interfaces off#
Three Dead Trolls in a Baggie on the truth behind MacOS 1

SketchSoft | SketchNews
www.aidanwalsh(.net)(.info)
You might investigate uPnP. This is a method of discovery on networks. Probably more complex than the solution you are looking for.
you can send out a udp broadcast message that your game server will receive and respond to with a message containing its name, ip, which map its running, etc..
Yes, broadcasting an UPD packet works nice.
I work on an SNMP product and we send out a simple UPD packet over the network to find supporting devices.
However, make sure the applications you are trying to find always listen on the same port
"There is a $500 fine for detonating explosives within the confines of a city"

This topic is closed to new replies.

Advertisement