Base class that wraps the IDiarkisDirectMessage class for easy use of DirectMessage functionality.
More...
#include <DiarkisDirectMessageBase.h>
|
| DiarkisDirectMessageBase () |
| DiarkisDirectMessagecBase constructor. More...
|
|
virtual | ~DiarkisDirectMessageBase () |
| DiarkisDirectMessageBase destructor. More...
|
|
virtual void | SetupTcp (const std::shared_ptr< IDiarkisTcp > &tcp, const std::shared_ptr< LoggerFactory > &loggerFactory) |
| Set up DirectMessage with the TCP protocol. More...
|
|
virtual void | SetupUdp (const std::shared_ptr< IDiarkisUdp > &udp, const std::shared_ptr< LoggerFactory > &loggerFactory) |
| Set up DirectMessage with UDP protocol. More...
|
|
virtual void | Disconnect (const char *uid, const uint8_t *message, size_t messageSize) |
| Disconnects from the specified user via direct message and sends a custom message. More...
|
|
virtual void | Disconnect (const std::string &uid, const std::vector< uint8_t > &message) |
| Same as Diconnect() More...
|
|
virtual void | Send (const char *uid, const uint8_t *message, size_t messageSize) |
| Sends a direct message to the specified user. More...
|
|
virtual void | Send (const std::string &uid, const std::vector< uint8_t > &message) |
| Same as Send() More...
|
|
virtual void | RSend (const char *uid, const uint8_t *message, size_t messageSize) |
| Sends a direct message to the specified user using reliable communications. More...
|
|
virtual void | RSend (const std::string &uid, const std::vector< uint8_t > &message) |
| Same as RSend() More...
|
|
Base class that wraps the IDiarkisDirectMessage class for easy use of DirectMessage functionality.
◆ DiarkisDirectMessageBase()
DiarkisDirectMessageBase::DiarkisDirectMessageBase |
( |
| ) |
|
DiarkisDirectMessagecBase constructor.
◆ ~DiarkisDirectMessageBase()
DiarkisDirectMessageBase::~DiarkisDirectMessageBase |
( |
| ) |
|
|
virtual |
◆ SetupTcp()
void DiarkisDirectMessageBase::SetupTcp |
( |
const std::shared_ptr< IDiarkisTcp > & |
tcp, |
|
|
const std::shared_ptr< LoggerFactory > & |
loggerFactory |
|
) |
| |
|
virtual |
Set up DirectMessage with the TCP protocol.
Registers loggers and callback functions.
- Parameters
-
[in] | tcp | Pointer to the IDiarkisTcp class |
[in] | loggerFactory | Pointer to loggerFactory logger class |
◆ SetupUdp()
void DiarkisDirectMessageBase::SetupUdp |
( |
const std::shared_ptr< IDiarkisUdp > & |
udp, |
|
|
const std::shared_ptr< LoggerFactory > & |
loggerFactory |
|
) |
| |
|
virtual |
Set up DirectMessage with UDP protocol.
Register loggers and callback functions.
- Parameters
-
[in] | udp | Pointer to IDiarkisUdp class |
[in] | loggerFactory | Pointer to logger class |
◆ Disconnect() [1/2]
void DiarkisDirectMessageBase::Disconnect |
( |
const char * |
uid, |
|
|
const uint8_t * |
message, |
|
|
size_t |
messageSize |
|
) |
| |
|
virtual |
Disconnects from the specified user via direct message and sends a custom message.
A callback event (e.g. OnDisconnect) registered with GetDisconnectEvent() will be triggered.
Connection information for direct messages with the specified user cached on the server will be deleted.
- Parameters
-
[in] | uid | Remote client user ID |
[in] | message | Message to be sent to remote client |
[in] | messageSize | Length of the message |
◆ Disconnect() [2/2]
void DiarkisDirectMessageBase::Disconnect |
( |
const std::string & |
uid, |
|
|
const std::vector< uint8_t > & |
message |
|
) |
| |
|
virtual |
◆ Send() [1/2]
void DiarkisDirectMessageBase::Send |
( |
const char * |
uid, |
|
|
const uint8_t * |
message, |
|
|
size_t |
messageSize |
|
) |
| |
|
virtual |
Sends a direct message to the specified user.
The first message may take some time because it needs to search for a remote client.
Messages are sent using the UDP protocol if you are using SetupUdp.
If you are using SetupTcp, messages will be sent using the TCP protocol.
After this function is executed, the callback event (e.g. OnMessageEvent) registered with GetMessageEvent() will be triggered.
- Parameters
-
[in] | uid | User ID of the target to which direct messages are sent |
[in] | message | Message to be sent |
[in] | messageSize | Length of the message |
◆ Send() [2/2]
void DiarkisDirectMessageBase::Send |
( |
const std::string & |
uid, |
|
|
const std::vector< uint8_t > & |
message |
|
) |
| |
|
virtual |
◆ RSend() [1/2]
void DiarkisDirectMessageBase::RSend |
( |
const char * |
uid, |
|
|
const uint8_t * |
message, |
|
|
size_t |
messageSize |
|
) |
| |
|
virtual |
Sends a direct message to the specified user using reliable communications.
The first message may take some time as it needs to search for a remote client.
Messages are sent using the RUDP protocol if SetupUdp is used.
If you are using SetupTcp, messages will be sent using the TCP protocol.
After this function is executed, the callback event (e.g. OnMessageEvent) registered with GetMessageEvent() will be triggered.
- Parameters
-
[in] | uid | User ID of the target to which direct messages are sent |
[in] | message | Message to be sent |
[in] | messageSize | Length of the message |
◆ RSend() [2/2]
void DiarkisDirectMessageBase::RSend |
( |
const std::string & |
uid, |
|
|
const std::vector< uint8_t > & |
message |
|
) |
| |
|
virtual |
◆ OnDisconnect()
Callback function called when a direct message is disconnected.
Triggered when a DirectMessage Disconnect notification is received from the server.
◆ OnMessage()
Callback function triggered when a direct message from another user is received.
Triggered when a DirectMessage Message notification is received from the server.
◆ dm_
Pointer to IDiarkisDirectMessage class.
◆ logger_
Pointer to IDiarkisLogger class.
◆ eventUnsubscriptions_
Diarkis::StdVector<std::function<void()> > DiarkisDirectMessageBase::eventUnsubscriptions_ |
|
protected |
The documentation for this class was generated from the following files: