#include <src/network/GamestateManager.h>
Public Member Functions | |
bool | ack (unsigned int gamestateID, unsigned int clientID) |
bool | add (packet::Gamestate *gs, unsigned int clientID) |
void | finishGamestate (unsigned int clientID, packet::Gamestate **destgamestate, packet::Gamestate *base, packet::Gamestate *gamestate) |
GamestateManager () | |
bool | getSnapshot () |
bool | processGamestates () |
void | removeClient (ClientInformation *client) |
void | sendGamestates () |
bool | update () |
~GamestateManager () | |
Private Member Functions | |
bool | processGamestate (packet::Gamestate *gs) |
Private Attributes | |
std::map< unsigned int, std::map< unsigned int, packet::Gamestate * > > | gamestateMap_ |
std::map< unsigned int, packet::Gamestate * > | gamestateQueue |
unsigned int | id_ |
ThreadPool * | Pool_ |
packet::Gamestate * | reference |
TrafficControl * | trafficControl_ |
orxonox::GamestateManager::GamestateManager | ( | ) |
References trafficControl_.
orxonox::GamestateManager::~GamestateManager | ( | ) |
References gamestateMap_, gamestateQueue, reference, and trafficControl_.
bool orxonox::GamestateManager::ack | ( | unsigned int | gamestateID, | |
unsigned int | clientID | |||
) | [virtual] |
bool orxonox::GamestateManager::add | ( | packet::Gamestate * | gs, | |
unsigned int | clientID | |||
) | [virtual] |
void orxonox::GamestateManager::finishGamestate | ( | unsigned int | clientID, | |
packet::Gamestate ** | destgamestate, | |||
packet::Gamestate * | base, | |||
packet::Gamestate * | gamestate | |||
) |
bool orxonox::GamestateManager::getSnapshot | ( | ) |
References orxonox::packet::Gamestate::collectData(), orxonox::packet::Type::Gamestate, id_, and reference.
Referenced by update().
bool orxonox::GamestateManager::processGamestate | ( | packet::Gamestate * | gs | ) | [private] |
bool orxonox::GamestateManager::processGamestates | ( | ) |
References orxonox::NetworkCallbackManager::callCallbacks(), gamestateQueue, and processGamestate().
Referenced by orxonox::Server::update().
void orxonox::GamestateManager::removeClient | ( | ClientInformation * | client | ) |
References gamestateMap_, and orxonox::ClientInformation::getID().
Referenced by orxonox::Server::disconnectClient().
void orxonox::GamestateManager::sendGamestates | ( | ) |
References COUT, finishGamestate(), orxonox::GAMESTATEID_INITIAL, gamestateMap_, orxonox::ClientInformation::getBegin(), orxonox::ClientInformation::getGamestateID(), orxonox::ClientInformation::getID(), orxonox::ClientInformation::getPacketLoss(), orxonox::ClientInformation::getRTT(), orxonox::ClientInformation::getSynched(), orxonox::ClientInformation::next(), and reference.
Referenced by orxonox::Server::sendGameState().
bool orxonox::GamestateManager::update | ( | ) |
std::map<unsigned int, std::map<unsigned int, packet::Gamestate*> > orxonox::GamestateManager::gamestateMap_ [private] |
Referenced by ack(), finishGamestate(), removeClient(), sendGamestates(), and ~GamestateManager().
std::map<unsigned int, packet::Gamestate*> orxonox::GamestateManager::gamestateQueue [private] |
Referenced by add(), processGamestates(), and ~GamestateManager().
unsigned int orxonox::GamestateManager::id_ [private] |
Referenced by getSnapshot().
ThreadPool* orxonox::GamestateManager::Pool_ [private] |
Referenced by getSnapshot(), sendGamestates(), and ~GamestateManager().
Referenced by GamestateManager(), and ~GamestateManager().