QtCraft API C++ classes QML types Handbook

QcEntitySync Class

Tells each client about the entities near it (decision E-364), the same way for every kind: a spawn when one comes into view or its spawn data changed, moves for known ones and a removal when one is out of sight, rests or died. More...

Header: #include <server/core/QcEntitySync.h>

Public Functions

void sync(QcServerClient &client)

Static Public Members

const double cartMoveThreshold
const double entityViewDistance
const double itemMoveThreshold
const double itemViewDistance

Detailed Description

What differs per kind is a rule: how far it is seen, whether and when its moves are sent, and what its spawn says.

Member Function Documentation

void QcEntitySync::sync(QcServerClient &client)

Sends client what changed of the entities it knows; runs once per tick and client.

Member Variable Documentation

const double QcEntitySync::cartMoveThreshold

Minecarts send moves only while they move (decision E-382).

const double QcEntitySync::entityViewDistance

Players are visible to each other and other entities are sent to clients within this distance.

const double QcEntitySync::itemMoveThreshold

Item moves smaller than this are not sent (items bobbing on water).

const double QcEntitySync::itemViewDistance

Dropped items are sent to clients within this distance.