 |
 |
Getting IP from UDP connections?
|
 |
|
 |
|
Moderator Emeritus 
Join Date: Mar 2001
Location: Austin, MN, USA
Status:
Offline
|
|
When playing a multi-player game that uses UDP (like Starcraft), how can you get the IPs of the other people in the game? There isn't a specific host that I know of. I believe each computer talks to every other computer in the game because if anyone leaves or gets dropped, the game continues. Even if someone loses the connection to Battle.net, the connection continues.
So I'm wondering what can monitor UDP packets coming in. I tried using "netstat" during a game but didn't get see the 5 unique IPs of people connected and of the ones I did see they were TCP connections and not UDP.
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Sep 2000
Location: New York, NY
Status:
Offline
|
|
There are several architectures for multiplayer games. Battle.net (ROCKS!) uses a central server to which each player connects. The server is owned/operated by Battle.net. Something like UT2003 is usually run by an individual (such as yourself), with each player connecting to your server.
I don't think the traffic of the other players is broadcast in the packet data to your machine under the Battle.net architecture. So even if you sniffed the network traffic on your interface (really all you can do), you would only see the packets sent from BN to your machine (which would contain source/destination IP Address, i.e. BN server and your machine).
Now if you were running a Starcraft server, and handing out your IP to friends, and they were connecting to your server, you could use a network sniffer to capture the packets to and from your network interface. Those packets would have the source and destination IP address in them of all players.
There may be a Battle.net command to learn the IP of other players (e.g. to type in the game console), but I don't know what it is....
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Dec 2001
Location: Atlanta, GA, USA
Status:
Offline
|
|
UDP is connectionless. From the man page:
UDP is a simple, unreliable datagram protocol which is used to support
the SOCK_DGRAM abstraction for the Internet protocol family. UDP sockets
are connectionless, and are normally used with the sendto and recvfrom
calls, though the connect(2) call may also be used to fix the destination
for future packets (in which case the recv(2) or read(2) and send(2) or
write(2) system calls may be used).
That is why they don't show up in netstat.
You could run ethereal, which captures UDP packets.
|
|
Mac Pro 2x 2.66 GHz Dual core, Apple TV 160GB, two Windows XP PCs
|
| |
|
|
|
 |
|
 |
|
Moderator Emeritus 
Join Date: Mar 2001
Location: Austin, MN, USA
Status:
Offline
|
|
Originally posted by Arkham_c:
You could run ethereal, which captures UDP packets.
I actually just got that installed and running. Works pretty well actually. Thanks.
quadgrande: As I said, with Starcraft, each person does connect to each other person. This is why "losing your battle.net connection" doesn't interrupt the game but only keeps you from reporting the stats at the end. The "host" of the game also can leave and the game will continue. The game is hosted by everyone. Diablo 2 and I think also Warcraft 3 are server hosted. Meaning, you lose your connection to Battle.net and you're out of the game. This is better for controlling hacks but worse because the loads on their servers becomes much greater.
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|