Last January I asked a question about sending string information between computers. Using the responses as a starting point I've got machines communicating across the same LAN's. Now I am interested in expanding the code to permit communication between machines that are further apart. I constantly see games being played across networks where users supplied only email addresses. How does that work? What's the purpose for supplying an email address? (I'm not looking for code, just a general explanation about what's happening.)
4 Answers
The email address is just used to identify the user. It has nothing to do with the networking itself. The game typically just connects to a central server and sends the necessary information via a socket to the game server. Part of the information can be the identification but the communication is typically not done via SMTP (email) but direct connections.

- 4,515
- 3
- 22
- 30
Usually those games connect to a central server, where they register themselves, using their email address. Then the server is able to give out lists with IP addresses. From there, it's all the same as a local network. (well, mostly)

- 6,938
- 1
- 39
- 65
The email address is simply used as a unique identifier to access a specific account. The accounts are purposefully not tied to single machines in most cases.
You know how to communicate across the LAN, so I'll assume you know the basics of networking. The trick is simply that the game client connects to a central server that has a known address over the Internet, with the credentials to login (this is where the email address usually comes in, but really, it can be anything, as it doesn't serve as a machine identifier). The server then registers the IP address, and so the game system knows how to reach other people because the central server knows who's playing and how to reach them.

- 134,922
- 42
- 253
- 328
You would like to read more about XML Sockets: the basics of multiplayer games.
The basic idea of networking in most games is still client-server model communicating via messages:
In your case emails has not much to do with exchanging large amount of data between computers.

- 4,622
- 1
- 16
- 20