C# Class OpenStory.Server.Processing.ClientBase

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

Méthodes publiques

Méthode 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.

Méthodes protégées

Méthode 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

Méthode 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 méthode

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.
Résultat System

Disconnect() public méthode

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

Dispose() public méthode

public Dispose ( ) : void
Résultat void

ProcessPacket() protected abstract méthode

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.
Résultat void

WritePacket() public méthode

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