C# Class Fusion.Engine.Client.GameClient

Inheritance: Fusion.Engine.Common.GameModule
Datei anzeigen Open project: demiurghg/FusionEngine Class Usage Examples

Public Properties

Property Type Description
Guid System.Guid

Public Methods

Method Description
FeedNotification ( string message ) : void

Feed notification from server.

FeedSnapshot ( GameTime serverTime, byte snapshot, uint ackCommandID ) : void

Feed server snapshot to client. Called when fresh snapshot arrived. Not all snapshot could reach client.

FinalizeLoad ( GameLoader loader ) : void

Called when GameLoader finished loading. This method lets client to complete loading process in main thread. Add mesh instances, sounds, setup sky, hdr etc in this method.

GameClient ( Game game ) : System

Initializes a new instance of this class.

LoadContent ( string serverInfo ) : GameLoader

Called when connection request accepted by server. Method returns GameLoader that could load all content according server info.

NotifyServer ( string message ) : void

Sends server string message. This method may be used for chat or remote server control throw Shell.

UnloadContent ( ) : void

Called when client disconnected, dropped, kicked or timeouted. Client must purge all level-associated content. In most cases you need just to call Content.Unload().

Update ( GameTime gameTime, uint sentCommandID ) : byte[]

Called when the game has determined that client-side logic needs to be processed.

UserInfo ( ) : string

Gets user information. Called when client-server game logic has determined that server needs user information.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Releases all resources used by the GameClient class.

Private Methods

Method Description
ConnectInternal ( string host, int port ) : void

Request connection. Result depends on current client state.

DisconnectInternal ( string message ) : void

Request diconnect. Result depends on current client state.

DispatchDataIM ( NetIncomingMessage msg ) : void

DispatchIM ( Lidgren.Network.NetClient client ) : void

DispatchSnapshot ( NetIncomingMessage msg ) : void

DispatchStatusChange ( NetIncomingMessage msg ) : void

InitInternal ( ) : void

Inits internal stuff

InitiateLoadLevel ( string serverInfo ) : void
NotifyInternal ( string message ) : void

SendDiscoveryRequest ( ) : void

SendUserCommand ( Lidgren.Network.NetClient client, uint recvSnapshotFrame, uint cmdCounter, byte userCmd ) : void

SetState ( State newState ) : void

Sets state

UpdateInternal ( GameTime gameTime ) : void

Updates client.

Wait ( ) : void

Wait for client completion.

Method Details

Dispose() protected method

Releases all resources used by the GameClient class.
protected Dispose ( bool disposing ) : void
disposing bool
return void

FeedNotification() public abstract method

Feed notification from server.
public abstract FeedNotification ( string message ) : void
message string Message from server
return void

FeedSnapshot() public abstract method

Feed server snapshot to client. Called when fresh snapshot arrived. Not all snapshot could reach client.
public abstract FeedSnapshot ( GameTime serverTime, byte snapshot, uint ackCommandID ) : void
serverTime Fusion.Engine.Common.GameTime Server time includes number of server frames, total server time and elapsed time since last server frame. /// Snapshot data stream.
snapshot byte
ackCommandID uint Acknoledged (e.g. received and responsed) command ID. Zero value means first snapshot.
return void

FinalizeLoad() public abstract method

Called when GameLoader finished loading. This method lets client to complete loading process in main thread. Add mesh instances, sounds, setup sky, hdr etc in this method.
public abstract FinalizeLoad ( GameLoader loader ) : void
loader GameLoader
return void

GameClient() public method

Initializes a new instance of this class.
public GameClient ( Game game ) : System
game Game
return System

LoadContent() public abstract method

Called when connection request accepted by server. Method returns GameLoader that could load all content according server info.
public abstract LoadContent ( string serverInfo ) : GameLoader
serverInfo string
return GameLoader

NotifyServer() public method

Sends server string message. This method may be used for chat or remote server control throw Shell.
public NotifyServer ( string message ) : void
message string
return void

UnloadContent() public abstract method

Called when client disconnected, dropped, kicked or timeouted. Client must purge all level-associated content. In most cases you need just to call Content.Unload().
public abstract UnloadContent ( ) : void
return void

Update() public abstract method

Called when the game has determined that client-side logic needs to be processed.
public abstract Update ( GameTime gameTime, uint sentCommandID ) : byte[]
gameTime Fusion.Engine.Common.GameTime Cliemt-side game time.
sentCommandID uint Command's ID that are going to be sent.
return byte[]

UserInfo() public abstract method

Gets user information. Called when client-server game logic has determined that server needs user information.
public abstract UserInfo ( ) : string
return string

Property Details

Guid public_oe property

public Guid,System Guid
return System.Guid