C# 클래스 Cakewalk.NetEntity

Networking core of the server
상속: IDisposable
파일 보기 프로젝트 열기: Cakez0r/Cakewalk

공개 프로퍼티들

프로퍼티 타입 설명
BIN int
BOUT int
IN int
OUT int

보호된 프로퍼티들

프로퍼티 타입 설명
m_receiveArgs System.Net.Sockets.SocketAsyncEventArgs
m_sendArgs System.Net.Sockets.SocketAsyncEventArgs

공개 메소드들

메소드 설명
Authorise ( ) : void

Send an authorisation request.

DeferredSendPacket ( IPacketBase packet ) : void

Queues a packet to be send on the next update. Will coalesce these packets together.

Dispose ( ) : void

Clean up this entity

NetEntity ( Socket socket, int worldID, SocketAsyncEventArgs sendEventArgs, SocketAsyncEventArgs receiveEventArgs ) : System

Create a new entity from a socket and immediately assign it a world id. Requires async socket context objects with buffers pre-assigned

SendClockSync ( ) : void

Send a clock sync request, if there is not already one pending.

SendPacket ( IPacketBase packet ) : void

Enqueue a packet for sending over the wire

Update ( System.TimeSpan dt ) : void

Updates this entity, flushes and handles any pending packets in the incoming queue.

보호된 메소드들

메소드 설명
HandlePacket ( IPacketBase packet ) : void

Packet handler logic

비공개 메소드들

메소드 설명
DeserializePacket ( IntPtr buffer ) : int

Deserializes a packet from the given buffer. Returns the amount of bytes consumed.

QueueReceive ( ) : void

Begins data receive task on the thread pool

QueueSend ( ) : void

Begins data send task on the thread pool

Receive ( ) : void

Starts an async receive from the socket

ReceiveCompleted ( object sender, SocketAsyncEventArgs e ) : void

Handle a received packet

Send ( ) : void

Poll the outgoing queue and send any packets

SendCompleted ( object sender, SocketAsyncEventArgs e ) : void

Event handler for async send completion

SerializePacket ( IPacketBase packet ) : void

Serialize the given packet into the send buffer.

SyncClock ( int remoteTime ) : void

Synchronises the network clock using any round trip time data available.

메소드 상세

Authorise() 공개 메소드

Send an authorisation request.
public Authorise ( ) : void
리턴 void

DeferredSendPacket() 공개 메소드

Queues a packet to be send on the next update. Will coalesce these packets together.
public DeferredSendPacket ( IPacketBase packet ) : void
packet IPacketBase
리턴 void

Dispose() 공개 메소드

Clean up this entity
public Dispose ( ) : void
리턴 void

HandlePacket() 보호된 메소드

Packet handler logic
protected HandlePacket ( IPacketBase packet ) : void
packet IPacketBase
리턴 void

NetEntity() 공개 메소드

Create a new entity from a socket and immediately assign it a world id. Requires async socket context objects with buffers pre-assigned
public NetEntity ( Socket socket, int worldID, SocketAsyncEventArgs sendEventArgs, SocketAsyncEventArgs receiveEventArgs ) : System
socket System.Net.Sockets.Socket
worldID int
sendEventArgs System.Net.Sockets.SocketAsyncEventArgs
receiveEventArgs System.Net.Sockets.SocketAsyncEventArgs
리턴 System

SendClockSync() 공개 메소드

Send a clock sync request, if there is not already one pending.
public SendClockSync ( ) : void
리턴 void

SendPacket() 공개 메소드

Enqueue a packet for sending over the wire
public SendPacket ( IPacketBase packet ) : void
packet IPacketBase
리턴 void

Update() 공개 메소드

Updates this entity, flushes and handles any pending packets in the incoming queue.
public Update ( System.TimeSpan dt ) : void
dt System.TimeSpan
리턴 void

프로퍼티 상세

BIN 공개적으로 정적으로 프로퍼티

public static int BIN
리턴 int

BOUT 공개적으로 정적으로 프로퍼티

public static int BOUT
리턴 int

IN 공개적으로 정적으로 프로퍼티

public static int IN
리턴 int

OUT 공개적으로 정적으로 프로퍼티

public static int OUT
리턴 int

m_receiveArgs 보호되어 있는 프로퍼티

Async receive context object
protected SocketAsyncEventArgs,System.Net.Sockets m_receiveArgs
리턴 System.Net.Sockets.SocketAsyncEventArgs

m_sendArgs 보호되어 있는 프로퍼티

Async send context object
protected SocketAsyncEventArgs,System.Net.Sockets m_sendArgs
리턴 System.Net.Sockets.SocketAsyncEventArgs