|
|
|
|
|
|
Additional info
|
|
|
|
|
Latest Forum posts
|
|
|
|
|
Ads
|
|
|
|
|
|
|
|
|
|
|
|

XNA 3.0 Game Programming Recipes
Riemer Grootjans

Chapter 8: Networking in XNA 3.0 (28 pages)
The XNA 3.0 Framework contains networking capabilities, allowing you to play your game on multiple PCs and Xbox 360 consoles. Once again, the XNA team has made sure the same code can be used to connect a PC or an Xbox 360 console to a session over the network.
This chapter shows and explains how you can set up a networking session and how you can connect to an existing session. Next, you will learn how you can send and receive data to/from other players over the network. You’ll also learn how you can use the lobby functionality that comes with XNA.
8-1. Sign In for Networking Services
Before you can use any of XNA’s networking functionality, you need to sign in to the Gamer Services. This recipe shows you how easy this is.
8-2. Create a Network Session
The first step in connecting multiple computers over the network, is to set up a Network session.
8-3. Join a Networking Session
Once a Network Session has been created, other computers on the networks can join the Session. This recipe also shows how your program can stay informed about changes in the Sessions, such as players joining or leaving the session.
8-4. Send/Receive Data Over the Network
A Network Session is only useful if you can send over some data to other computers. This recipe shows you how this can be done.
8-5. Search for Networking Sessions Asynchronously
Since some networking operations, such as searching for active Network sessions, can take some time to complete, XNA also provides some Asynchronous network methods. These allow your program to continue while XNA is completing the network method in the background, allowing you to keep the use informed about any progress made so far.
8-6. Add Rich Presence Information
New to XNA 3.0, you now can add Rich Presence information to each of your players, which informs outside viewers from their current status in your game.
8-7. Move from the Lobby to the Actual Game
XNA comes with basic built-in lobby signalling, allowing you to wait for all players to have toggled their Ready flag before starting the game.

Recipe 8-5: A new network session is created after no active session could be found on the network. A few players connect to the session and transmit data.
- Website design & XNA + DirectX code : Riemer Grootjans - ©2003 - 2008 Riemer Grootjans
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007 - 2009 MVP Award DirectX - XNA
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Support this site -- any amount is welcome !
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|