C# Class OpenStory.Server.Processing.ClientBase

Represents a base class for all server clients.
This class is abstract.
Inheritance: IDisposable
Mostrar archivo Open project: shoftee/OpenStory

Public Methods

Method Description
Disconnect ( string reason = null ) : void

Immediately disconnects the client from the server.

Dispose ( ) : void
WritePacket ( byte data ) : void

Writes a packet to the client's stream.

Protected Methods

Method Description
ClientBase ( IServerSession serverSession, IPacketFactory packetFactory, ILogger logger ) : System

Initializes a new instance of the ClientBase class.

ProcessPacket ( PacketProcessingEventArgs args ) : void

When implemented in a derived class, processes the provided packet data.

Private Methods

Method Description
HandlePacket ( PacketProcessingEventArgs e ) : void
HandlePong ( ) : void
InitializeSession ( IServerSession serverSession ) : IServerSession
InitializeTimer ( ) : Timer
LogDisconnectReason ( IAccountSession session, string reason ) : void
OnClosing ( ) : void
OnPacketProcessing ( object sender, PacketProcessingEventArgs e ) : void
OnSessionClosing ( object sender, ConnectionClosingEventArgs e ) : void
SendPing ( object sender, System.Timers.ElapsedEventArgs e ) : void

Method Details

ClientBase() protected method

Initializes a new instance of the ClientBase class.
Thrown if any of the parameters is .
protected ClientBase ( IServerSession serverSession, IPacketFactory packetFactory, ILogger logger ) : System
serverSession IServerSession The network session to bind the instance to.
packetFactory IPacketFactory The to use for this client.
logger ILogger The logger to use for this client.
return System

Disconnect() public method

Immediately disconnects the client from the server.
public Disconnect ( string reason = null ) : void
reason string The reason for the disconnection.
return void

Dispose() public method

public Dispose ( ) : void
return void

ProcessPacket() protected abstract method

When implemented in a derived class, processes the provided packet data.
protected abstract ProcessPacket ( PacketProcessingEventArgs args ) : void
args OpenStory.Framework.Contracts.PacketProcessingEventArgs The packet to be processed.
return void

WritePacket() public method

Writes a packet to the client's stream.
public WritePacket ( byte data ) : void
data byte The data of the packet.
return void