#include <src/network/packet/Gamestate.h>
Public Member Functions | |
bool | collectData (int id, uint8_t mode=0x0) |
bool | compressData () |
bool | decompressData () |
Gamestate * | diff (Gamestate *base) |
Gamestate * | doSelection (unsigned int clientID, unsigned int targetSize) |
Gamestate (const Gamestate &g) | |
Gamestate (uint8_t *data) | |
Gamestate (uint8_t *data, unsigned int clientID) | |
Gamestate () | |
int32_t | getBaseID () const |
int32_t | getID () const |
bool | isCompressed () const |
bool | isDiffed () const |
bool | operator== (packet::Gamestate gs) |
bool | spreadData (uint8_t mode=0x0) |
Gamestate * | undiff (Gamestate *base) |
~Gamestate () | |
Private Member Functions | |
uint32_t | calcGamestateSize (int32_t id, uint8_t mode=0x0) |
virtual uint32_t | getSize () const |
virtual bool | process () |
void | rawDiff (uint8_t *newdata, uint8_t *data, uint8_t *basedata, uint32_t datalength, uint32_t baselength) |
Private Attributes | |
std::list< obj > | dataVector_ |
GamestateHeader * | header_ |
orxonox::packet::Gamestate::Gamestate | ( | ) |
References orxonox::packet::Packet::flags_, header_, and PACKET_FLAG_GAMESTATE.
Referenced by diff(), doSelection(), and undiff().
orxonox::packet::Gamestate::Gamestate | ( | uint8_t * | data, | |
unsigned int | clientID | |||
) |
orxonox::packet::Gamestate::Gamestate | ( | uint8_t * | data | ) |
orxonox::packet::Gamestate::Gamestate | ( | const Gamestate & | g | ) |
orxonox::packet::Gamestate::~Gamestate | ( | ) |
References header_.
uint32_t orxonox::packet::Gamestate::calcGamestateSize | ( | int32_t | id, | |
uint8_t | mode = 0x0 | |||
) | [private] |
Referenced by collectData().
bool orxonox::packet::Gamestate::collectData | ( | int | id, | |
uint8_t | mode = 0x0 | |||
) |
References calcGamestateSize(), COUT, orxonox::packet::Packet::data_, dataVector_, orxonox::GAMESTATEID_INITIAL, orxonox::packet::GamestateHeader::getSize(), header_, orxonox::packet::GamestateHeader::setBaseID(), orxonox::packet::GamestateHeader::setComplete(), orxonox::packet::GamestateHeader::setCompressed(), orxonox::packet::GamestateHeader::setDataSize(), orxonox::packet::GamestateHeader::setDiffed(), and orxonox::packet::GamestateHeader::setID().
Referenced by orxonox::Server::createClient(), orxonox::GamestateClient::getGamestate(), and orxonox::GamestateManager::getSnapshot().
bool orxonox::packet::Gamestate::compressData | ( | ) |
References COUT, orxonox::packet::Packet::data_, orxonox::packet::GamestateHeader::getCompSize(), orxonox::packet::GamestateHeader::getDataSize(), orxonox::packet::GamestateHeader::getSize(), header_, orxonox::packet::GamestateHeader::isCompressed(), orxonox::packet::GamestateHeader::setCompressed(), orxonox::packet::GamestateHeader::setCompSize(), and orxonox::source().
Referenced by orxonox::Server::createClient(), and orxonox::GamestateManager::finishGamestate().
bool orxonox::packet::Gamestate::decompressData | ( | ) |
References orxonox::packet::Packet::bDataENetAllocated_, COUT, orxonox::packet::Packet::data_, orxonox::packet::GamestateHeader::getBaseID(), orxonox::packet::GamestateHeader::getCompSize(), orxonox::packet::GamestateHeader::getDataSize(), orxonox::packet::GamestateHeader::getID(), orxonox::packet::GamestateHeader::getSize(), header_, orxonox::packet::GamestateHeader::isCompressed(), orxonox::packet::GamestateHeader::setCompressed(), and orxonox::source().
Referenced by orxonox::GamestateManager::processGamestate(), and orxonox::GamestateClient::processGamestate().
References orxonox::packet::Packet::data_, orxonox::packet::Packet::flags_, Gamestate(), GAMESTATE_START, orxonox::packet::Packet::getClientID(), orxonox::packet::GamestateHeader::getDataSize(), getID(), orxonox::packet::GamestateHeader::getSize(), header_, isCompressed(), orxonox::packet::GamestateHeader::isCompressed(), isDiffed(), orxonox::packet::GamestateHeader::isDiffed(), orxonox::packet::Packet::packetDirection_, rawDiff(), orxonox::packet::GamestateHeader::setBaseID(), and orxonox::packet::GamestateHeader::setDiffed().
Referenced by orxonox::GamestateManager::finishGamestate().
Gamestate * orxonox::packet::Gamestate::doSelection | ( | unsigned int | clientID, | |
unsigned int | targetSize | |||
) |
References orxonox::packet::Packet::data_, dataVector_, Gamestate(), GAMESTATE_START, orxonox::SynchronisableHeader::getDataSize(), orxonox::packet::GamestateHeader::getDataSize(), orxonox::packet::GamestateHeader::getID(), orxonox::TrafficControl::getInstance(), orxonox::SynchronisableHeader::getObjectID(), orxonox::SynchronisableHeader::getSize(), orxonox::packet::GamestateHeader::getSize(), header_, orxonox::SynchronisableHeader::isDataAvailable(), orxonox::TrafficControl::processObjectList(), orxonox::SynchronisableHeader::setDataAvailable(), and orxonox::packet::GamestateHeader::setDataSize().
Referenced by orxonox::GamestateManager::finishGamestate().
int32_t orxonox::packet::Gamestate::getBaseID | ( | ) | const [inline] |
int32_t orxonox::packet::Gamestate::getID | ( | ) | const [inline] |
uint32_t orxonox::packet::Gamestate::getSize | ( | ) | const [private, virtual] |
bool orxonox::packet::Gamestate::isCompressed | ( | ) | const [inline] |
bool orxonox::packet::Gamestate::isDiffed | ( | ) | const [inline] |
bool orxonox::packet::Gamestate::operator== | ( | packet::Gamestate | gs | ) |
bool orxonox::packet::Gamestate::process | ( | ) | [inline, private, virtual] |
Implements orxonox::packet::Packet.
References orxonox::GamestateHandler::addGamestate(), and orxonox::packet::Packet::getClientID().
void orxonox::packet::Gamestate::rawDiff | ( | uint8_t * | newdata, | |
uint8_t * | data, | |||
uint8_t * | basedata, | |||
uint32_t | datalength, | |||
uint32_t | baselength | |||
) | [private] |
bool orxonox::packet::Gamestate::spreadData | ( | uint8_t | mode = 0x0 |
) |
References COUT, orxonox::packet::Packet::data_, orxonox::Synchronisable::fabricate(), orxonox::SynchronisableHeader::getDataSize(), orxonox::packet::GamestateHeader::getDataSize(), getID(), orxonox::packet::GamestateHeader::getID(), orxonox::SynchronisableHeader::getObjectID(), orxonox::packet::GamestateHeader::getSize(), orxonox::Synchronisable::getSynchronisable(), header_, orxonox::packet::GamestateHeader::isCompressed(), orxonox::packet::GamestateHeader::isDiffed(), orxonox::GameMode::isMaster(), orxonox::OBJECTID_UNKNOWN, and orxonox::Synchronisable::updateData().
Referenced by orxonox::GamestateManager::processGamestate(), and orxonox::GamestateClient::processGamestate().
References orxonox::packet::Packet::data_, orxonox::packet::Packet::flags_, Gamestate(), GAMESTATE_START, orxonox::packet::Packet::getClientID(), orxonox::packet::GamestateHeader::getDataSize(), orxonox::packet::GamestateHeader::getSize(), header_, orxonox::packet::GamestateHeader::isCompressed(), orxonox::packet::GamestateHeader::isDiffed(), orxonox::packet::Packet::packetDirection_, rawDiff(), and orxonox::packet::GamestateHeader::setDiffed().
Referenced by orxonox::GamestateClient::processGamestate().
std::list<obj> orxonox::packet::Gamestate::dataVector_ [private] |
Referenced by collectData(), and doSelection().
Referenced by collectData(), compressData(), decompressData(), diff(), doSelection(), Gamestate(), getSize(), spreadData(), undiff(), and ~Gamestate().