Base class that wraps the IDiarkisField class for easy use of Field functionality.
More...
#include <DiarkisFieldBase.h>
|
| DiarkisFieldBase () |
| DiarkisFieldBase constructor. More...
|
|
virtual | ~DiarkisFieldBase () |
| DiarkisFieldBase destructor. More...
|
|
virtual void | SetupTcpField (const std::shared_ptr< IDiarkisTcp > &tcp, const std::shared_ptr< LoggerFactory > &loggerFactory) |
| Set up Field with TCP protocol. More...
|
|
virtual void | SetupUdpField (const std::shared_ptr< IDiarkisUdp > &udp, const std::shared_ptr< LoggerFactory > &loggerFactory) |
| Setup Field with UDP protocol. More...
|
|
virtual void | SendFieldJoin (int64_t x, int64_t y, int64_t z, const uint8_t *payload, size_t payloadSize, uint32_t syncLimit, uint32_t customFilterID, bool reliable) |
| Join field. More...
|
|
virtual void | SendFieldJoin (int64_t x, int64_t y, int64_t z, const std::vector< uint8_t > &payload, uint32_t syncLimit, uint32_t customFilterID, bool reliable) |
| Same as SendFieldJoin() More...
|
|
virtual void | SendFieldSync (int64_t x, int64_t y, int64_t z, const uint8_t *payload, size_t payloadSize, uint32_t syncLimit, uint32_t customFilterID, bool reliable) |
| Sends data to other clients in the field. More...
|
|
virtual void | SendFieldSync (int64_t x, int64_t y, int64_t z, const std::vector< uint8_t > &payload, uint32_t syncLimit, uint32_t customFilterID, bool reliable) |
| Same as SendFieldSync() More...
|
|
virtual void | SendFieldDisappear () |
| Notifies that this client is no longer visible to other clients. More...
|
|
virtual void | SendFieldLeave () |
| Notify that you are leaving the field. More...
|
|
Base class that wraps the IDiarkisField class for easy use of Field functionality.
◆ DiarkisFieldBase()
DiarkisFieldBase::DiarkisFieldBase |
( |
| ) |
|
◆ ~DiarkisFieldBase()
DiarkisFieldBase::~DiarkisFieldBase |
( |
| ) |
|
|
virtual |
◆ SetupTcpField()
void DiarkisFieldBase::SetupTcpField |
( |
const std::shared_ptr< IDiarkisTcp > & |
tcp, |
|
|
const std::shared_ptr< LoggerFactory > & |
loggerFactory |
|
) |
| |
|
virtual |
Set up Field with TCP protocol.
Register loggers and callback functions.
- Parameters
-
[in] | tcp | Pointer to IDiarkisTcp class |
[in] | loggerFactory | Pointer to logger class |
◆ SetupUdpField()
void DiarkisFieldBase::SetupUdpField |
( |
const std::shared_ptr< IDiarkisUdp > & |
udp, |
|
|
const std::shared_ptr< LoggerFactory > & |
loggerFactory |
|
) |
| |
|
virtual |
Setup Field with UDP protocol.
Register loggers and callback functions.
- Parameters
-
[in] | udp | Pointer to IDiarkisUdp class |
[in] | loggerFactory | Pointer to logger class |
◆ SendFieldJoin() [1/2]
void DiarkisFieldBase::SendFieldJoin |
( |
int64_t |
x, |
|
|
int64_t |
y, |
|
|
int64_t |
z, |
|
|
const uint8_t * |
payload, |
|
|
size_t |
payloadSize, |
|
|
uint32_t |
syncLimit, |
|
|
uint32_t |
customFilterID, |
|
|
bool |
reliable |
|
) |
| |
|
virtual |
Join field.
Callback events registered with GetJoinEvent() (e.g. OnJoin) will be triggered.
- Parameters
-
[in] | x | Value of X coordinate in x field (width) |
[in] | y | Value of Y coordinate in y field (depth) |
[in] | z | Value of Z coordinate in z field (difference in spatial level, not height) |
[in] | payload | Array of data to send to other clients |
[in] | payloadSize | Length of the payload |
[in] | syncLimit | number of synchronizations |
[in] | customFilterID | Indicates the use of a filter function defined by the server during synchronization.
0 indicates that the filter function is not used. |
[in] | reliable | Determines whether to send via reliable communication (RUDP); ignored for TCP protocol. |
◆ SendFieldJoin() [2/2]
void DiarkisFieldBase::SendFieldJoin |
( |
int64_t |
x, |
|
|
int64_t |
y, |
|
|
int64_t |
z, |
|
|
const std::vector< uint8_t > & |
payload, |
|
|
uint32_t |
syncLimit, |
|
|
uint32_t |
customFilterID, |
|
|
bool |
reliable |
|
) |
| |
|
virtual |
◆ SendFieldSync() [1/2]
void DiarkisFieldBase::SendFieldSync |
( |
int64_t |
x, |
|
|
int64_t |
y, |
|
|
int64_t |
z, |
|
|
const uint8_t * |
payload, |
|
|
size_t |
payloadSize, |
|
|
uint32_t |
syncLimit, |
|
|
uint32_t |
customFilterID, |
|
|
bool |
reliable |
|
) |
| |
|
virtual |
Sends data to other clients in the field.
Callback events registered with GetSyncEvent() (e.g. OnSync) will be triggered.
- Parameters
-
[in] | x | Value of X coordinate in field (width) |
[in] | y | Value of Y coordinate in field (depth) |
[in] | z | Value of Z coordinate in field (spatial difference, not height) |
[in] | payload | Array of data to send to other clients |
[in] | payloadSize | Length of the payload |
[in] | syncLimit | Number of synchronizations |
[in] | customFilterID | Indicates the use of a filter function defined by the server during synchronization.
0 indicates that the filter function is not used. |
[in] | reliable | Determines whether to send with reliable communication (RUDP) or not (UDP); ignored for the TCP protocol. |
◆ SendFieldSync() [2/2]
void DiarkisFieldBase::SendFieldSync |
( |
int64_t |
x, |
|
|
int64_t |
y, |
|
|
int64_t |
z, |
|
|
const std::vector< uint8_t > & |
payload, |
|
|
uint32_t |
syncLimit, |
|
|
uint32_t |
customFilterID, |
|
|
bool |
reliable |
|
) |
| |
|
virtual |
◆ SendFieldDisappear()
void DiarkisFieldBase::SendFieldDisappear |
( |
| ) |
|
|
virtual |
Notifies that this client is no longer visible to other clients.
Triggers a callback event (e.g. OnDisappear) registered with GetDisappearEvent().
◆ SendFieldLeave()
void DiarkisFieldBase::SendFieldLeave |
( |
| ) |
|
|
virtual |
Notify that you are leaving the field.
◆ OnJoin()
Callback event called when joined a field.
◆ OnSync()
Callback event called when synchronizing the position of nearby clients in the field.
- Parameters
-
◆ OnDisappear()
Callback event called when Disappear is received.
- Parameters
-
[in] | remoteUid | User ID of the member who disappeared |
◆ OnLeave()
Response callback event called when exiting the Field.
◆ tcp_
Pointer to the IDiarkisTcp class.
◆ udp_
Pointer to the IDiarkisUdp class.
◆ field_
Pointer to the IDiarkisField class.
◆ logger_
Pointer to the IDiarkisLogger class.
◆ eventUnsubscriptions_
◆ fieldConnect_
The documentation for this class was generated from the following files: