C# Class LiteNetLib.NetServer

Inheritance: NetBase
Mostra file Open project: RevenantX/LiteNetLib Class Usage Examples

Public Methods

Method Description
DisconnectPeer ( NetPeer peer ) : void

Disconnect peer from server

GetPeers ( ) : LiteNetLib.NetPeer[]

Get copy of current connected peers

NetServer ( INetEventListener listener, int maxClients, string key ) : System

Creates server object

SendToClients ( NetDataWriter writer, SendOptions options ) : void
SendToClients ( NetDataWriter writer, SendOptions options, NetPeer excludePeer ) : void
SendToClients ( byte data, SendOptions options ) : void
SendToClients ( byte data, SendOptions options, NetPeer excludePeer ) : void
SendToClients ( byte data, int start, int length, SendOptions options ) : void
SendToClients ( byte data, int start, int length, SendOptions options, NetPeer excludePeer ) : void
Stop ( ) : void

Protected Methods

Method Description
PostProcessEvent ( int deltaTime ) : void
ProcessReceiveError ( int socketErrorCode ) : void
ReceiveFromSocket ( byte reusableBuffer, int count, NetEndPoint remoteEndPoint ) : void

Private Methods

Method Description
ClearPeers ( ) : void
ProcessSendError ( NetEndPoint remoteEndPoint, int socketErrorCode ) : void
ReceiveFromPeer ( NetPacket packet, NetEndPoint remoteEndPoint ) : void
RemovePeer ( NetPeer peer ) : void
SendConnectAccept ( NetPeer peer, ulong id ) : void

Method Details

DisconnectPeer() public method

Disconnect peer from server
public DisconnectPeer ( NetPeer peer ) : void
peer NetPeer peer to disconnect
return void

GetPeers() public method

Get copy of current connected peers
public GetPeers ( ) : LiteNetLib.NetPeer[]
return LiteNetLib.NetPeer[]

NetServer() public method

Creates server object
public NetServer ( INetEventListener listener, int maxClients, string key ) : System
listener INetEventListener Listener of server events
maxClients int Maximum clients
key string Application key to identify connecting clients
return System

PostProcessEvent() protected method

protected PostProcessEvent ( int deltaTime ) : void
deltaTime int
return void

ProcessReceiveError() protected method

protected ProcessReceiveError ( int socketErrorCode ) : void
socketErrorCode int
return void

ReceiveFromSocket() protected method

protected ReceiveFromSocket ( byte reusableBuffer, int count, NetEndPoint remoteEndPoint ) : void
reusableBuffer byte
count int
remoteEndPoint NetEndPoint
return void

SendToClients() public method

public SendToClients ( NetDataWriter writer, SendOptions options ) : void
writer LiteNetLib.Utils.NetDataWriter
options SendOptions
return void

SendToClients() public method

public SendToClients ( NetDataWriter writer, SendOptions options, NetPeer excludePeer ) : void
writer LiteNetLib.Utils.NetDataWriter
options SendOptions
excludePeer NetPeer
return void

SendToClients() public method

public SendToClients ( byte data, SendOptions options ) : void
data byte
options SendOptions
return void

SendToClients() public method

public SendToClients ( byte data, SendOptions options, NetPeer excludePeer ) : void
data byte
options SendOptions
excludePeer NetPeer
return void

SendToClients() public method

public SendToClients ( byte data, int start, int length, SendOptions options ) : void
data byte
start int
length int
options SendOptions
return void

SendToClients() public method

public SendToClients ( byte data, int start, int length, SendOptions options, NetPeer excludePeer ) : void
data byte
start int
length int
options SendOptions
excludePeer NetPeer
return void

Stop() public method

public Stop ( ) : void
return void