Orxonox: orxonox::ClientInformation Class Reference

# orxonox::ClientInformation Class Reference

`#include <src/network/ClientInformation.h>`

List of all members.

## Public Member Functions

void | addFailure ()
| ClientInformation ()
int | getFailures ()
unsigned int | getGamestateID ()
unsigned int | getID ()
double | getPacketLoss ()
unsigned int | getPartialGamestateID ()
ENetPeer * | getPeer ()
uint32_t | getRTT ()
unsigned int | getShipID ()
bool | getSynched ()
ClientInformation * | next ()
ClientInformation * | prev ()
void | resetFailures ()
bool | setGamestateID (int id)
void | setID (int clientID)
bool | setPartialGamestateID (int id)
bool | setPeer (ENetPeer *peer)
void | setShipID (unsigned int id)
bool | setSynched (bool s)
| ~ClientInformation ()

## Static Public Member Functions

static ClientInformation * | findClient (ENetAddress *address, bool look_backwards=false)
static ClientInformation * | findClient (unsigned int clientID, bool look_backwards=false)
static ClientInformation * | getBegin ()
static bool | hasClients ()
static ClientInformation * | insertBack (ClientInformation *ins)
static bool | removeClient (ENetPeer *peer)
static bool | removeClient (unsigned int clientID)

## Private Member Functions

ClientInformation * | insertAfter (ClientInformation *ins)
ClientInformation * | insertBefore (ClientInformation *ins)
bool | setNext (ClientInformation *next)
bool | setPrev (ClientInformation *prev)

## Private Attributes

unsigned int | clientID_
unsigned short | failures_
unsigned int | gamestateID_
ClientInformation * | nexte
unsigned int | partialGamestateID_
ENetPeer * | peer_
ClientInformation * | preve
unsigned int | ShipID_
bool | synched_

## Static Private Attributes

static ClientInformation * | head_ = 0

## Detailed Description

This class implements a list for client informations

Author:
  Oliver Scheuss

## Constructor & Destructor Documentation

orxonox::ClientInformation::ClientInformation | ( |  | ) |

References gamestateID_, orxonox::GAMESTATEID_INITIAL, head_, nexte, partialGamestateID_, preve, and synched_.

orxonox::ClientInformation::~ClientInformation | ( |  | ) |

References head_, next(), prev(), setNext(), and setPrev().

## Member Function Documentation

void orxonox::ClientInformation::addFailure | ( |  | ) |

References failures_.

ClientInformation * orxonox::ClientInformation::findClient | ( | ENetAddress * | address,
|  | bool | look_backwards = `false` |
| ) |  |  | `[static]`

This function goes forward through the list and looks for an element with clientID This function should only be applied to the head of the list

Parameters:

  | peer | peer to look for

Returns:
  pointer to the element in the list

References getPeer(), head_, and next().

ClientInformation * orxonox::ClientInformation::findClient | ( | unsigned int | clientID,
|  | bool | look_backwards = `false` |
| ) |  |  | `[static]`

This function goes forward through the list and looks for an element with clientID This function should only be applied to the head of the list

Parameters:

  | clientID | id to look for

Returns:
  pointer to the last element in the list or 0 if the search was unsuccessfull

References getID(), head_, and next().

Referenced by orxonox::GamestateManager::ack(), orxonox::ServerConnection::addPacket(), orxonox::Server::createClient(), orxonox::packet::Packet::createPacket(), orxonox::ServerConnection::disconnectClient(), orxonox::ServerConnection::disconnectClients(), orxonox::ServerConnection::disconnectPeer(), orxonox::ServerConnection::getClientID(), orxonox::ServerConnection::getClientPeer(), orxonox::Server::getPacketLoss(), orxonox::HumanPlayer::getPacketLossRatio(), orxonox::HumanPlayer::getPing(), and orxonox::Server::getPing().

static ClientInformation* orxonox::ClientInformation::getBegin | ( |  | ) | `[inline, static]`

Referenced by orxonox::ServerConnection::disconnectClients(), orxonox::ClientConnectionListener::getConnectedClients(), orxonox::Server::processChat(), orxonox::Server::sendChat(), orxonox::GamestateManager::sendGamestates(), orxonox::Server::sendObjectDeletes(), and orxonox::Server::updateGamestate().

int orxonox::ClientInformation::getFailures | ( |  | ) |

References failures_.

Referenced by orxonox::Server::sendObjectDeletes().

unsigned int orxonox::ClientInformation::getGamestateID | ( |  | ) |

References gamestateID_.

Referenced by orxonox::GamestateManager::ack(), and orxonox::GamestateManager::sendGamestates().

unsigned int orxonox::ClientInformation::getID | ( |  | ) |

References clientID_, and orxonox::CLIENTID_UNKNOWN.

Referenced by orxonox::Server::addClient(), orxonox::Server::createClient(), orxonox::packet::Packet::createPacket(), orxonox::Server::disconnectClient(), findClient(), orxonox::ServerConnection::getClientID(), orxonox::ClientConnectionListener::getConnectedClients(), orxonox::Server::processChat(), orxonox::GamestateManager::removeClient(), removeClient(), orxonox::Server::sendChat(), orxonox::GamestateManager::sendGamestates(), and orxonox::Server::sendObjectDeletes().

double orxonox::ClientInformation::getPacketLoss | ( |  | ) |

References peer_.

Referenced by orxonox::Server::getPacketLoss(), orxonox::HumanPlayer::getPacketLossRatio(), and orxonox::GamestateManager::sendGamestates().

unsigned int orxonox::ClientInformation::getPartialGamestateID | ( |  | ) |

References partialGamestateID_.

ENetPeer * orxonox::ClientInformation::getPeer | ( |  | ) |

References peer_.

Referenced by orxonox::ServerConnection::addPacket(), orxonox::ServerConnection::disconnectClient(), findClient(), orxonox::ServerConnection::getClientPeer(), and removeClient().

uint32_t orxonox::ClientInformation::getRTT | ( |  | ) |

References peer_.

Referenced by orxonox::HumanPlayer::getPing(), orxonox::Server::getPing(), and orxonox::GamestateManager::sendGamestates().

unsigned int orxonox::ClientInformation::getShipID | ( |  | ) | `[inline]`

Referenced by orxonox::Server::createClient().

bool orxonox::ClientInformation::getSynched | ( |  | ) |

References synched_.

Referenced by orxonox::GamestateManager::sendGamestates(), and orxonox::Server::sendObjectDeletes().

static bool orxonox::ClientInformation::hasClients | ( |  | ) | `[inline, static]`

References head_.

Referenced by orxonox::Server::update().

ClientInformation * orxonox::ClientInformation::insertAfter | ( | ClientInformation * | ins | ) | `[private]`

References next(), nexte, setNext(), and setPrev().

ClientInformation * orxonox::ClientInformation::insertBack | ( | ClientInformation * | ins | ) | `[static]`

References head_, next(), setNext(), and setPrev().

Referenced by orxonox::Server::addClient().

ClientInformation * orxonox::ClientInformation::insertBefore | ( | ClientInformation * | ins | ) | `[private]`

References prev(), preve, setNext(), and setPrev().

ClientInformation * orxonox::ClientInformation::next | ( |  | ) |

References nexte.

Referenced by orxonox::ServerConnection::disconnectClients(), findClient(), orxonox::ClientConnectionListener::getConnectedClients(), insertAfter(), insertBack(), orxonox::Server::processChat(), removeClient(), orxonox::Server::sendChat(), orxonox::GamestateManager::sendGamestates(), orxonox::Server::sendObjectDeletes(), and ~ClientInformation().

ClientInformation * orxonox::ClientInformation::prev | ( |  | ) |

References preve.

Referenced by insertBefore(), and ~ClientInformation().

bool orxonox::ClientInformation::removeClient | ( | ENetPeer * | peer | ) | `[static]`

References getPeer(), head_, and next().

bool orxonox::ClientInformation::removeClient | ( | unsigned int | clientID | ) | `[static]`

References orxonox::CLIENTID_UNKNOWN, getID(), head_, and next().

void orxonox::ClientInformation::resetFailures | ( |  | ) |

References failures_.

bool orxonox::ClientInformation::setGamestateID | ( | int | id | ) |

References gamestateID_.

Referenced by orxonox::GamestateManager::ack().

void orxonox::ClientInformation::setID | ( | int | clientID | ) |

References clientID_.

Referenced by orxonox::Server::addClient().

bool orxonox::ClientInformation::setNext | ( | ClientInformation * | next | ) | `[private]`

References nexte.

Referenced by insertAfter(), insertBack(), insertBefore(), and ~ClientInformation().

bool orxonox::ClientInformation::setPartialGamestateID | ( | int | id | ) |

References partialGamestateID_.

bool orxonox::ClientInformation::setPeer | ( | ENetPeer * | peer | ) |

References peer_.

Referenced by orxonox::Server::addClient().

bool orxonox::ClientInformation::setPrev | ( | ClientInformation * | prev | ) | `[private]`

References head_, and preve.

Referenced by insertAfter(), insertBack(), insertBefore(), and ~ClientInformation().

void orxonox::ClientInformation::setShipID | ( | unsigned int | id | ) | `[inline]`

bool orxonox::ClientInformation::setSynched | ( | bool | s | ) |

References synched_.

Referenced by orxonox::Server::createClient().

## Member Data Documentation

unsigned int orxonox::ClientInformation::clientID_`[private]`

Referenced by getID(), and setID().

unsigned short orxonox::ClientInformation::failures_`[private]`

Referenced by addFailure(), getFailures(), and resetFailures().

unsigned int orxonox::ClientInformation::gamestateID_`[private]`

Referenced by ClientInformation(), getGamestateID(), and setGamestateID().

ClientInformation * orxonox::ClientInformation::head_ = 0`[static, private]`

Referenced by ClientInformation(), findClient(), hasClients(), insertBack(), removeClient(), setPrev(), and ~ClientInformation().

ClientInformation* orxonox::ClientInformation::nexte`[private]`

Referenced by ClientInformation(), insertAfter(), next(), and setNext().

unsigned int orxonox::ClientInformation::partialGamestateID_`[private]`

Referenced by ClientInformation(), getPartialGamestateID(), and setPartialGamestateID().

ENetPeer* orxonox::ClientInformation::peer_`[private]`

Referenced by getPacketLoss(), getPeer(), getRTT(), and setPeer().

ClientInformation* orxonox::ClientInformation::preve`[private]`

Referenced by ClientInformation(), insertBefore(), prev(), and setPrev().

unsigned int orxonox::ClientInformation::ShipID_`[private]`

bool orxonox::ClientInformation::synched_`[private]`

Referenced by ClientInformation(), getSynched(), and setSynched().

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

- src/network/ClientInformation.h
- src/network/ClientInformation.cc