How to List Lan Games?

Blitz3D Forums/Blitz3D Beginners Area/How to List Lan Games?

pexe(Posted 2005) [#1]
I searched the whole site and found nothing.

So... I have all my Lan IPs, and I need to PING, each computer of my LAN. But the probleem is, i don't have my network mask, telling me where to ping. And the big problem, i don't know how to ping.

If i try to ping with OpenTCPStream, it will take 10 year to ping 1 host.

So.. i'm trying to find a way to use windows ping. And a way to know witch IPs to ping.


WolRon(Posted 2005) [#2]
I thought that IP's related to WANs, not LANs. Correct me if I'm wrong...


DH(Posted 2005) [#3]
Wont direct play work for this?


Banshee(Posted 2005) [#4]
You could try editting the TCPTimout to a shorter duration and then a manual ping should work. Failing that it might be worth experimenting with sending a network broadcast message, I think I saw something to that effect in the codebase not so long ago - but i'm not sure.


pexe(Posted 2005) [#5]
The problem about DirectPlay, it's that i have to bypass the window listing games. I want to put this list in my game.

And TCPTimeouts, just work for reading and accepting timeout.

I was wondering about UDP, i will try something.

WANs = Wide Area Network = Something about wireless right?
LAN = Local Area Network = A cabled network

If this is right, i'm telling about LANs
IP it's the internal IP, given by the DHCP of a LAN (or WAN, maybe :P). So to find a game in the whole LAN, I need to ping every computer, asking for my game. Right?

Ok, I will try UDP.


pexe(Posted 2005) [#6]
Oh yeah man! It Worked!

When HOST start a game, he listen to 2 ports. one for TCP, and other to UDP.

So the client, to find a game, send a UDP messages to all IPs in a LAN, and when a computer give an awnser so, you just found a game! And with the host IP, you can conect with TCP to play.


WolRon(Posted 2005) [#7]
WANs have nothing to do with wireless :)
The internet is a WAN.
A network within your home/business is a LAN.

I guess LAN computers could have IP addresses but if I'm not mistaken, that's only to connect to a WAN. IPs are not needed within the LAN (at least not in my home LAN).

You are incorrectly talking about LANs when you mean WAN.


LineOf7s(Posted 2005) [#8]
Every computer on a network (LAN or WAN or what-have-you) has an IP address. It's how it's uniquely identified within that network.

IP Address
An identifier for a computer or device on a TCP/IP network. Networks using the TCP/IP protocol route messages based on the IP address of the destination. The format of an IP address is a 32-bit numeric address written as four numbers separated by periods. Each number can be zero to 255. For example, 1.160.10.240 could be an IP address.

Within an isolated network, you can assign IP addresses at random as long as each one is unique. However, connecting a private network to the Internet requires using registered IP addresses (called Internet addresses) to avoid duplicates.



http://www.ragingwire.com/default.php?ID=23


WolRon(Posted 2005) [#9]
Every computer on a network (LAN or WAN or what-have-you) has an IP address.
I'm not so sure that that's true. I think that that only applies if you are using a protocol such as TCP/IP. If you are using the IPX protocol for example, I don't believe that the computer needs an IP address. The address is resolved through the computer name or workgroup (but I could be wrong).


pexe(Posted 2005) [#10]
I got another problem, now it's to find broadcast IPs.

In the LAN in my house, i know that my Broadcast IP is 192.168.1.255

And a made a script to find this ip, and check if it's working. Ok, i tetsted in more 2 LAN and worked, but the problem is, (if somebody knows HAMACHI, www.hamachi.cc), this program creates a "LAN" over the Internet, in better words, make your computer belive your are under a lan. My IP on this LAN is 5.5.71.221, and the subnet mask is 255.0.0.0. But i can't find the damn Broadcast ip!!!

How it works?


LineOf7s(Posted 2005) [#11]
Wolron:

Okay, you got me. I was introducing the quote immediately below my sentence with a generalisation based on the assumption any network relevant to Blitz game coding and this thread in particular would be using TCP/IP. In my defence though, the first sentence of the quote is:
An identifier for a computer or device on a TCP/IP network.


Big fan of your Pitfall 2 remake, btw. :o)

pexe:
Sorry to threadjack a lil. Wish I could help.


regaa(Posted 2005) [#12]
An IPAddress is used to communicate over a tcp/ip network (this means one networkcard to another). It is the case if you have a network of 2 computers or if you are connected to your isp through dsl.

If you are in Class A Netowrk and a Subnetmask of 255.0.0.0 means 1 Subnet, then the Broadcast IP should be 5.255.255.255 .


pexe(Posted 2005) [#13]
It worked.
5.255.255.255

Thanks regaa!


pexe(Posted 2005) [#14]
Another questin, i there a way to get the subnet mask with blitz?

Or i will need to guess it? =/


pexe(Posted 2005) [#15]
Well, guessing should not be a problem.

i can test this

x.x.x.255
x.x.255.255
x.255.255.255

so i can get the broadcast IP in most LANs