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

EMERGENCY 5 multiplayer proxy protocol helper. More...

#include <ProxyProtocolHelper.h>

Static Public Member Functions

static uint16 getProtocolVersion ()
 
static void writeHeader (qsf::game::BitStream &bitStream, uint32 payloadSize)
 Writes the multiplayer proxy protocol header to the given bit stream The header consist of following parts: More...
 
static bool readAndCheckHeader (const qsf::game::BitStream &bitStream, uint16 &protocolVersion, uint32 &payloadSize)
 Reads the multiplayer proxy protocol header from the given stream and does some validation checks The header consist of following parts: More...
 
static bool checkPayloadDataSize (const qsf::game::BitStream &bitStream, uint32 payloadSize)
 Checks if the bit stream contains enough data for the payload. More...
 
static bool writePayloadData (qsf::game::BitStream &bitStream, const qsf::game::BitStream &payloadData)
 Writes the payload data to the bit stream. More...
 
static bool readPayloadData (const qsf::game::BitStream &bitStream, qsf::game::BitStream &payloadData, uint32 payloadSize)
 Reads the payload data from the bit stream. More...
 
static bool writeMessage (qsf::game::BitStream &bitStream, const MessageType &messageType, const qsf::game::BitStream &messageData)
 Write an message data to the bit stream. More...
 
static bool readMessageTypeAndDataSize (const qsf::game::BitStream &bitStream, MessageType &messageType, uint32 &dataSize)
 Reads message type and data size from the bit stream. More...
 
static bool readMessage (const qsf::game::BitStream &bitStream, MessageType &messageType, qsf::game::BitStream &messageData)
 Reads an message data from the bit stream. More...
 
static bool writeMessageAsSingleMessage (qsf::game::BitStream &bitStream, const MessageType &messageType, const qsf::game::BitStream &messagePayload)
 Write a single message data to the bit stream (This writes also the header for a multiplayer proxy "message") More...
 
static bool writeMessageAsSingleMessageWithoutData (qsf::game::BitStream &bitStream, const MessageType &messageType)
 Write a single message data to the bit stream (This writes also the header for a multiplayer proxy "message") More...
 
static bool writeCreateSessionMessageData (qsf::game::BitStream &bitStream, const CreateSessionData &createSessionData)
 Writes the data of the CREATESESSION message to the bit stream. More...
 
static bool readCreateSessionMessageData (const qsf::game::BitStream &bitStream, CreateSessionData &createSessionData)
 Reads the data of the CREATESESSION message from the bit stream. More...
 
static bool writeCreateSessionResponseMessageData (qsf::game::BitStream &bitStream, const CreateSessionResponseData &createSessionResponseData)
 Writes the data of the CREATESESSION_RESPONSE message to the bit stream. More...
 
static bool readCreateSessionResponseMessageData (const qsf::game::BitStream &bitStream, CreateSessionResponseData &createSessionResponseData)
 Reads the data of the CREATESESSION_RESPONSE message from the bit stream. More...
 
static bool writeConnectToSessionMessageData (qsf::game::BitStream &bitStream, const ConnectToSessionData &connectToSessionData)
 Writes the data of the CONNECTTOSESSION message to the bit stream. More...
 
static bool readConnectToSessionMessageData (const qsf::game::BitStream &bitStream, ConnectToSessionData &connectToSessionData)
 Reads the data of the CONNECTTOSESSION message from the bit stream. More...
 
static bool writeConnectToSessionResponseMessageData (qsf::game::BitStream &bitStream, const ConnectToSessionResponseData &connectToSessionResponseData)
 Writes the data of the CONNECTTOSESSION_RESPONCSE message to the bit stream. More...
 
static bool readConnectToSessionResponseMessageData (const qsf::game::BitStream &bitStream, ConnectToSessionResponseData &connectToSessionResponseData)
 Reads the data of the CONNECTTOSESSION_RESPONSE message from the bit stream. More...
 
static bool writeClientConnectedToSessionMessageData (qsf::game::BitStream &bitStream, const ClientConnectedToSessionData &clientConnectedToSessionData)
 Writes the data of the CLIENT_CONNECTED_TO_SESSION message to the bit stream. More...
 
static bool readClientConnectedToSessionMessageData (const qsf::game::BitStream &bitStream, ClientConnectedToSessionData &clientConnectedToSessionData)
 Reads the data of the CLIENT_CONNECTED_TO_SESSION message from the bit stream. More...
 
static bool writeClientDisconnectFromSessionMessageData (qsf::game::BitStream &bitStream, const ClientDisconnectedFromSessionData &clientDisconnectedFromSessionData)
 Writes the data of the CLIENT_DISCONNECT_FROM_SESSSION message to the bit stream. More...
 
static bool readClientDisconnectFromSessionMessageData (const qsf::game::BitStream &bitStream, ClientDisconnectedFromSessionData &clientDisconnectedFromSessionData)
 Reads the data of the CLIENT_DISCONNECT_FROM_SESSSION message from the bit stream. More...
 
static bool writeDataMessageData (qsf::game::BitStream &bitStream, const DataData &data)
 Writes the data of the DATA message to the bit stream. More...
 
static bool writeDataMessageData (qsf::game::BitStream &bitStream, const uint8 proxySessionClientId, const qsf::game::BitStream &data)
 Writes the data of the DATA message to the bit stream. More...
 
static bool readDataMessageData (const qsf::game::BitStream &bitStream, DataData &data)
 Reads the data of the DATA message from the bit stream. More...
 
static bool readMetaDataOfDataMessageData (const qsf::game::BitStream &bitStream, DataData &data)
 Reads only the metadata of the DATA message from the bit stream. More...
 
static bool updateProxySessionClientIdInDataMessageData (qsf::game::BitStream &bitStream)
 

Detailed Description

EMERGENCY 5 multiplayer proxy protocol helper.

Member Function Documentation

static bool em5::multiplayer::proxy::ProtocolHelper::checkPayloadDataSize ( const qsf::game::BitStream bitStream,
uint32  payloadSize 
)
static

Checks if the bit stream contains enough data for the payload.

Parameters
[in]bitStreamThe source bit stream to check
[in]payloadSizeThe payload size which should the bit stream contain
Returns
"true" when the check went fine, otherwise "false"
static uint16 em5::multiplayer::proxy::ProtocolHelper::getProtocolVersion ( )
static
static bool em5::multiplayer::proxy::ProtocolHelper::readAndCheckHeader ( const qsf::game::BitStream bitStream,
uint16 protocolVersion,
uint32 payloadSize 
)
static

Reads the multiplayer proxy protocol header from the given stream and does some validation checks The header consist of following parts:

  • An Identifier string of 6 chars (EM5MPP)
  • A protocol version, uint16 (The current version knows the helper)
  • The size of the payload (in amount of bits), uint32
Parameters
[in]bitStreamThe bit stream from which the data is read from
[out]protocolVersionThe protocol version
[out]payloadSizeThe payload size
Returns
"true" when all checks went fine, otherwise "false"
static bool em5::multiplayer::proxy::ProtocolHelper::readClientConnectedToSessionMessageData ( const qsf::game::BitStream bitStream,
ClientConnectedToSessionData clientConnectedToSessionData 
)
static

Reads the data of the CLIENT_CONNECTED_TO_SESSION message from the bit stream.

Parameters
[in]bitStreamThe target bit stream from which the data is read from
[out]clientConnectedToSessionDataThe client connected to session response data
Returns
"true" when reading went fine, otherwise "false"
static bool em5::multiplayer::proxy::ProtocolHelper::readClientDisconnectFromSessionMessageData ( const qsf::game::BitStream bitStream,
ClientDisconnectedFromSessionData clientDisconnectedFromSessionData 
)
static

Reads the data of the CLIENT_DISCONNECT_FROM_SESSSION message from the bit stream.

Parameters
[in]bitStreamThe target bit stream from which the data is read from
[out]clientDisconnectedFromSessionDataThe client disconnected from session response data
Returns
"true" when reading went fine, otherwise "false"
static bool em5::multiplayer::proxy::ProtocolHelper::readConnectToSessionMessageData ( const qsf::game::BitStream bitStream,
ConnectToSessionData connectToSessionData 
)
static

Reads the data of the CONNECTTOSESSION message from the bit stream.

Parameters
[in]bitStreamThe target bit stream from which the data is read from
[out]connectToSessionDataThe connect to session data
Returns
"true" when reading went fine, otherwise "false"
static bool em5::multiplayer::proxy::ProtocolHelper::readConnectToSessionResponseMessageData ( const qsf::game::BitStream bitStream,
ConnectToSessionResponseData connectToSessionResponseData 
)
static

Reads the data of the CONNECTTOSESSION_RESPONSE message from the bit stream.

Parameters
[in]bitStreamThe target bit stream from which the data is read from
[out]connectToSessionResponseDataThe connect to session response data
Returns
"true" when reading went fine, otherwise "false"
static bool em5::multiplayer::proxy::ProtocolHelper::readCreateSessionMessageData ( const qsf::game::BitStream bitStream,
CreateSessionData createSessionData 
)
static

Reads the data of the CREATESESSION message from the bit stream.

Parameters
[in]bitStreamThe target bit stream from which the data is read from
[out]createSessionDataThe create session data
Returns
"true" when reading went fine, otherwise "false"
static bool em5::multiplayer::proxy::ProtocolHelper::readCreateSessionResponseMessageData ( const qsf::game::BitStream bitStream,
CreateSessionResponseData createSessionResponseData 
)
static

Reads the data of the CREATESESSION_RESPONSE message from the bit stream.

Parameters
[in]bitStreamThe target bit stream from which the data is read from
[out]createSessionResponseDataThe create session response data
Returns
"true" when reading went fine, otherwise "false"
static bool em5::multiplayer::proxy::ProtocolHelper::readDataMessageData ( const qsf::game::BitStream bitStream,
DataData data 
)
static

Reads the data of the DATA message from the bit stream.

Parameters
[in]bitStreamThe target bit stream from which the data is read from
[out]dataThe data
Returns
"true" when reading went fine, otherwise "false"
static bool em5::multiplayer::proxy::ProtocolHelper::readMessage ( const qsf::game::BitStream bitStream,
MessageType messageType,
qsf::game::BitStream messageData 
)
static

Reads an message data from the bit stream.

Parameters
[in]bitStreamThe source bit stream from which the data is read from
[out]operationMessageThe operation message type which was read from the stream
[out]messageDataThe payload data of the message (can be empty)
Returns
"true" when reading went fine, otherwise "false"
static bool em5::multiplayer::proxy::ProtocolHelper::readMessageTypeAndDataSize ( const qsf::game::BitStream bitStream,
MessageType messageType,
uint32 dataSize 
)
static

Reads message type and data size from the bit stream.

Parameters
[in]bitStreamThe source bit stream from which the data is read from
[out]messageTypeThe message type which was read from the stream
[out]dataSizeThe size of the message data
Returns
"true" when reading went fine, otherwise "false"
static bool em5::multiplayer::proxy::ProtocolHelper::readMetaDataOfDataMessageData ( const qsf::game::BitStream bitStream,
DataData data 
)
static

Reads only the metadata of the DATA message from the bit stream.

Parameters
[in]bitStreamThe target bit stream from which the data is read from
[out]dataThe data
Returns
"true" when reading went fine, otherwise "false"
static bool em5::multiplayer::proxy::ProtocolHelper::readPayloadData ( const qsf::game::BitStream bitStream,
qsf::game::BitStream payloadData,
uint32  payloadSize 
)
static

Reads the payload data from the bit stream.

Parameters
[in]bitStreamThe source bit stream from which the data is read from
[out]payloadDataThe bit stream to which the read payload data is written to
[in]payloadSizeThe payload size which should be read from the source bit stream
Returns
"true" when reading went fine, otherwise "false"
static bool em5::multiplayer::proxy::ProtocolHelper::updateProxySessionClientIdInDataMessageData ( qsf::game::BitStream bitStream)
static
static bool em5::multiplayer::proxy::ProtocolHelper::writeClientConnectedToSessionMessageData ( qsf::game::BitStream bitStream,
const ClientConnectedToSessionData clientConnectedToSessionData 
)
static

Writes the data of the CLIENT_CONNECTED_TO_SESSION message to the bit stream.

Parameters
[in]bitStreamThe target bit stream to which the data is written to
[in]clientConnectedToSessionDataThe client connected to session response data
Returns
"true" when writing went fine, otherwise "false"
static bool em5::multiplayer::proxy::ProtocolHelper::writeClientDisconnectFromSessionMessageData ( qsf::game::BitStream bitStream,
const ClientDisconnectedFromSessionData clientDisconnectedFromSessionData 
)
static

Writes the data of the CLIENT_DISCONNECT_FROM_SESSSION message to the bit stream.

Parameters
[in]bitStreamThe target bit stream to which the data is written to
[in]clientDisconnectedFromSessionDataThe client disconnected from session response data
Returns
"true" when writing went fine, otherwise "false"
static bool em5::multiplayer::proxy::ProtocolHelper::writeConnectToSessionMessageData ( qsf::game::BitStream bitStream,
const ConnectToSessionData connectToSessionData 
)
static

Writes the data of the CONNECTTOSESSION message to the bit stream.

Parameters
[in]bitStreamThe target bit stream to which the data is written to
[in]connectToSessionDataThe connect to session data
Returns
"true" when writing went fine, otherwise "false"
static bool em5::multiplayer::proxy::ProtocolHelper::writeConnectToSessionResponseMessageData ( qsf::game::BitStream bitStream,
const ConnectToSessionResponseData connectToSessionResponseData 
)
static

Writes the data of the CONNECTTOSESSION_RESPONCSE message to the bit stream.

Parameters
[in]bitStreamThe target bit stream to which the data is written to
[in]connectToSessionResponseDataThe connect to session response data
Returns
"true" when writing went fine, otherwise "false"
static bool em5::multiplayer::proxy::ProtocolHelper::writeCreateSessionMessageData ( qsf::game::BitStream bitStream,
const CreateSessionData createSessionData 
)
static

Writes the data of the CREATESESSION message to the bit stream.

Parameters
[in]bitStreamThe target bit stream to which the data is written to
[in]createSessionDataThe create session data
Returns
"true" when writing went fine, otherwise "false"
static bool em5::multiplayer::proxy::ProtocolHelper::writeCreateSessionResponseMessageData ( qsf::game::BitStream bitStream,
const CreateSessionResponseData createSessionResponseData 
)
static

Writes the data of the CREATESESSION_RESPONSE message to the bit stream.

Parameters
[in]bitStreamThe target bit stream to which the data is written to
[in]createSessionDataThe create session response data
Returns
"true" when writing went fine, otherwise "false"
static bool em5::multiplayer::proxy::ProtocolHelper::writeDataMessageData ( qsf::game::BitStream bitStream,
const DataData data 
)
static

Writes the data of the DATA message to the bit stream.

Parameters
[in]bitStreamThe target bit stream to which the data is written to
[in]dataThe data
Returns
"true" when writing went fine, otherwise "false"
static bool em5::multiplayer::proxy::ProtocolHelper::writeDataMessageData ( qsf::game::BitStream bitStream,
const uint8  proxySessionClientId,
const qsf::game::BitStream data 
)
static

Writes the data of the DATA message to the bit stream.

Parameters
[in]bitStreamThe target bit stream to which the data is written to
[in]proxySessionClientIdThe per session id of the proxy client to which the data should be send
[in]dataThe data to be send
Returns
"true" when writing went fine, otherwise "false"
static void em5::multiplayer::proxy::ProtocolHelper::writeHeader ( qsf::game::BitStream bitStream,
uint32  payloadSize 
)
static

Writes the multiplayer proxy protocol header to the given bit stream The header consist of following parts:

  • An Identifier string of 6 chars (EM5MPP)
  • A protocol version, uint16 (The current version knows the helper)
  • The size of the payload (in amount of bits), uint32
Parameters
[in]bitStreamThe bit stream to which the data is written to
[in]payloadSizeThe payload size
static bool em5::multiplayer::proxy::ProtocolHelper::writeMessage ( qsf::game::BitStream bitStream,
const MessageType messageType,
const qsf::game::BitStream messageData 
)
static

Write an message data to the bit stream.

Parameters
[in]bitStreamThe target bit stream to which the data is written to
[in]messageTypeThe message type to be written to the stream
[in]messageDataThe payload data of the message (can be empty)
Returns
"true" when reading went fine, otherwise "false"
static bool em5::multiplayer::proxy::ProtocolHelper::writeMessageAsSingleMessage ( qsf::game::BitStream bitStream,
const MessageType messageType,
const qsf::game::BitStream messagePayload 
)
static

Write a single message data to the bit stream (This writes also the header for a multiplayer proxy "message")

Parameters
[in]bitStreamThe target bit stream to which the data is written to
[in]messageTypeThe message type which was read from the stream
[in]messagePayloadThe payload data of the message (can be empty)
Returns
"true" when reading went fine, otherwise "false"
static bool em5::multiplayer::proxy::ProtocolHelper::writeMessageAsSingleMessageWithoutData ( qsf::game::BitStream bitStream,
const MessageType messageType 
)
static

Write a single message data to the bit stream (This writes also the header for a multiplayer proxy "message")

Parameters
[in]bitStreamThe target bit stream to which the data is written to
[in]messageTypeThe message type which was read from the stream
Returns
"true" when reading went fine, otherwise "false"
static bool em5::multiplayer::proxy::ProtocolHelper::writePayloadData ( qsf::game::BitStream bitStream,
const qsf::game::BitStream payloadData 
)
static

Writes the payload data to the bit stream.

Parameters
[in]bitStreamThe bit stream to which the data is written to
[in]payloadDataThe bit stream containing the payload data
Returns
"true" when all went fine, otherwise "false"

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