視界に入るリモートクライアントの同期データを取得する

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

SyncInit を使うことで自分の視界に入るクライアントの同期データを取得し、自分のデータを同期することが可能です。

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);