Data transfer over LAN or Internet
There are two types of online multiplayer games available when you create a networked game with XNA Game Studio:
- System link game sessions (LAN)
- LIVE sessions. (Internet)
Session types available:
- Use System Link for Local Area Network gameplay
- Sign in to Xbox LIVE and Games for Windows - LIVE Servers
- Use LIVE to connect to other machines over the Internet while the game is in development
Data transfer between connected Xbox and PC units is implemented using the LocalNetworkGamer class (supported on Xbox 360) and data is written using a PacketWriter as follows:
foreach (LocalNetworkGamer gamer in session.LocalGamers)
// Get the tank associated with this player.
Tank myTank = gamer.Tag as Tank;
// Write the data.
// Send it to everyone.
For a system link game, you can use any one of the following hardware configurations to test a networked game:
One development computer and one Xbox 360
(running one instance of the game on the development computer and one on the Xbox 360). The creator needs one Xbox LIVE Silver and one Creators Club membership to run code on the Xbox 360.
One development computer and one client computer
(running one instance of the game on each computer). Creators cannot run two networked XNA Framework games at the same time on the same computer. Creators need a second machine to run a second game instance for testing purposes. No Xbox LIVE memberships or Creators Club memberships are required for this scenario.
One development computer and two Xbox 360 consoles
(running one instance of the game on each Xbox 360). Here a creator deploys and debugs the game on two Xbox 360s. The creator needs at least two Xbox LIVE Silver memberships and two Creators Club memberships (one pair for each Xbox 360) for this scenario.
Voice transfer over network
Voice data is automatically transmitted and replayed without any title effort whatsoever. Titles can use this to implement team chat or proximity voice.
The XNA Framework does not expose direct program access to the voice data stream.
- Do they have voice access? - NetworkGamer.HasVoice
- Are they currently talking? - NetworkGamer.IsTalking
- Are they muted? - NetworkGamer.IsMutedByLocalUser