ManaPlus
|
#include <network.h>
Public Member Functions | |
Network () | |
~Network () | |
void | clearHandlers () |
bool | messageReady () |
void | dispatchMessages () |
void | registerHandlers () |
Public Member Functions inherited from Ea::Network | |
Network () | |
bool | connect (const ServerInfo &server) |
void | disconnect () |
ServerInfo | getServer () const |
int | getState () const |
const std::string & | getError () const |
bool | isConnected () const |
int | getInSize () const |
void | skip (const int len) |
void | flush () |
void | fixSendBuffer () |
void | pauseDispatch () |
Static Public Attributes | |
static Network * | mInstance = 0 |
Static Protected Member Functions | |
static Network * | instance () |
Friends | |
class | MessageOut |
Additional Inherited Members | |
Public Types inherited from Ea::Network | |
enum | { IDLE = 0 , CONNECTED , CONNECTING , DATA , NET_ERROR } |
Protected Member Functions inherited from Ea::Network | |
void | setError (const std::string &error) |
uint16_t | readWord (const int pos) const |
bool | realConnect () |
void | receive () |
Protected Attributes inherited from Ea::Network | |
TcpNet::Socket | mSocket |
ServerInfo | mServer |
PacketInfo * | mPackets |
char * | mInBuffer |
char * | mOutBuffer |
unsigned int | mInSize |
unsigned int | mOutSize |
unsigned int | mToSkip |
int | mState |
std::string | mError |
SDL_Thread * | mWorkerThread |
SDL_mutex * | mMutexIn |
SDL_mutex * | mMutexOut |
int | mSleep |
bool | mPauseDispatch |
TmwAthena::Network::Network | ( | ) |
Definition at line 74 of file network.cpp.
References TmwAthena::messagesSize, mInstance, and Ea::Network::mPackets.
|
virtual |
Reimplemented from Ea::Network.
Definition at line 81 of file network.cpp.
References clearHandlers(), and mInstance.
void TmwAthena::Network::clearHandlers | ( | ) |
Definition at line 93 of file network.cpp.
References PacketInfo::func, PacketInfo::len, Ea::Network::mPackets, PacketInfo::name, TmwAthena::packet_lengths_size, and PacketInfo::version.
Referenced by TmwAthena::GeneralHandler::clearHandlers(), TmwAthena::updateProtocol(), and ~Network().
void TmwAthena::Network::dispatchMessages | ( | ) |
Definition at line 104 of file network.cpp.
References BLOCK_END, BLOCK_START, PacketInfo::func, PacketInfo::len, Logger::log(), logger, messageReady(), TmwAthena::messagesSize, Ea::Network::mInBuffer, Ea::Network::mMutexIn, Ea::Network::mPackets, Ea::Network::mPauseDispatch, Actions::msg(), TmwAthena::packet_lengths_size, Ea::Network::readWord(), Logger::safeError(), Ea::Network::skip(), and strprintf().
Referenced by TmwAthena::GeneralHandler::flushNetwork().
|
staticprotected |
bool TmwAthena::Network::messageReady | ( | ) |
Definition at line 155 of file network.cpp.
References CAST_U32, PacketInfo::len, Ea::Network::mInSize, Ea::Network::mMutexIn, Ea::Network::mPackets, TmwAthena::packet_lengths_size, and Ea::Network::readWord().
Referenced by dispatchMessages().
void TmwAthena::Network::registerHandlers | ( | ) |
Definition at line 87 of file network.cpp.
Referenced by TmwAthena::GeneralHandler::load(), and TmwAthena::updateProtocol().
|
friend |
|
static |
Definition at line 54 of file network.h.
Referenced by TmwAthena::GeneralHandler::clearHandlers(), TmwAthena::CharServerHandler::connect(), TmwAthena::GameHandler::connect(), TmwAthena::LoginHandler::connect(), TmwAthena::GameHandler::disconnect(), TmwAthena::LoginHandler::disconnect(), TmwAthena::GeneralHandler::flushNetwork(), TmwAthena::GeneralHandler::flushSend(), instance(), TmwAthena::GameHandler::isConnected(), TmwAthena::LoginHandler::isConnected(), TmwAthena::GeneralHandler::load(), Network(), TmwAthena::CharServerRecv::processChangeMapServer(), TmwAthena::CharServerRecv::processCharMapInfo(), TmwAthena::GameRecv::processMapLogin(), TmwAthena::GeneralHandler::reload(), TmwAthena::updateProtocol(), TmwAthena::GeneralHandler::~GeneralHandler(), and ~Network().