C# Class Bricklayer.Client.Networking.NetworkManager

Provides a simple to use interface for sending/recieving Lidgren messages
Afficher le fichier Open project: Cyral/Bricklayer Class Usage Examples

Méthodes publiques

Méthode Description
Connect ( string host, int port ) : void

Connects to a given server.

CreateMessage ( ) : NetOutgoingMessage

Creates a NetOutgoingMessage from the interal Client object.

Disconnect ( string reason = "Bye" ) : void

Disconnects from the server.

Dispose ( ) : void

Disposes the NetworkManager

EncodeMessage ( IMessage gameMessage ) : NetOutgoingMessage

Writes an IMessage's packet ID and encodes it's data into a NetOutgoingMessage.

GetConnectionStats ( ) : NetConnectionStatistics

Gets the server connection's Statistics from the internal client

GetConnectionStatus ( ) : NetConnectionStatus

Gets the connection status from the internal client

GetPeerStats ( ) : NetPeerStatistics

Gets the client statistics from the internal client

GetPeerStatus ( ) : NetPeerStatus

Gets the client status from the internal client

ReadMessage ( ) : NetIncomingMessage

Reads the latest message in the queue.

Recycle ( NetIncomingMessage im ) : void

Recycles a message after processing by reusing it, reducing GC load

Send ( IMessage gameMessage ) : void

Sends and encodes an IMessage to the server.

Private Methods

Méthode Description
Dispose ( bool disposing ) : void

Disposes the connection and disconnects from the server

Join ( string host, int port ) : void

Sends a message once connected to join a server officially.

Method Details

Connect() public méthode

Connects to a given server.
public Connect ( string host, int port ) : void
host string
port int
Résultat void

CreateMessage() public méthode

Creates a NetOutgoingMessage from the interal Client object.
public CreateMessage ( ) : NetOutgoingMessage
Résultat Lidgren.Network.NetOutgoingMessage

Disconnect() public méthode

Disconnects from the server.
public Disconnect ( string reason = "Bye" ) : void
reason string Reason to tell the server for disconnecting.
Résultat void

Dispose() public méthode

Disposes the NetworkManager
public Dispose ( ) : void
Résultat void

EncodeMessage() public méthode

Writes an IMessage's packet ID and encodes it's data into a NetOutgoingMessage.
public EncodeMessage ( IMessage gameMessage ) : NetOutgoingMessage
gameMessage IMessage
Résultat Lidgren.Network.NetOutgoingMessage

GetConnectionStats() public méthode

Gets the server connection's Statistics from the internal client
public GetConnectionStats ( ) : NetConnectionStatistics
Résultat Lidgren.Network.NetConnectionStatistics

GetConnectionStatus() public méthode

Gets the connection status from the internal client
public GetConnectionStatus ( ) : NetConnectionStatus
Résultat NetConnectionStatus

GetPeerStats() public méthode

Gets the client statistics from the internal client
public GetPeerStats ( ) : NetPeerStatistics
Résultat Lidgren.Network.NetPeerStatistics

GetPeerStatus() public méthode

Gets the client status from the internal client
public GetPeerStatus ( ) : NetPeerStatus
Résultat NetPeerStatus

ReadMessage() public méthode

Reads the latest message in the queue.
public ReadMessage ( ) : NetIncomingMessage
Résultat Lidgren.Network.NetIncomingMessage

Recycle() public méthode

Recycles a message after processing by reusing it, reducing GC load
public Recycle ( NetIncomingMessage im ) : void
im Lidgren.Network.NetIncomingMessage Message to recylce
Résultat void

Send() public méthode

Sends and encodes an IMessage to the server.
public Send ( IMessage gameMessage ) : void
gameMessage IMessage IMessage to write ID and send.
Résultat void