Emergency 20 Dokumentation  4.2.0
em5::MatchmakingClient Class Reference

EM5 matchmaking network client class. More...

#include <MatchmakingClient.h>

Inheritance diagram for em5::MatchmakingClient:
qsf::QsfClient qsf::Client

Public Member Functions

 MatchmakingClient ()
 Default constructor. More...
 
virtual ~MatchmakingClient ()
 Destructor. More...
 
bool requestRegisterHost (const multiplayer::HostEntry &hostEntry, const std::string &gameModificationString) const
 Attempt to register this host to the matchmaking server. More...
 
bool updateHost (const multiplayer::HostEntry &hostEntry) const
 Update this hosts entry at the matchmaking server. More...
 
bool unregisterHost () const
 
bool requestTestOpenPort () const
 Ask the matchmaking server to check if the previously registered local host is reachable. More...
 
bool requestHostList (const std::string &gameModificationString) const
 Request the list of hosts from the matchmaking server. More...
 
bool requestProxyServerProperties () const
 Request the proxy server properties information from the matchmaking server. More...
 
virtual void onConnected () override
 Called when the client is connected. More...
 
virtual void onUnexpectedDisconnected () override
 Called when the client is disconnected unexpected. More...
 
virtual void onConnectFailed () override
 Called if the connection attempt failed. More...
 
virtual const qsf::QsfProtocolListgetProtocols () const override
 
- Public Member Functions inherited from qsf::QsfClient
 QsfClient ()
 Default constructor. More...
 
virtual ~QsfClient ()
 Destructor. More...
 
virtual void onDisconnected () override
 Called when the client is disconnected. More...
 
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...
 
virtual ~Client ()
 Destructor. 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()> connected
 Signal emitted after the connection has been established. More...
 
boost::signals2::signal< void()> disconnected
 Signal emitted after the connection has been closed. More...
 
boost::signals2::signal< void()> connectionLost
 Signal emitted after the connection has been lost. More...
 
boost::signals2::signal< void()> connectFailed
 Signal emitted after the connection attempt failed. More...
 
boost::signals2::signal< void(multiplayer::RegisterHostStatus)> registerHostResponse
 Signal emitted after the register host response is available. More...
 
boost::signals2::signal< void(const std::vector< multiplayer::HostEntry > &)> hostList
 Signal emitted after the host list is available. More...
 
boost::signals2::signal< void(const em5::packet::TestOpenPortResponse &)> testOpenPortResponse
 Signal emitted after the test open port response is available. More...
 
boost::signals2::signal< void(const em5::packet::ProxyServerPropertiesResponse &)> proxyServerPropertiesResponse
 Signal emitted after the proxy server properties response is available. More...
 

Friends

class MatchmakingProtocol
 

Additional Inherited Members

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

Detailed Description

EM5 matchmaking network client class.

Constructor & Destructor Documentation

em5::MatchmakingClient::MatchmakingClient ( )

Default constructor.

virtual em5::MatchmakingClient::~MatchmakingClient ( )
virtual

Destructor.

Member Function Documentation

virtual const qsf::QsfProtocolList& em5::MatchmakingClient::getProtocols ( ) const
overridevirtual

Implements qsf::QsfClient.

virtual void em5::MatchmakingClient::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::QsfClient.

virtual void em5::MatchmakingClient::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::Client.

virtual void em5::MatchmakingClient::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::Client.

bool em5::MatchmakingClient::requestHostList ( const std::string &  gameModificationString) const

Request the list of hosts from the matchmaking server.

Returns
"true" if all went fine, else "false"
bool em5::MatchmakingClient::requestProxyServerProperties ( ) const

Request the proxy server properties information from the matchmaking server.

Returns
"true" if all went fine, else "false"
bool em5::MatchmakingClient::requestRegisterHost ( const multiplayer::HostEntry hostEntry,
const std::string &  gameModificationString 
) const

Attempt to register this host to the matchmaking server.

Returns
"true" if all went fine, else "false"
bool em5::MatchmakingClient::requestTestOpenPort ( ) const

Ask the matchmaking server to check if the previously registered local host is reachable.

Returns
"true" if all went fine, else "false"
bool em5::MatchmakingClient::unregisterHost ( ) const
bool em5::MatchmakingClient::updateHost ( const multiplayer::HostEntry hostEntry) const

Update this hosts entry at the matchmaking server.

Returns
"true" if all went fine, else "false"

Friends And Related Function Documentation

friend class MatchmakingProtocol
friend

Member Data Documentation

boost::signals2::signal<void()> em5::MatchmakingClient::connected

Signal emitted after the connection has been established.

boost::signals2::signal<void()> em5::MatchmakingClient::connectFailed

Signal emitted after the connection attempt failed.

boost::signals2::signal<void()> em5::MatchmakingClient::connectionLost

Signal emitted after the connection has been lost.

boost::signals2::signal<void()> em5::MatchmakingClient::disconnected

Signal emitted after the connection has been closed.

boost::signals2::signal<void(const std::vector<multiplayer::HostEntry>&)> em5::MatchmakingClient::hostList

Signal emitted after the host list is available.

boost::signals2::signal<void(const em5::packet::ProxyServerPropertiesResponse&)> em5::MatchmakingClient::proxyServerPropertiesResponse

Signal emitted after the proxy server properties response is available.

boost::signals2::signal<void(multiplayer::RegisterHostStatus)> em5::MatchmakingClient::registerHostResponse

Signal emitted after the register host response is available.

boost::signals2::signal<void(const em5::packet::TestOpenPortResponse&)> em5::MatchmakingClient::testOpenPortResponse

Signal emitted after the test open port response is available.


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