Orxonox: orxonox::packet::Gamestate Class Reference

# orxonox::packet::Gamestate Class Reference

`#include <src/network/packet/Gamestate.h>`

Inheritance diagram for orxonox::packet::Gamestate:

List of all members.

## 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_

## Detailed Description

Author:
  Oliver Scheuss

## Constructor & Destructor Documentation

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 |
| ) |  |  |

References orxonox::packet::Packet::data_, orxonox::packet::Packet::flags_, header_, and PACKET_FLAG_GAMESTATE.

orxonox::packet::Gamestate::Gamestate | ( | uint8_t * | data | ) |

References orxonox::packet::Packet::data_, orxonox::packet::Packet::flags_, header_, and PACKET_FLAG_GAMESTATE.

orxonox::packet::Gamestate::Gamestate | ( | const Gamestate & | g | ) |

References orxonox::packet::Packet::data_, orxonox::packet::Packet::flags_, header_, and PACKET_FLAG_GAMESTATE.

orxonox::packet::Gamestate::~Gamestate | ( |  | ) |

References header_.

## Member Function Documentation

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().

Gamestate * orxonox::packet::Gamestate::diff | ( | Gamestate * | base | ) |

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]`

Referenced by orxonox::GamestateClient::processGamestate(), and orxonox::GamestateClient::processGamestates().

int32_t orxonox::packet::Gamestate::getID | ( |  | ) | const`[inline]`

Referenced by orxonox::GamestateClient::add(), diff(), orxonox::GamestateManager::finishGamestate(), orxonox::GamestateClient::processGamestate(), orxonox::GamestateClient::processGamestates(), and spreadData().

uint32_t orxonox::packet::Gamestate::getSize | ( |  | ) | const`[private, virtual]`

Implements orxonox::packet::Packet.

References orxonox::packet::Packet::data_, orxonox::packet::GamestateHeader::getCompSize(), orxonox::packet::GamestateHeader::getDataSize(), orxonox::packet::GamestateHeader::getSize(), header_, and orxonox::packet::GamestateHeader::isCompressed().

bool orxonox::packet::Gamestate::isCompressed | ( |  | ) | const`[inline]`

Referenced by diff(), operator==(), orxonox::GamestateManager::processGamestate(), and orxonox::GamestateClient::processGamestate().

bool orxonox::packet::Gamestate::isDiffed | ( |  | ) | const`[inline]`

Referenced by diff(), orxonox::GamestateManager::processGamestate(), orxonox::GamestateClient::processGamestate(), and orxonox::GamestateClient::processGamestates().

bool orxonox::packet::Gamestate::operator== | ( | packet::Gamestate | gs | ) |

References orxonox::packet::Packet::data_, orxonox::packet::GamestateHeader::getDataSize(), orxonox::packet::GamestateHeader::getSize(), and isCompressed().

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]`

Referenced by diff(), and undiff().

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().

Gamestate * orxonox::packet::Gamestate::undiff | ( | Gamestate * | base | ) |

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().

## Member Data Documentation

std::list<obj> orxonox::packet::Gamestate::dataVector_`[private]`

Referenced by collectData(), and doSelection().

GamestateHeader* orxonox::packet::Gamestate::header_`[private]`

Referenced by collectData(), compressData(), decompressData(), diff(), doSelection(), Gamestate(), getSize(), spreadData(), undiff(), and ~Gamestate().

The documentation for this class was generated from the following files:

- src/network/packet/Gamestate.h
- src/network/packet/Gamestate.cc