C# 클래스 Bricklayer.Client.Networking.NetworkManager

Provides a simple to use interface for sending/recieving Lidgren messages
파일 보기 프로젝트 열기: Cyral/Bricklayer 1 사용 예제들

공개 메소드들

메소드 설명
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.

비공개 메소드들

메소드 설명
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.

메소드 상세

Connect() 공개 메소드

Connects to a given server.
public Connect ( string host, int port ) : void
host string
port int
리턴 void

CreateMessage() 공개 메소드

Creates a NetOutgoingMessage from the interal Client object.
public CreateMessage ( ) : NetOutgoingMessage
리턴 Lidgren.Network.NetOutgoingMessage

Disconnect() 공개 메소드

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

Dispose() 공개 메소드

Disposes the NetworkManager
public Dispose ( ) : void
리턴 void

EncodeMessage() 공개 메소드

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

GetConnectionStats() 공개 메소드

Gets the server connection's Statistics from the internal client
public GetConnectionStats ( ) : NetConnectionStatistics
리턴 Lidgren.Network.NetConnectionStatistics

GetConnectionStatus() 공개 메소드

Gets the connection status from the internal client
public GetConnectionStatus ( ) : NetConnectionStatus
리턴 NetConnectionStatus

GetPeerStats() 공개 메소드

Gets the client statistics from the internal client
public GetPeerStats ( ) : NetPeerStatistics
리턴 Lidgren.Network.NetPeerStatistics

GetPeerStatus() 공개 메소드

Gets the client status from the internal client
public GetPeerStatus ( ) : NetPeerStatus
리턴 NetPeerStatus

ReadMessage() 공개 메소드

Reads the latest message in the queue.
public ReadMessage ( ) : NetIncomingMessage
리턴 Lidgren.Network.NetIncomingMessage

Recycle() 공개 메소드

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

Send() 공개 메소드

Sends and encodes an IMessage to the server.
public Send ( IMessage gameMessage ) : void
gameMessage IMessage IMessage to write ID and send.
리턴 void