#include <src/network/GamestateClient.h>
Public Member Functions | |
bool | ack (unsigned int gamestateID, unsigned int clientID) |
bool | add (packet::Gamestate *gs, unsigned int clientID) |
void | cleanup () |
GamestateClient () | |
packet::Gamestate * | getGamestate () |
bool | processGamestates () |
~GamestateClient () | |
Private Member Functions | |
void | printGamestateMap () |
packet::Gamestate * | processGamestate (packet::Gamestate *gs) |
void | removeObject (ObjectListIterator< Synchronisable > &it) |
bool | sendAck (unsigned int gamestateID) |
Private Attributes | |
std::map< unsigned int, packet::Gamestate * > | gamestateMap_ |
unsigned int | last_diff_ |
unsigned int | last_gamestate_ |
packet::Gamestate * | tempGamestate_ |
orxonox::GamestateClient::GamestateClient | ( | ) |
References COUT, orxonox::GAMESTATEID_INITIAL, last_diff_, last_gamestate_, and tempGamestate_.
orxonox::GamestateClient::~GamestateClient | ( | ) |
References gamestateMap_, and tempGamestate_.
bool orxonox::GamestateClient::ack | ( | unsigned int | gamestateID, | |
unsigned int | clientID | |||
) | [virtual] |
bool orxonox::GamestateClient::add | ( | packet::Gamestate * | gs, | |
unsigned int | clientID | |||
) | [virtual] |
Implements orxonox::GamestateHandler.
References orxonox::packet::Gamestate::getID(), and tempGamestate_.
void orxonox::GamestateClient::cleanup | ( | ) |
packet::Gamestate * orxonox::GamestateClient::getGamestate | ( | ) |
References orxonox::packet::Gamestate::collectData(), and orxonox::packet::Type::Gamestate.
Referenced by orxonox::Client::update().
void orxonox::GamestateClient::printGamestateMap | ( | ) | [private] |
References COUT, and gamestateMap_.
packet::Gamestate * orxonox::GamestateClient::processGamestate | ( | packet::Gamestate * | gs | ) | [private] |
References COUT, orxonox::packet::Gamestate::decompressData(), gamestateMap_, orxonox::packet::Gamestate::getBaseID(), orxonox::packet::Gamestate::getID(), orxonox::packet::Gamestate::isCompressed(), orxonox::packet::Gamestate::isDiffed(), orxonox::packet::Gamestate::spreadData(), and orxonox::packet::Gamestate::undiff().
Referenced by processGamestates().
bool orxonox::GamestateClient::processGamestates | ( | ) |
References orxonox::NetworkCallbackManager::callCallbacks(), orxonox::GAMESTATEID_INITIAL, gamestateMap_, orxonox::packet::Gamestate::getBaseID(), orxonox::packet::Gamestate::getID(), orxonox::packet::Gamestate::isDiffed(), last_diff_, processGamestate(), sendAck(), and tempGamestate_.
Referenced by orxonox::Client::update().
void orxonox::GamestateClient::removeObject | ( | ObjectListIterator< Synchronisable > & | it | ) | [private] |
bool orxonox::GamestateClient::sendAck | ( | unsigned int | gamestateID | ) | [private] |
References ack(), orxonox::packet::Type::Acknowledgement, COUT, and orxonox::packet::Packet::send().
Referenced by processGamestates().
std::map<unsigned int, packet::Gamestate *> orxonox::GamestateClient::gamestateMap_ [private] |
Referenced by cleanup(), printGamestateMap(), processGamestate(), processGamestates(), and ~GamestateClient().
unsigned int orxonox::GamestateClient::last_diff_ [private] |
Referenced by cleanup(), GamestateClient(), and processGamestates().
unsigned int orxonox::GamestateClient::last_gamestate_ [private] |
Referenced by GamestateClient().
Referenced by add(), cleanup(), GamestateClient(), processGamestates(), and ~GamestateClient().