#include <Connection.h>
Public Member Functions | |
Connection () | |
Public constructor. | |
virtual | ~Connection () |
Virtual destructor. | |
common::ErrorCodeType | Run (network::TcpSocket *pSocket, Database *pDatabase) |
Runs connection. | |
Private Member Functions | |
void | ProcessConnection () |
Processes connection. | |
void | ProcessCommand (const network::Message &rCommand) |
Processes command. | |
void | ProcessLoginCommand (const network::Message &rCommand) |
Processes login command. | |
void | SendMessage (const std::string &rMessage) |
void | SendConnectMessage () |
void | SendErrorMessage (const std::string &rCommand, const std::string &rResult) |
void | LogMessage (const network::Message &rMessage) |
Logs message. | |
void | CreateEventMessage (const std::string &rType, network::Message &rMessage) |
Creates event message. | |
Static Private Member Functions | |
static void | ConnectionThread (Connection *pConnection) |
Connection thread. | |
Private Attributes | |
network::TcpSocket * | m_pSocket |
Pointer to socket for this connection. | |
Database * | m_pDatabase |
Pointer to database for this connection. | |
bool | m_Connected |
Connected flag. | |
int | m_SessionState |
Session state. | |
common::Player | m_Player |
Player used during login. | |
int | m_ConnectionId |
Connection ID. | |
Static Private Attributes | |
static int | m_ConnectionCount = 0 |
Connection count. |
Connection | ( | ) |
Public constructor.
~Connection | ( | ) | [virtual] |
Virtual destructor.
common::ErrorCodeType Run | ( | network::TcpSocket * | pSocket, | |
Database * | pDatabase | |||
) |
Runs connection.
Failure otherwise.
pSocket | Pointer to socket. |
pDatabase | Pointer to database. |
void ConnectionThread | ( | Connection * | pConnection | ) | [static, private] |
Connection thread.
Failure otherwise.
void ProcessConnection | ( | ) | [private] |
Processes connection.
void ProcessCommand | ( | const network::Message & | rCommand | ) | [private] |
Processes command.
void ProcessLoginCommand | ( | const network::Message & | rCommand | ) | [private] |
Processes login command.
void SendMessage | ( | const std::string & | rMessage | ) | [private] |
rMessage | Message to be sent. |
void SendConnectMessage | ( | ) | [private] |
void SendErrorMessage | ( | const std::string & | rCommand, | |
const std::string & | rResult | |||
) | [private] |
rCommand | Command that caused error. |
rResult | Error result. |
void LogMessage | ( | const network::Message & | rMessage | ) | [private] |
Logs message.
rMessage | Message to be logged. |
void CreateEventMessage | ( | const std::string & | rType, | |
network::Message & | rMessage | |||
) | [private] |
Creates event message.
rType | Event type. |
rMessage | Event message. |
network::TcpSocket* m_pSocket [private] |
Pointer to socket for this connection.
Database* m_pDatabase [private] |
Pointer to database for this connection.
bool m_Connected [private] |
Connected flag.
int m_SessionState [private] |
Session state.
common::Player m_Player [private] |
Player used during login.
int m_ConnectionId [private] |
Connection ID.
int m_ConnectionCount = 0 [static, private] |
Connection count.
Navigation
Home Page
Screen Shots
Developers
Documentation
Doxygen
Namespace List
Class List
Class Hierarchy
File List
Todo List
Links
SDL Library
License
SourceForge Project
Forums
Download
Regimental Command
Copyright © 2008
Randi J. Relander