C# Класс Fusion.Engine.Client.GameClient

Наследование: Fusion.Engine.Common.GameModule
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
Guid System.Guid

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
Dispose ( bool disposing ) : void

Releases all resources used by the GameClient class.

Приватные методы

Метод Описание
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.

Описание методов

Dispose() защищенный Метод

Releases all resources used by the GameClient class.
protected Dispose ( bool disposing ) : void
disposing bool
Результат void

FeedNotification() публичный абстрактный Метод

Feed notification from server.
public abstract FeedNotification ( string message ) : void
message string Message from server
Результат void

FeedSnapshot() публичный абстрактный Метод

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.
Результат void

FinalizeLoad() публичный абстрактный Метод

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
Результат void

GameClient() публичный Метод

Initializes a new instance of this class.
public GameClient ( Game game ) : System
game Game
Результат System

LoadContent() публичный абстрактный Метод

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
Результат GameLoader

NotifyServer() публичный Метод

Sends server string message. This method may be used for chat or remote server control throw Shell.
public NotifyServer ( string message ) : void
message string
Результат void

UnloadContent() публичный абстрактный Метод

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
Результат void

Update() публичный абстрактный Метод

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.
Результат byte[]

UserInfo() публичный абстрактный Метод

Gets user information. Called when client-server game logic has determined that server needs user information.
public abstract UserInfo ( ) : string
Результат string

Описание свойств

Guid публичное свойство

public Guid,System Guid
Результат System.Guid