C# Class SpaceRun.Network

ファイルを表示 Open project: zzorn/Spike3D Class Usage Examples

Public Properties

Property Type Description
session Microsoft.Xna.Framework.Net.NetworkSession

Public Methods

Method Description
DrawDebug ( SpriteBatch spriteBatch, SpriteFont font ) : void
HostGame ( ) : void
JoinGame ( ) : void

Protected Methods

Method 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

Method 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 method

Starts hosting a new network session.
protected CreateSession ( ) : void
return void

DrawDebug() public method

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

GamerJoinedEventHandler() protected method

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
return void

GamerLeftEventHandler() protected method

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

HookSessionEvents() protected method

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
return void

HostGame() public method

public HostGame ( ) : void
return void

JoinGame() public method

public JoinGame ( ) : void
return void

JoinSession() protected method

Joins an existing network session.
protected JoinSession ( ) : void
return void

ReadIncomingPackets() protected method

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

SessionEndedEventHandler() protected method

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
return void

Updatesession() protected method

Updates the state of the network session.
protected Updatesession ( ) : void
return void

Property Details

session public_oe property

public NetworkSession,Microsoft.Xna.Framework.Net session
return Microsoft.Xna.Framework.Net.NetworkSession