Emergency 20 Dokumentation  4.2.0
em5::multiplayer::server::ClientBase Class Referenceabstract

EMERGENCY 5 multiplayer client base class (represents a client on the server side) More...

#include <ClientBase.h>

Inheritance diagram for em5::multiplayer::server::ClientBase:
em5::multiplayer::server::LocalClient em5::multiplayer::server::NetworkClient em5::multiplayer::server::ProxyClient

Public Member Functions

 ClientBase ()
 Default constructor. More...
 
virtual ~ClientBase ()
 Destructor. More...
 
uint32 getPlayerIndex () const
 
void setPlayerIndex (uint32 playerIndex)
 
virtual void disconnect ()=0
 
virtual void disconnect (bool force)=0
 
virtual uint64 getId () const =0
 
virtual bool sendData (const qsf::Clock &simulationClock, const qsf::game::BitStream &bitStream)=0
 Send data. More...
 
virtual bool sendData (const qsf::game::BitStream &bitStream)=0
 

Public Attributes

boost::signals2::signal< void(ClientBase &, const OperationMessage, uint64, const qsf::game::BitStream &)> receivedOperationMessage
 Called when a operation message is received from the client. More...
 

Protected Member Functions

void onDataReceived (const qsf::game::BitStream &bitStream)
 Called, when data is received. More...
 

Detailed Description

EMERGENCY 5 multiplayer client base class (represents a client on the server side)

Constructor & Destructor Documentation

em5::multiplayer::server::ClientBase::ClientBase ( )
inline

Default constructor.

em5::multiplayer::server::ClientBase::~ClientBase ( )
inlinevirtual

Destructor.

Member Function Documentation

virtual void em5::multiplayer::server::ClientBase::disconnect ( )
pure virtual
virtual void em5::multiplayer::server::ClientBase::disconnect ( bool  force)
pure virtual
virtual uint64 em5::multiplayer::server::ClientBase::getId ( ) const
pure virtual
uint32 em5::multiplayer::server::ClientBase::getPlayerIndex ( ) const
inline
void em5::multiplayer::server::ClientBase::onDataReceived ( const qsf::game::BitStream bitStream)
protected

Called, when data is received.

virtual bool em5::multiplayer::server::ClientBase::sendData ( const qsf::Clock simulationClock,
const qsf::game::BitStream bitStream 
)
pure virtual

Send data.

Note
This method is used to send ingame data (e.g. DataUpdate messages) to the clients, this special method is only needed to make the lokal client easier to implement because the local client does not need to always parse the message data to find out if it should record the data or not

Implemented in em5::multiplayer::server::ProxyClient, em5::multiplayer::server::LocalClient, and em5::multiplayer::server::NetworkClient.

virtual bool em5::multiplayer::server::ClientBase::sendData ( const qsf::game::BitStream bitStream)
pure virtual
void em5::multiplayer::server::ClientBase::setPlayerIndex ( uint32  playerIndex)
inline

Member Data Documentation

boost::signals2::signal<void(ClientBase&, const OperationMessage, uint64, const qsf::game::BitStream&)> em5::multiplayer::server::ClientBase::receivedOperationMessage

Called when a operation message is received from the client.

Parameters
[in]clientThe server side client object which received the operation message
[in]operationMessageIdThe id of the operation message
[in]dataSizeThe payload size of the message (excluded the size needed for the Id and the payload size)
[in]bitStreamThe bit stream object which contains the whole operation message data. The stream is positioned after the information about the operation message id and the payload size
Note
  • The handler should not store the given bit stream instance, because when the handler method has exited it cannot be guaranteed that the instance will still be valid
  • Recommended slot signature: void onReceivedOperationMessage(const em5::multiplayer::server::ClientBase& client, em5::multiplayer::OperationMessage operationMessageId, uint64 dataSize, const qsf::game::BitStream& bitStream)
  • When more then one handler is registered then the handlers should make sure that the stream position is resetted to the position as on the function entry

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