C# Class Indiefreaks.Xna.Sessions.SessionManager

The SessionManager provides SunBurn with a Manager to identify Players, create, update and maintain a Session
Inheritance: ISessionManager
显示文件 Open project: Indiefreaks/igf

Public Properties

Property Type Description
LocalPlayers IdentifiedPlayer>.Dictionary

Public Methods

Method Description
ApplyPreferences ( ISystemPreferences preferences ) : void

Use to apply user quality and performance preferences to the resources managed by this object.

BeginPlayerIdentification ( ) : void

Starts listening to players A button pressed to identify them

Clear ( ) : void

Removes resources managed by this object. Commonly used while clearing the scene.

CloseSession ( ) : void
CreateLanSession ( int maxPlayers, SessionProperties sessionProperties ) : void

Creates a local area network session

it doesn't yet support multiple local players

CreateSinglePlayerSession ( ) : void

Creates a Single Player Session

No network resources will be used

CreateSplitScreenSession ( ) : void

Creates a Split Screen Session

Not implemented yet

CreateWanSession ( int maxPlayers, SessionProperties sessionProperties ) : void

Creates a wide area network session

it doesn't yet support multiple local players

EndPlayerIdentification ( ) : void

Closes the identification process

FindSessions ( SessionType sessionType, int maxLocalPlayers, SessionProperties sessionProperties ) : void

Sends a Find query on the network interface to look for AvailableSession instances asynchrnously

GetIdentifiedPlayer ( LogicalPlayerIndex logicalPlayerIndex ) : IdentifiedPlayer

Returns the Identified player with the given logical player index

IdentifyPlayer ( PlayerInput playerInput ) : void

Identifies a player

JoinSession ( AvailableSession availableSession ) : void

Sends a Join query to the Session asynchronously

OnPlayerLogin ( IdentifiedPlayer identifiedPlayer ) : void

Raised when a Player is identified

OnPlayerLogoff ( IdentifiedPlayer identifiedPlayer ) : void

Raised when a Player logs off

OnSessionClosed ( ) : void
OnSessionCreated ( ) : void

Raised when the Session is created

OnSessionJoined ( ) : void

Raised when the Session is joined

OnSessionsFound ( IList sessionsFound ) : void

Raised when the FindSessions query ends

Unload ( ) : void

Disposes any graphics resource used internally by this object, and removes scene resources managed by this object. Commonly used during Game.UnloadContent.

Update ( GameTime gameTime ) : void

Updates the object and its contained resources.

Protected Methods

Method Description
GetNextFreeLogicalPlayerIndex ( ) : LogicalPlayerIndex
SessionManager ( IManagerServiceProvider sceneInterface ) : System

Creates a new instance

Method Details

ApplyPreferences() public method

Use to apply user quality and performance preferences to the resources managed by this object.
public ApplyPreferences ( ISystemPreferences preferences ) : void
preferences ISystemPreferences
return void

BeginPlayerIdentification() public method

Starts listening to players A button pressed to identify them
public BeginPlayerIdentification ( ) : void
return void

Clear() public method

Removes resources managed by this object. Commonly used while clearing the scene.
public Clear ( ) : void
return void

CloseSession() public method

public CloseSession ( ) : void
return void

CreateLanSession() public abstract method

Creates a local area network session
it doesn't yet support multiple local players
public abstract CreateLanSession ( int maxPlayers, SessionProperties sessionProperties ) : void
maxPlayers int The total maximum players for this session
sessionProperties SessionProperties The SessionProperties that will be used to find this session on the network. Can be null
return void

CreateSinglePlayerSession() public abstract method

Creates a Single Player Session
No network resources will be used
public abstract CreateSinglePlayerSession ( ) : void
return void

CreateSplitScreenSession() public abstract method

Creates a Split Screen Session
Not implemented yet
public abstract CreateSplitScreenSession ( ) : void
return void

CreateWanSession() public abstract method

Creates a wide area network session
it doesn't yet support multiple local players
public abstract CreateWanSession ( int maxPlayers, SessionProperties sessionProperties ) : void
maxPlayers int The total maximum players for this session
sessionProperties SessionProperties The SessionProperties that will be used to find this session on the network. Can be null
return void

EndPlayerIdentification() public method

Closes the identification process
public EndPlayerIdentification ( ) : void
return void

FindSessions() public abstract method

Sends a Find query on the network interface to look for AvailableSession instances asynchrnously
public abstract FindSessions ( SessionType sessionType, int maxLocalPlayers, SessionProperties sessionProperties ) : void
sessionType SessionType The SessionType we're looking for
maxLocalPlayers int The Maximum local players that can be added to the session used to filter sessions that have a limited number of opened public slots
sessionProperties SessionProperties The SessionProperties that will be used to filter query results. Can be null
return void

GetIdentifiedPlayer() public static method

Returns the Identified player with the given logical player index
public static GetIdentifiedPlayer ( LogicalPlayerIndex logicalPlayerIndex ) : IdentifiedPlayer
logicalPlayerIndex LogicalPlayerIndex
return IdentifiedPlayer

GetNextFreeLogicalPlayerIndex() protected static method

protected static GetNextFreeLogicalPlayerIndex ( ) : LogicalPlayerIndex
return LogicalPlayerIndex

IdentifyPlayer() public abstract method

Identifies a player
public abstract IdentifyPlayer ( PlayerInput playerInput ) : void
playerInput Indiefreaks.Xna.Input.PlayerInput The PlayerInput instance used by the player to identify
return void

JoinSession() public abstract method

Sends a Join query to the Session asynchronously
public abstract JoinSession ( AvailableSession availableSession ) : void
availableSession AvailableSession The Session we are trying to join
return void

OnPlayerLogin() public method

Raised when a Player is identified
public OnPlayerLogin ( IdentifiedPlayer identifiedPlayer ) : void
identifiedPlayer IdentifiedPlayer
return void

OnPlayerLogoff() public method

Raised when a Player logs off
public OnPlayerLogoff ( IdentifiedPlayer identifiedPlayer ) : void
identifiedPlayer IdentifiedPlayer
return void

OnSessionClosed() public method

public OnSessionClosed ( ) : void
return void

OnSessionCreated() public method

Raised when the Session is created
public OnSessionCreated ( ) : void
return void

OnSessionJoined() public method

Raised when the Session is joined
public OnSessionJoined ( ) : void
return void

OnSessionsFound() public method

Raised when the FindSessions query ends
public OnSessionsFound ( IList sessionsFound ) : void
sessionsFound IList
return void

SessionManager() protected method

Creates a new instance
protected SessionManager ( IManagerServiceProvider sceneInterface ) : System
sceneInterface IManagerServiceProvider
return System

Unload() public method

Disposes any graphics resource used internally by this object, and removes scene resources managed by this object. Commonly used during Game.UnloadContent.
public Unload ( ) : void
return void

Update() public method

Updates the object and its contained resources.
public Update ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime
return void

Property Details

LocalPlayers public_oe static_oe property

public static Dictionary LocalPlayers
return IdentifiedPlayer>.Dictionary