Broadcasting on a lan network

Blitz3D Forums/Blitz3D Programming/Broadcasting on a lan network

AngelOnFira(Posted 2013) [#1]
So I am making a multiplayer game where for the multiplayer menu you will have the option to play lan or internet. Obviously the internet option would have its own server, and that would handle the game play and people who would be trying to join.

However when it comes to lan I am having a few issues. Lan ip are normally in the format 192.168.x.x. When broadcasting I normally just do 192.168.8.255, however I believe it is possible that the 8 may change as well, and possibly even the 192 and the 168. I was trying to broadcast to using 192.168.255.255, however it didn't seem to be working.

Was there something I was missing or should I be doing something different? Thanks for any response!


Guy Fawkes(Posted 2013) [#2]
Use this ;)

http://dawp.tripod.com/netblitz.htm


AngelOnFira(Posted 2013) [#3]
I am familiar with NetBlitz however he asks for the IP so the user still has to type it in. he does have an automatic option for the local computer if you were just testing it out, however that just get the IP for your computer and use it.


Guy Fawkes(Posted 2013) [#4]
Just delete the part with "Input" and change it to the external IP you wish to connect to. Name THAT file "Client.exe". Do the same thing with server, only change the IP to your internal IP. IE: 192.168.x.y...

That's what I did! :)


xlsior(Posted 2013) [#5]
Lan ip are normally in the format 192.168.x.x. When broadcasting I normally just do 192.168.8.255, however I believe it is possible that the 8 may change as well, and possibly even the 192 and the 168. I was trying to broadcast to using 192.168.255.255, however it didn't seem to be working.


LAN IPs can be in a lot of different forms:

10.0.0.0 through 10.255.255.255
192.168.0.0 through 192.168.255.255
172.16.0.0 through 172.31.255.255

you can calculate the broadcast address of your network segment, but you need the NETMASK value to determine that. I'm not sure how to read out the netmask from within blitzmax - I don't believe there's a built-in command to do so.

Anyway: if your netmask is 255.255.255.0 (most common), then the broadcast IP is the same as the first three groups of your own IP address with '255' at the end.

If it's something different, you will need to calculate the address -- which you can do as long as you have your own IP and the netmask value.

Here's some info on how to calculate:
http://www.wikihow.com/Calculate-Network-and-Broadcast-Address


AngelOnFira(Posted 2013) [#6]
You da bomb man


Guy Fawkes(Posted 2013) [#7]
Thanks, buddy :)


AngelOnFira(Posted 2013) [#8]
You're the greatest!


Guy Fawkes(Posted 2013) [#9]
Thanks for the kind words! :) Glad I could help! ^_^