Emergency 20 Dokumentation  4.2.0
em5::multiplayer::proxy::MultiplayerProxyClient Class Reference

EMERGENCY 5 multiplayer proxy client class. More...

#include <MultiplayerProxyClient.h>

Inheritance diagram for em5::multiplayer::proxy::MultiplayerProxyClient:
qsf::game::Client qsf::Client

Public Member Functions

 MultiplayerProxyClient ()
 
bool connect (const std::string &hostOrIpAddress, uint16 port)
 
void disconnect ()
 
void createSession ()
 
void disconnectProxyClientFromSession (uint8 proxySessionClientId)
 
bool connectToSession (uint64 sessionId)
 
void disconnectFromCurrentSession ()
 
bool sendData (uint8 proxyClientSessionId, const qsf::game::BitStream &messageData)
 
bool isSessionCreated () const
 
bool isConnectedToSession () const
 
uint64 getSessionId () const
 
uint8 getProxySessionClientId () const
 
virtual void onConnected () override
 Called when the client is connected. More...
 
virtual void onDisconnected () override
 Called when the client is disconnected. More...
 
virtual void onUnexpectedDisconnected () override
 Called when the client is disconnected unexpected. More...
 
virtual void onConnectFailed () override
 Called if the connection attempt failed. More...
 
- Public Member Functions inherited from qsf::game::Client
std::string getServerHostname () const
 Returns the UTF-8 hostname of the server this client is connected to. More...
 
uint16 getServerPort () const
 Returns the port of the server this client is connected to. More...
 
bool sendPacket (const BitStream &packet)
 Sends a packet to the server. More...
 
void disconnect ()
 Closes any active connection. More...
 
void setUseCompression (bool useCompression)
 
virtual void onPacketReceived (const std::vector< char > &packet) override
 Called when the client received a package. More...
 
- Public Member Functions inherited from qsf::Client
 Client ()
 Default constructor. More...
 
void setTimeout (uint32 timeoutRetransmitCount, uint32 timeoutMinimum, uint32 timeoutMaximum)
 Set the timeout parameters for the client. More...
 
bool connectToServer (const std::string &hostname, unsigned short port, uint32 clientId)
 Connect the client to a server. More...
 
ConnectionState getConnectionState () const
 Return the current connection state. More...
 
uint32 getClientId () const
 Return the client ID. More...
 
bool getConnectionInformation (ConnectionInformation &connectionInformation) const
 Fill the given structure with up to date connection information. More...
 
void disconnectFromServer ()
 Disconnect the client from the server it's currently connected to. More...
 
bool send (std::vector< char > &packet) const
 Send a package to the server. More...
 

Public Attributes

boost::signals2::signal< void(const DataData &)> receivedData
 Called when data is received from the proxy. More...
 
boost::signals2::signal< void(CreateSessionResultType, uint64)> sessionCreated
 
boost::signals2::signal< void(ConnectionResultType)> connectedToSession
 
boost::signals2::signal< void(uint8)> clientConnectedToSession
 
boost::signals2::signal< void(uint8)> clientDisconnectedFromSession
 
- Public Attributes inherited from qsf::game::Client
boost::signals2::signal< void()> connected
 Called when the client is connected. More...
 
boost::signals2::signal< void()> disconnected
 Called when the client is disconnected. More...
 
boost::signals2::signal< void()> unexpectedDisconnected
 Called when the client is disconnected unexpected. More...
 
boost::signals2::signal< void()> connectFailed
 Called if the connection attempt failed. More...
 
boost::signals2::signal< void(const BitStream &, uint32)> packetReceived
 Called when a packet is received. More...
 

Protected Member Functions

virtual void onPacketReceived (const qsf::game::BitStream &bitStream, uint32 sequenceNumber) override
 
- Protected Member Functions inherited from qsf::game::Client
 Client ()
 Constructor. More...
 
virtual ~Client ()
 Destructor. More...
 

Additional Inherited Members

- Public Types inherited from qsf::Client
enum  ConnectionState { STATE_DISCONNECTED = 0, STATE_CONNECTING, STATE_CONNECTED }
 Connection state. More...
 

Detailed Description

EMERGENCY 5 multiplayer proxy client class.

Constructor & Destructor Documentation

em5::multiplayer::proxy::MultiplayerProxyClient::MultiplayerProxyClient ( )

Member Function Documentation

bool em5::multiplayer::proxy::MultiplayerProxyClient::connect ( const std::string &  hostOrIpAddress,
uint16  port 
)
bool em5::multiplayer::proxy::MultiplayerProxyClient::connectToSession ( uint64  sessionId)
void em5::multiplayer::proxy::MultiplayerProxyClient::createSession ( )
void em5::multiplayer::proxy::MultiplayerProxyClient::disconnect ( )
void em5::multiplayer::proxy::MultiplayerProxyClient::disconnectFromCurrentSession ( )
void em5::multiplayer::proxy::MultiplayerProxyClient::disconnectProxyClientFromSession ( uint8  proxySessionClientId)
uint8 em5::multiplayer::proxy::MultiplayerProxyClient::getProxySessionClientId ( ) const
uint64 em5::multiplayer::proxy::MultiplayerProxyClient::getSessionId ( ) const
bool em5::multiplayer::proxy::MultiplayerProxyClient::isConnectedToSession ( ) const
bool em5::multiplayer::proxy::MultiplayerProxyClient::isSessionCreated ( ) const
virtual void em5::multiplayer::proxy::MultiplayerProxyClient::onConnected ( )
overridevirtual

Called when the client is connected.

Note
  • The default implementation is empty
  • "qsf::Client::onDisconnected()" will be called later on in case of disconnection

Reimplemented from qsf::game::Client.

virtual void em5::multiplayer::proxy::MultiplayerProxyClient::onConnectFailed ( )
overridevirtual

Called if the connection attempt failed.

Note
  • The default implementation is empty
  • Only called in case there was no connection ("qsf::Client::onConnected()" was not called before)

Reimplemented from qsf::game::Client.

virtual void em5::multiplayer::proxy::MultiplayerProxyClient::onDisconnected ( )
overridevirtual

Called when the client is disconnected.

Note
  • The default implementation is empty
  • Only called in case there was actually a connection ("qsf::Client::onConnected()" was called before)

Reimplemented from qsf::game::Client.

virtual void em5::multiplayer::proxy::MultiplayerProxyClient::onPacketReceived ( const qsf::game::BitStream bitStream,
uint32  sequenceNumber 
)
overrideprotectedvirtual

Reimplemented from qsf::game::Client.

virtual void em5::multiplayer::proxy::MultiplayerProxyClient::onUnexpectedDisconnected ( )
overridevirtual

Called when the client is disconnected unexpected.

Note
  • The default implementation is empty
  • Only called in case there was actually a connection ("qsf::Client::onConnected()" was called before)
  • "qsf::Client::onDisconnected()" will still be called after this method

Reimplemented from qsf::game::Client.

bool em5::multiplayer::proxy::MultiplayerProxyClient::sendData ( uint8  proxyClientSessionId,
const qsf::game::BitStream messageData 
)

Member Data Documentation

boost::signals2::signal<void(uint8)> em5::multiplayer::proxy::MultiplayerProxyClient::clientConnectedToSession
boost::signals2::signal<void(uint8)> em5::multiplayer::proxy::MultiplayerProxyClient::clientDisconnectedFromSession
boost::signals2::signal<void(ConnectionResultType)> em5::multiplayer::proxy::MultiplayerProxyClient::connectedToSession
boost::signals2::signal<void(const DataData&)> em5::multiplayer::proxy::MultiplayerProxyClient::receivedData

Called when data is received from the proxy.

Parameters
[in]messageDataThe data of the message itself
Note
  • The handler should not store the given message instance via pointer or reference, because when the handler method has exited it cannot be guaranteed that the instance will still be valid
  • Recommended slot signature: void onReceivedMessage(const em5::multiplayer::proxy::DataData& messageData)
  • When more then one handler is registered then the handlers should make sure that the streamposition is resetted to the position as on the function entry
boost::signals2::signal<void(CreateSessionResultType, uint64)> em5::multiplayer::proxy::MultiplayerProxyClient::sessionCreated

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