#include <src/network/ServerConnection.h>
Public Member Functions | |
bool | closeListener () |
void | disconnectClient (int clientID) |
virtual void | disconnectClient (ClientInformation *client) |
void | disconnectPeer (ENetEvent *event) |
bool | openListener () |
void | setBindAddress (const std::string &bindAddress) |
void | setPort (unsigned int port) |
~ServerConnection () | |
Static Public Member Functions | |
static bool | addPacket (ENetPacket *packet, unsigned int ID) |
static bool | addPacketAll (ENetPacket *packet) |
Protected Member Functions | |
void | disconnectClients () |
ServerConnection () | |
Private Member Functions | |
int | getClientID (ENetAddress *address) |
int | getClientID (ENetPeer *peer) |
ENetPeer * | getClientPeer (int clientID) |
Private Attributes | |
ENetAddress * | bindAddress_ |
bool | bListening_ |
orxonox::ServerConnection::~ServerConnection | ( | ) |
References bindAddress_, bListening_, and closeListener().
orxonox::ServerConnection::ServerConnection | ( | ) | [protected] |
References bindAddress_, and orxonox::NETWORK_PORT.
bool orxonox::ServerConnection::addPacket | ( | ENetPacket * | packet, | |
unsigned int | ID | |||
) | [static] |
bool orxonox::ServerConnection::addPacketAll | ( | ENetPacket * | packet | ) | [static] |
References orxonox::Connection::getHost(), and orxonox::Connection::getInstance().
Referenced by addPacket().
bool orxonox::ServerConnection::closeListener | ( | ) |
References bListening_, disconnectClients(), and orxonox::Connection::host_.
Referenced by orxonox::Server::close(), and ~ServerConnection().
void orxonox::ServerConnection::disconnectClient | ( | int | clientID | ) |
References disconnectClient(), and orxonox::ClientInformation::findClient().
void orxonox::ServerConnection::disconnectClient | ( | ClientInformation * | client | ) | [virtual] |
Reimplemented in orxonox::Server.
References orxonox::Connection::disconnectPeer(), and orxonox::ClientInformation::getPeer().
Referenced by disconnectClient(), orxonox::Server::disconnectClient(), disconnectClients(), and disconnectPeer().
void orxonox::ServerConnection::disconnectClients | ( | ) | [protected] |
void orxonox::ServerConnection::disconnectPeer | ( | ENetEvent * | event | ) | [virtual] |
Implements orxonox::Connection.
References COUT, disconnectClient(), and orxonox::ClientInformation::findClient().
int orxonox::ServerConnection::getClientID | ( | ENetAddress * | address | ) | [private] |
int orxonox::ServerConnection::getClientID | ( | ENetPeer * | peer | ) | [private] |
ENetPeer * orxonox::ServerConnection::getClientPeer | ( | int | clientID | ) | [private] |
bool orxonox::ServerConnection::openListener | ( | ) |
References bindAddress_, orxonox::Connection::host_, and orxonox::NETWORK_MAX_CONNECTIONS.
Referenced by orxonox::Server::open().
void orxonox::ServerConnection::setBindAddress | ( | const std::string & | bindAddress | ) |
void orxonox::ServerConnection::setPort | ( | unsigned int | port | ) |
Reimplemented from orxonox::Connection.
Referenced by openListener(), ServerConnection(), setBindAddress(), setPort(), and ~ServerConnection().
bool orxonox::ServerConnection::bListening_ [private] |
Referenced by closeListener(), and ~ServerConnection().