C# Class SpaceRun.Network

Afficher le fichier Open project: zzorn/Spike3D Class Usage Examples

Méthodes publiques

Свойство Type Description
session Microsoft.Xna.Framework.Net.NetworkSession

Méthodes publiques

Méthode Description
DrawDebug ( SpriteBatch spriteBatch, SpriteFont font ) : void
HostGame ( ) : void
JoinGame ( ) : void

Méthodes protégées

Méthode Description
CreateSession ( ) : void

Starts hosting a new network session.

GamerJoinedEventHandler ( object sender, Microsoft.Xna.Framework.Net.GamerJoinedEventArgs e ) : void

This event handler will be called whenever a new gamer joins the session.

GamerLeftEventHandler ( object sender, Microsoft.Xna.Framework.Net.GamerLeftEventArgs e ) : void
HookSessionEvents ( ) : void

After creating or joining a network session, we must subscribe to some events so we will be notified when the session changes state.

JoinSession ( ) : void

Joins an existing network session.

ReadIncomingPackets ( Microsoft.Xna.Framework.Net.LocalNetworkGamer gamer ) : void

Helper for reading incoming network packets.

SessionEndedEventHandler ( object sender, Microsoft.Xna.Framework.Net.NetworkSessionEndedEventArgs e ) : void

Event handler notifies us when the network session has ended.

Updatesession ( ) : void

Updates the state of the network session.

Private Methods

Méthode Description
BroadCastPlayerShipData ( Microsoft.Xna.Framework.Net.LocalNetworkGamer server ) : void
ReadPlayerShipData ( Microsoft.Xna.Framework.Net.LocalNetworkGamer gamer ) : void
SendPlayerShipData ( Microsoft.Xna.Framework.Net.LocalNetworkGamer gamer ) : void

Method Details

CreateSession() protected méthode

Starts hosting a new network session.
protected CreateSession ( ) : void
Résultat void

DrawDebug() public méthode

public DrawDebug ( SpriteBatch spriteBatch, SpriteFont font ) : void
spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch
font Microsoft.Xna.Framework.Graphics.SpriteFont
Résultat void

GamerJoinedEventHandler() protected méthode

This event handler will be called whenever a new gamer joins the session.
protected GamerJoinedEventHandler ( object sender, Microsoft.Xna.Framework.Net.GamerJoinedEventArgs e ) : void
sender object
e Microsoft.Xna.Framework.Net.GamerJoinedEventArgs
Résultat void

GamerLeftEventHandler() protected méthode

protected GamerLeftEventHandler ( object sender, Microsoft.Xna.Framework.Net.GamerLeftEventArgs e ) : void
sender object
e Microsoft.Xna.Framework.Net.GamerLeftEventArgs
Résultat void

HookSessionEvents() protected méthode

After creating or joining a network session, we must subscribe to some events so we will be notified when the session changes state.
protected HookSessionEvents ( ) : void
Résultat void

HostGame() public méthode

public HostGame ( ) : void
Résultat void

JoinGame() public méthode

public JoinGame ( ) : void
Résultat void

JoinSession() protected méthode

Joins an existing network session.
protected JoinSession ( ) : void
Résultat void

ReadIncomingPackets() protected méthode

Helper for reading incoming network packets.
protected ReadIncomingPackets ( Microsoft.Xna.Framework.Net.LocalNetworkGamer gamer ) : void
gamer Microsoft.Xna.Framework.Net.LocalNetworkGamer
Résultat void

SessionEndedEventHandler() protected méthode

Event handler notifies us when the network session has ended.
protected SessionEndedEventHandler ( object sender, Microsoft.Xna.Framework.Net.NetworkSessionEndedEventArgs e ) : void
sender object
e Microsoft.Xna.Framework.Net.NetworkSessionEndedEventArgs
Résultat void

Updatesession() protected méthode

Updates the state of the network session.
protected Updatesession ( ) : void
Résultat void

Property Details

session public_oe property

public NetworkSession,Microsoft.Xna.Framework.Net session
Résultat Microsoft.Xna.Framework.Net.NetworkSession