ManaPlus
|
#include <network.h>
Public Member Functions | |
Network () | |
~Network () | |
void | clearHandlers () |
bool | messageReady () |
void | dispatchMessages () |
void | registerHandlers () |
void | registerFakeHandlers () |
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 |
EAthena::Network::Network | ( | ) |
Definition at line 112 of file network.cpp.
References EAthena::messagesSize, mInstance, and Ea::Network::mPackets.
|
virtual |
Reimplemented from Ea::Network.
Definition at line 119 of file network.cpp.
References clearHandlers(), and mInstance.
void EAthena::Network::clearHandlers | ( | ) |
Definition at line 183 of file network.cpp.
References PacketInfo::func, PacketInfo::len, Ea::Network::mPackets, PacketInfo::name, EAthena::packet_lengths_size, and PacketInfo::version.
Referenced by EAthena::GeneralHandler::clearHandlers(), EAthena::updateProtocol(), and ~Network().
void EAthena::Network::dispatchMessages | ( | ) |
Definition at line 194 of file network.cpp.
References PacketInfo::func, PacketInfo::len, Logger::log(), logger, messageReady(), EAthena::messagesSize, Ea::Network::mInBuffer, Ea::Network::mMutexIn, Ea::Network::mPackets, Ea::Network::mPauseDispatch, Actions::msg(), EAthena::packet_lengths_size, packetVersion, Ea::Network::readWord(), Logger::safeError(), Ea::Network::skip(), strprintf(), and PacketInfo::version.
Referenced by EAthena::GeneralHandler::flushNetwork().
|
staticprotected |
bool EAthena::Network::messageReady | ( | ) |
Definition at line 238 of file network.cpp.
References CAST_U32, PacketInfo::len, Ea::Network::mInSize, Ea::Network::mMutexIn, Ea::Network::mPackets, EAthena::packet_lengths_size, and Ea::Network::readWord().
Referenced by dispatchMessages().
void EAthena::Network::registerFakeHandlers | ( | ) |
Definition at line 131 of file network.cpp.
References CAST_S32, FOR_EACH, PacketInfo::func, NetworkDb::getFakePackets(), NetworkDb::getRemovePackets(), PacketInfo::len, Logger::log(), logger, Ea::Network::mPackets, PacketInfo::name, EAthena::packet_lengths_size, reportAlways, and PacketInfo::version.
Referenced by EAthena::updateProtocol().
void EAthena::Network::registerHandlers | ( | ) |
Definition at line 125 of file network.cpp.
Referenced by EAthena::GeneralHandler::load(), and EAthena::updateProtocol().
|
friend |
|
static |
Definition at line 57 of file network.h.
Referenced by EAthena::GeneralHandler::clearHandlers(), EAthena::CharServerHandler::connect(), EAthena::GameHandler::connect(), EAthena::LoginHandler::connect(), EAthena::GameHandler::disconnect(), EAthena::LoginHandler::disconnect(), EAthena::GeneralHandler::flushNetwork(), EAthena::GeneralHandler::flushSend(), instance(), EAthena::GameHandler::isConnected(), EAthena::LoginHandler::isConnected(), EAthena::GeneralHandler::load(), Network(), EAthena::CharServerRecv::processChangeMapServer(), EAthena::CharServerRecv::processCharMapInfo(), EAthena::GameRecv::processMapLogin(), EAthena::GeneralHandler::reload(), EAthena::updateProtocol(), EAthena::GeneralHandler::~GeneralHandler(), and ~Network().