Base class of Server and Client This is the Base class of the Server and Client classes.
More...
#include </home/jenkins/workspace/orxonox_doxygen_trunk/src/libraries/network/Host.h>
Base class of Server and Client This is the Base class of the Server and Client classes.
- Makes server and client a singleton
- defines static functions available on both server and client
- is the interface to be used when communicating with the network
- Author
- Oliver Scheuss
Constructor: assures that only one reference will be created and sets the pointer.
Destructor: resets the instance pointer to nullptr.
This function is used to add an enetpacket to be sent to another peer.
- Parameters
-
packet | Packet to be added |
clientID | ID of the client the packet should be sent to |
channelID | ID of the channel. |
- Returns
- success?
void orxonox::Host::doReceiveChat |
( |
const std::string & |
message, |
|
|
unsigned int |
sourceID, |
|
|
unsigned int |
targetID |
|
) |
| |
|
protectedpure virtual |
virtual void orxonox::Host::doSendChat |
( |
const std::string & |
message, |
|
|
unsigned int |
sourceID, |
|
|
unsigned int |
targetID |
|
) |
| |
|
protectedpure virtual |
Host * orxonox::Host::getActiveInstance |
( |
| ) |
|
|
static |
Singleton implementation.
Return the first active instance.
static unsigned int orxonox::Host::getPlayerID |
( |
| ) |
|
|
inlinestatic |
bool orxonox::Host::isActive |
( |
void |
| ) |
|
|
inline |
bool orxonox::Host::isServer |
( |
| ) |
|
|
static |
virtual bool orxonox::Host::isServer_ |
( |
| ) |
|
|
privatepure virtual |
virtual void orxonox::Host::printRTT |
( |
| ) |
|
|
pure virtual |
virtual void orxonox::Host::queuePacket |
( |
ENetPacket * |
packet, |
|
|
int |
clientID, |
|
|
uint8_t |
channelID |
|
) |
| |
|
privatepure virtual |
static bool orxonox::Host::running |
( |
| ) |
|
|
inlinestatic |
void orxonox::Host::sendChat |
( |
const std::string & |
message, |
|
|
unsigned int |
sourceID, |
|
|
unsigned int |
targetID |
|
) |
| |
|
static |
Sends a chat message through the network.
- Parameters
-
message | message to be sent |
sourceID | the ID of the sender |
targetID | the ID of the receiver |
void orxonox::Host::setActive |
( |
bool |
bActive | ) |
|
|
inlineprotected |
static void orxonox::Host::setClientID |
( |
unsigned int |
id | ) |
|
|
inlinestatic |
bool orxonox::Host::bIsActive_ |
|
private |
uint32_t orxonox::Host::clientID_s = 0 |
|
staticprivate |
std::vector< Host * > orxonox::Host::instances_s |
|
staticprivate |
The documentation for this class was generated from the following files: