How To Retrieve Synchronization Data With Remote Clients Using Diarkis Field

Diarkis Field allows clients to "see" each other based on position data in the virtual space created by Diarkis Field.

With Diarkis Field's SyncInit, you may retrieve the synchronization data from the remote clients that are within your field of vision.

NOTE: The example below uses C#

// This event is raised as a response to SyncInit
REG_EVENT(field->GetResponseSyncInitEvent(), [this](void*, const vector<vector<uint8_t>>& list)
{
this->OnSyncInit(e);
});

// Player character coordinate data
int64_t x = localCharacter->x;
int64_t y = localCharacter->y;
int64_t z = localCharacter->z;

// Maximum number of remote clients to synchronize with
uint16_t syncLimit = 50;

// If there is a custom filter defined on the server,
// setting this to the matching custom filter ID will have the server execute custom filter operation
// Setting this to 0 will disable custom filter
uint8_t customFilterId = 1;

// This will be sent to the remote clients in the field of view
vector<uint8_t> bytesMessage = syncData;

field->SyncInit(x, y, z, syncLimit, customFilterId, bytesMessage);