#include <netLobby.h>
Public Member Functions | |
NetLobby (Engine *eng) | |
void | run () |
void | sendLobbyClientResponse (const std::string &clientIP, int port, int side, int player) |
void | lobbyStart () |
void | lobbyJoinGame (const std::string &ip, int port) |
void | lobbyExitGame (const std::string &ip, int port) |
void | lobbySlotSwapReq (const std::string &serverip, int port, int newpos, int oldpos, int newside, int newplayer) |
virtual | ~NetLobby () |
NetLobby (Engine *eng) | |
void | run () |
void | sendLobbyClientResponse (const std::string &clientIP, int port, int side, int player) |
void | lobbyStart () |
void | lobbyJoinGame (const std::string &ip, int port) |
void | lobbyExitGame (const std::string &ip, int port) |
void | lobbySlotSwapReq (const std::string &serverip, int port, int newpos, int oldpos, int newside, int newplayer) |
virtual | ~NetLobby () |
NetLobby (Engine *eng) | |
void | run () |
void | sendLobbyClientResponse (const std::string &clientIP, int port, int side, int player) |
void | lobbyStart () |
void | lobbyJoinGame (const std::string &ip, int port) |
void | lobbyExitGame (const std::string &ip, int port) |
void | lobbySlotSwapReq (const std::string &serverip, int port, int newpos, int oldpos, int newside, int newplayer) |
virtual | ~NetLobby () |
Public Attributes | |
std::string | myIPAddress |
int | port |
bool | quit |
Private Member Functions | |
void | init () |
void | runThread () |
LobbyServer * | fillLobbyClients (const std::string &gameName, const std::string &ip, int port, int side, int player, int slot, bool isHost) |
void | handleClientMessages () |
void | handleServerMessages () |
void | clientTick () |
void | serverTick () |
void | sendLobbyServerInfo () |
void | updateLobbyServer (Message *m) |
void | joinRequest (Message *m) |
void | clientEnter (Message *m) |
void | serverExit (Message *m) |
void | clientExit (Message *m) |
void | clientSwap (Message *m) |
void | startByRemote (Message *m) |
void | init () |
void | runThread () |
LobbyServer * | fillLobbyClients (const std::string &gameName, const std::string &ip, int port, int side, int player, int slot, bool isHost) |
void | handleClientMessages () |
void | handleServerMessages () |
void | clientTick () |
void | serverTick () |
void | sendLobbyServerInfo () |
void | updateLobbyServer (Message *m) |
void | joinRequest (Message *m) |
void | clientEnter (Message *m) |
void | serverExit (Message *m) |
void | clientExit (Message *m) |
void | clientSwap (Message *m) |
void | startByRemote (Message *m) |
void | init () |
void | runThread () |
LobbyServer * | fillLobbyClients (const std::string &gameName, const std::string &ip, int port, int side, int player, int slot, bool isHost) |
void | handleClientMessages () |
void | handleServerMessages () |
void | clientTick () |
void | serverTick () |
void | sendLobbyServerInfo () |
void | updateLobbyServer (Message *m) |
void | joinRequest (Message *m) |
void | clientEnter (Message *m) |
void | serverExit (Message *m) |
void | clientExit (Message *m) |
void | clientSwap (Message *m) |
void | startByRemote (Message *m) |
Private Attributes | |
boost::thread | netThread |
int | TICK_SLEEP_TIME |
ptime | startTime |
boost::posix_time::milliseconds * | sleepTime |
boost::posix_time::milliseconds * | lobbySleepTime |
NetCommon * | netCommon |
Engine * | engine |
Listener * | listener |
Sender * | sender |
boost::posix_time::milliseconds * | sleepTime |
boost::posix_time::milliseconds * | lobbySleepTime |
NetCommon * | netCommon |
Engine * | engine |
Listener * | listener |
Sender * | sender |
boost::posix_time::milliseconds * | sleepTime |
boost::posix_time::milliseconds * | lobbySleepTime |
NetCommon * | netCommon |
Engine * | engine |
Listener * | listener |
Sender * | sender |
Definition at line 24 of file netLobby.h.
FastEcslent::NetLobby::NetLobby | ( | Engine * | eng | ) |
FastEcslent::NetLobby::~NetLobby | ( | ) | [virtual] |
Definition at line 346 of file netLobby.cpp.
References listener, lobbySleepTime, netCommon, sender, and sleepTime.
FastEcslent::NetLobby::NetLobby | ( | Engine * | eng | ) |
virtual FastEcslent::NetLobby::~NetLobby | ( | ) | [virtual] |
FastEcslent::NetLobby::NetLobby | ( | Engine * | eng | ) |
virtual FastEcslent::NetLobby::~NetLobby | ( | ) | [virtual] |
void FastEcslent::NetLobby::init | ( | void | ) | [private] |
Definition at line 23 of file netLobby.cpp.
References engine, getCurrentTime(), FastEcslent::NetCommon::getMyIP(), FastEcslent::Sender::init(), FastEcslent::Listener::init(), Options::isServer, listener, lobbySleepTime, myIPAddress, netCommon, Options::networkPort, FastEcslent::Engine::options, quit, sender, sleepTime, startTime, and TICK_SLEEP_TIME.
Referenced by NetLobby().
void FastEcslent::NetLobby::runThread | ( | ) | [private] |
Definition at line 43 of file netLobby.cpp.
References clientTick(), engine, Options::isServer, listener, lobbySleepTime, FastEcslent::Engine::options, quit, FastEcslent::Sender::run(), FastEcslent::Listener::run(), sender, serverTick(), and sleepTime.
Referenced by run().
FastEcslent::LobbyServer * FastEcslent::NetLobby::fillLobbyClients | ( | const std::string & | gameName, | |
const std::string & | ip, | |||
int | port, | |||
int | side, | |||
int | player, | |||
int | slot, | |||
bool | isHost | |||
) | [private] |
Definition at line 93 of file netLobby.cpp.
References ip_string_to_int().
Referenced by sendLobbyServerInfo().
void FastEcslent::NetLobby::handleClientMessages | ( | ) | [private] |
Definition at line 183 of file netLobby.cpp.
References clientExit(), clientSwap(), FastEcslent::Listener::dequeMessage(), joinRequest(), listener, FastEcslent::LOBBYEXITTYPE, FastEcslent::LOBBYJOINREQUESTTYPE, and FastEcslent::LOBBYSLOTSWAPTYPE.
Referenced by serverTick().
void FastEcslent::NetLobby::handleServerMessages | ( | ) | [private] |
Definition at line 198 of file netLobby.cpp.
References clientEnter(), FastEcslent::Listener::dequeMessage(), listener, FastEcslent::LOBBYEXITTYPE, FastEcslent::LOBBYGAMESTARTTYPE, FastEcslent::LOBBYJOINRESPONSETYPE, FastEcslent::LOBBYSERVERTYPE, serverExit(), startByRemote(), and updateLobbyServer().
Referenced by clientTick().
void FastEcslent::NetLobby::clientTick | ( | ) | [private] |
Definition at line 151 of file netLobby.cpp.
References handleServerMessages().
Referenced by runThread().
void FastEcslent::NetLobby::serverTick | ( | ) | [private] |
Lobby broadcast message
Definition at line 61 of file netLobby.cpp.
References handleClientMessages(), and sendLobbyServerInfo().
Referenced by runThread().
void FastEcslent::NetLobby::sendLobbyServerInfo | ( | ) | [private] |
Definition at line 66 of file netLobby.cpp.
References FastEcslent::Sender::addMessage(), engine, fillLobbyClients(), FastEcslent::NetCommon::getCurrentTimeLong(), FastEcslent::Engine::gfx, FastEcslent::GfxThread::gimPtr, OgreGFX::GraphicsInteractionManager::lobbyMgr, FastEcslent::LobbyServerSize, FastEcslent::LOBBYSERVERTYPE, netCommon, and sender.
Referenced by serverTick().
void FastEcslent::NetLobby::updateLobbyServer | ( | Message * | m | ) | [private] |
Definition at line 155 of file netLobby.cpp.
References engine, FastEcslent::Engine::gfx, FastEcslent::GfxThread::gimPtr, ip_int_to_string(), OgreGFX::GraphicsInteractionManager::lobbyMgr, FastEcslent::LobbyServerSize, port, and trim().
Referenced by handleServerMessages().
void FastEcslent::NetLobby::joinRequest | ( | Message * | m | ) | [private] |
Definition at line 109 of file netLobby.cpp.
References engine, FastEcslent::Engine::gfx, FastEcslent::GfxThread::gimPtr, ip_int_to_string(), FastEcslent::LobbyJoinRequestSize, OgreGFX::GraphicsInteractionManager::lobbyMgr, myIPAddress, and trim().
Referenced by handleClientMessages().
void FastEcslent::NetLobby::clientEnter | ( | Message * | m | ) | [private] |
Definition at line 215 of file netLobby.cpp.
References engine, FastEcslent::Engine::gfx, FastEcslent::GfxThread::gimPtr, ip_int_to_string(), FastEcslent::LobbyJoinResponseSize, and OgreGFX::GraphicsInteractionManager::lobbyMgr.
Referenced by handleServerMessages().
void FastEcslent::NetLobby::serverExit | ( | Message * | m | ) | [private] |
Definition at line 236 of file netLobby.cpp.
References engine, FastEcslent::Engine::gfx, FastEcslent::GfxThread::gimPtr, ip_int_to_string(), FastEcslent::LobbyExitSize, and OgreGFX::GraphicsInteractionManager::lobbyMgr.
Referenced by handleServerMessages().
void FastEcslent::NetLobby::clientExit | ( | Message * | m | ) | [private] |
Definition at line 224 of file netLobby.cpp.
References engine, FastEcslent::Engine::gfx, FastEcslent::GfxThread::gimPtr, ip_int_to_string(), FastEcslent::LobbyExitSize, and OgreGFX::GraphicsInteractionManager::lobbyMgr.
Referenced by handleClientMessages().
void FastEcslent::NetLobby::clientSwap | ( | Message * | m | ) | [private] |
Definition at line 248 of file netLobby.cpp.
References engine, FastEcslent::Engine::gfx, FastEcslent::GfxThread::gimPtr, ip_int_to_string(), OgreGFX::GraphicsInteractionManager::lobbyMgr, FastEcslent::LobbySlotSwapSize, myIPAddress, Options::networkPort, and FastEcslent::Engine::options.
Referenced by handleClientMessages().
void FastEcslent::NetLobby::startByRemote | ( | Message * | m | ) | [private] |
Definition at line 120 of file netLobby.cpp.
References engine, FastEcslent::Engine::gfx, FastEcslent::GfxThread::gimPtr, ip_int_to_string(), FastEcslent::LobbyGameStartSize, and OgreGFX::GraphicsInteractionManager::lobbyMgr.
Referenced by handleServerMessages().
void FastEcslent::NetLobby::run | ( | ) |
Definition at line 19 of file netLobby.cpp.
References netThread, and runThread().
Referenced by OgreGFX::LobbyMgr::init().
void FastEcslent::NetLobby::sendLobbyClientResponse | ( | const std::string & | clientIP, | |
int | port, | |||
int | side, | |||
int | player | |||
) |
Definition at line 129 of file netLobby.cpp.
References FastEcslent::Sender::addMessage(), engine, FastEcslent::NetCommon::getCurrentTimeLong(), ip_string_to_int(), FastEcslent::LobbyJoinResponseSize, FastEcslent::LOBBYJOINRESPONSETYPE, myIPAddress, netCommon, Options::networkPort, FastEcslent::Engine::options, and sender.
Referenced by OgreGFX::LobbyMgr::handleJoinRequest().
void FastEcslent::NetLobby::lobbyStart | ( | ) |
Definition at line 260 of file netLobby.cpp.
References FastEcslent::Sender::addMessage(), engine, FastEcslent::NetCommon::getCurrentTimeLong(), ip_string_to_int(), FastEcslent::LobbyGameStartSize, FastEcslent::LOBBYGAMESTARTTYPE, myIPAddress, netCommon, Options::networkPort, FastEcslent::Engine::options, and sender.
Referenced by OgreGFX::LobbyMgr::loadGame().
void FastEcslent::NetLobby::lobbyJoinGame | ( | const std::string & | ip, | |
int | port | |||
) |
Definition at line 278 of file netLobby.cpp.
References FastEcslent::Sender::addMessage(), FastEcslent::NetCommon::getCurrentTimeLong(), ip_string_to_int(), FastEcslent::LobbyJoinRequestSize, FastEcslent::LOBBYJOINREQUESTTYPE, myIPAddress, netCommon, and sender.
Referenced by OgreGFX::LobbyMgr::joinGame().
void FastEcslent::NetLobby::lobbyExitGame | ( | const std::string & | ip, | |
int | port | |||
) |
Definition at line 301 of file netLobby.cpp.
References FastEcslent::Sender::addMessage(), FastEcslent::NetCommon::getCurrentTimeLong(), ip_string_to_int(), FastEcslent::LobbyExitSize, FastEcslent::LOBBYEXITTYPE, myIPAddress, netCommon, and sender.
Referenced by OgreGFX::LobbyMgr::handleExitButton().
void FastEcslent::NetLobby::lobbySlotSwapReq | ( | const std::string & | serverip, | |
int | port, | |||
int | newpos, | |||
int | oldpos, | |||
int | newside, | |||
int | newplayer | |||
) |
Definition at line 322 of file netLobby.cpp.
References FastEcslent::Sender::addMessage(), FastEcslent::NetCommon::getCurrentTimeLong(), ip_string_to_int(), FastEcslent::LobbySlotSwapSize, FastEcslent::LOBBYSLOTSWAPTYPE, netCommon, and sender.
Referenced by OgreGFX::LobbyMgr::itemSelected().
void FastEcslent::NetLobby::init | ( | ) | [private] |
void FastEcslent::NetLobby::runThread | ( | ) | [private] |
LobbyServer* FastEcslent::NetLobby::fillLobbyClients | ( | const std::string & | gameName, | |
const std::string & | ip, | |||
int | port, | |||
int | side, | |||
int | player, | |||
int | slot, | |||
bool | isHost | |||
) | [private] |
void FastEcslent::NetLobby::handleClientMessages | ( | ) | [private] |
void FastEcslent::NetLobby::handleServerMessages | ( | ) | [private] |
void FastEcslent::NetLobby::clientTick | ( | ) | [private] |
void FastEcslent::NetLobby::serverTick | ( | ) | [private] |
void FastEcslent::NetLobby::sendLobbyServerInfo | ( | ) | [private] |
void FastEcslent::NetLobby::updateLobbyServer | ( | Message * | m | ) | [private] |
void FastEcslent::NetLobby::joinRequest | ( | Message * | m | ) | [private] |
void FastEcslent::NetLobby::clientEnter | ( | Message * | m | ) | [private] |
void FastEcslent::NetLobby::serverExit | ( | Message * | m | ) | [private] |
void FastEcslent::NetLobby::clientExit | ( | Message * | m | ) | [private] |
void FastEcslent::NetLobby::clientSwap | ( | Message * | m | ) | [private] |
void FastEcslent::NetLobby::startByRemote | ( | Message * | m | ) | [private] |
void FastEcslent::NetLobby::run | ( | ) |
void FastEcslent::NetLobby::sendLobbyClientResponse | ( | const std::string & | clientIP, | |
int | port, | |||
int | side, | |||
int | player | |||
) |
void FastEcslent::NetLobby::lobbyStart | ( | ) |
void FastEcslent::NetLobby::lobbyJoinGame | ( | const std::string & | ip, | |
int | port | |||
) |
void FastEcslent::NetLobby::lobbyExitGame | ( | const std::string & | ip, | |
int | port | |||
) |
void FastEcslent::NetLobby::lobbySlotSwapReq | ( | const std::string & | serverip, | |
int | port, | |||
int | newpos, | |||
int | oldpos, | |||
int | newside, | |||
int | newplayer | |||
) |
void FastEcslent::NetLobby::init | ( | ) | [private] |
void FastEcslent::NetLobby::runThread | ( | ) | [private] |
LobbyServer* FastEcslent::NetLobby::fillLobbyClients | ( | const std::string & | gameName, | |
const std::string & | ip, | |||
int | port, | |||
int | side, | |||
int | player, | |||
int | slot, | |||
bool | isHost | |||
) | [private] |
void FastEcslent::NetLobby::handleClientMessages | ( | ) | [private] |
void FastEcslent::NetLobby::handleServerMessages | ( | ) | [private] |
void FastEcslent::NetLobby::clientTick | ( | ) | [private] |
void FastEcslent::NetLobby::serverTick | ( | ) | [private] |
void FastEcslent::NetLobby::sendLobbyServerInfo | ( | ) | [private] |
void FastEcslent::NetLobby::updateLobbyServer | ( | Message * | m | ) | [private] |
void FastEcslent::NetLobby::joinRequest | ( | Message * | m | ) | [private] |
void FastEcslent::NetLobby::clientEnter | ( | Message * | m | ) | [private] |
void FastEcslent::NetLobby::serverExit | ( | Message * | m | ) | [private] |
void FastEcslent::NetLobby::clientExit | ( | Message * | m | ) | [private] |
void FastEcslent::NetLobby::clientSwap | ( | Message * | m | ) | [private] |
void FastEcslent::NetLobby::startByRemote | ( | Message * | m | ) | [private] |
void FastEcslent::NetLobby::run | ( | ) |
void FastEcslent::NetLobby::sendLobbyClientResponse | ( | const std::string & | clientIP, | |
int | port, | |||
int | side, | |||
int | player | |||
) |
void FastEcslent::NetLobby::lobbyStart | ( | ) |
void FastEcslent::NetLobby::lobbyJoinGame | ( | const std::string & | ip, | |
int | port | |||
) |
void FastEcslent::NetLobby::lobbyExitGame | ( | const std::string & | ip, | |
int | port | |||
) |
void FastEcslent::NetLobby::lobbySlotSwapReq | ( | const std::string & | serverip, | |
int | port, | |||
int | newpos, | |||
int | oldpos, | |||
int | newside, | |||
int | newplayer | |||
) |
boost::thread FastEcslent::NetLobby::netThread [private] |
int FastEcslent::NetLobby::TICK_SLEEP_TIME [private] |
ptime FastEcslent::NetLobby::startTime [private] |
boost::posix_time::milliseconds* FastEcslent::NetLobby::sleepTime [private] |
boost::posix_time::milliseconds* FastEcslent::NetLobby::lobbySleepTime [private] |
NetCommon* FastEcslent::NetLobby::netCommon [private] |
Definition at line 36 of file netLobby.h.
Referenced by init(), lobbyExitGame(), lobbyJoinGame(), lobbySlotSwapReq(), lobbyStart(), sendLobbyClientResponse(), sendLobbyServerInfo(), and ~NetLobby().
Engine* FastEcslent::NetLobby::engine [private] |
Definition at line 38 of file netLobby.h.
Referenced by clientEnter(), clientExit(), clientSwap(), init(), joinRequest(), lobbyStart(), runThread(), sendLobbyClientResponse(), sendLobbyServerInfo(), serverExit(), startByRemote(), and updateLobbyServer().
Listener* FastEcslent::NetLobby::listener [private] |
Definition at line 39 of file netLobby.h.
Referenced by handleClientMessages(), handleServerMessages(), init(), runThread(), and ~NetLobby().
Sender* FastEcslent::NetLobby::sender [private] |
Definition at line 40 of file netLobby.h.
Referenced by init(), lobbyExitGame(), lobbyJoinGame(), lobbySlotSwapReq(), lobbyStart(), runThread(), sendLobbyClientResponse(), sendLobbyServerInfo(), and ~NetLobby().
std::string FastEcslent::NetLobby::myIPAddress |
Definition at line 65 of file netLobby.h.
Referenced by OgreGFX::LobbyMgr::buttonHit(), clientSwap(), init(), joinRequest(), lobbyExitGame(), lobbyJoinGame(), lobbyStart(), and sendLobbyClientResponse().
Definition at line 68 of file netLobby.h.
Referenced by init(), OgreGFX::LobbyMgr::loadGame(), and runThread().
boost::posix_time::milliseconds* FastEcslent::NetLobby::sleepTime [private] |
Definition at line 33 of file netLobby.h.
boost::posix_time::milliseconds* FastEcslent::NetLobby::lobbySleepTime [private] |
Definition at line 34 of file netLobby.h.
NetCommon* FastEcslent::NetLobby::netCommon [private] |
Definition at line 36 of file netLobby.h.
Engine* FastEcslent::NetLobby::engine [private] |
Definition at line 38 of file netLobby.h.
Listener* FastEcslent::NetLobby::listener [private] |
Definition at line 39 of file netLobby.h.
Sender* FastEcslent::NetLobby::sender [private] |
Definition at line 40 of file netLobby.h.
boost::posix_time::milliseconds* FastEcslent::NetLobby::sleepTime [private] |
Definition at line 33 of file netLobby.h.
boost::posix_time::milliseconds* FastEcslent::NetLobby::lobbySleepTime [private] |
Definition at line 34 of file netLobby.h.
NetCommon* FastEcslent::NetLobby::netCommon [private] |
Definition at line 36 of file netLobby.h.
Engine* FastEcslent::NetLobby::engine [private] |
Definition at line 38 of file netLobby.h.
Listener* FastEcslent::NetLobby::listener [private] |
Definition at line 39 of file netLobby.h.
Sender* FastEcslent::NetLobby::sender [private] |
Definition at line 40 of file netLobby.h.