QtCraft API C++ classes QML types Handbook

QcServerClock Class

The time of the server (decision E-249): simulated ticks, and the real time as the players live it. More...

Header: #include <server/tick/QcServerClock.h>

Public Functions

void advance(qint64 realNs)
qint64 lastTickNs() const
qint64 playerTimeNs() const
quint64 tick() const

Detailed Description

Each tick adds the real time it stands for (QcTickScheduler::tickRealNs); input budgets, rate limits, autosaves, confirmations and the pace of messages to the clients follow the players' time at every tick rate and during a sprint, the simulation follows the ticks.

Member Function Documentation

void QcServerClock::advance(qint64 realNs)

A new tick that stands for realNs of the players' time.

qint64 QcServerClock::lastTickNs() const

Returns the real time the latest tick stood for.

qint64 QcServerClock::playerTimeNs() const

Returns the players' time in nanoseconds: the real time all ticks stood for.

quint64 QcServerClock::tick() const

Returns the number of ticks counted.