Clock and replay protection
How to correct the game server clock with serverTime, how to generate the nonce of each request, and when to use CLOCK_UNSYNCED.
The game server clock is often wrong by a few seconds or minutes. If the connector trusted it, order deadlines and requests would fail silently. So the protocol uses the backend clock as the reference and asks the connector to correct its own.
Two rules
- The order deadline is valid on the backend clock.
issuedAtandexpiresAtare absolute times on the backend clock. The connector compares them only with the corrected time. - Every request has a new
nonce. It is the protection against replayed requests.
Correct the clock
Every response (success or error) carries serverTime. On every response:
- Calculate
clockOffsetMs = serverTime - localClockAtReceipt. If you want, smooth it with the average of the last samples. - Store the value and send it in the
heartbeat.clockOffsetMsof each poll. It serves only as a drift alert. The order deadline always uses the backend clock. - The corrected time is
localClockNow + clockOffsetMs.
Use the corrected time in three places:
| Where | Field |
|---|---|
| Every request | sentAt |
| Every ACK | at |
| Order deadline check | compare with expiresAt |
Time format: UTC, ISO 8601, always with milliseconds and Z, for example 2026-10-16T12:00:00.000Z.
Monotonic deadline (recommended)
An NTP jump on the host can change the local time in the middle of a run. To protect yourself:
- When you receive the order, calculate
localDeadline = monotonicClockAtReceipt + remainingMs. - Consider the order expired if either one of the two has passed:
correctedTime > expiresAtor the monotonic clock went pastlocalDeadline.
The remainingMs field also exists for runtimes without a date reader, such as DayZ's Enforce.
Request with the wrong time: CLOCK_SKEW
The backend accepts only requests with sentAt within ±300 seconds of its own time. Outside that, it responds:
{
"ok": false,
"serverTime": "2026-10-16T21:00:00.000Z",
"error": {
"code": "CLOCK_SKEW",
"message": "sentAt fora da janela de ±300 s; ajuste o offset com serverTime e repita.",
"retryable": true,
"clientAction": "fix_clock"
}
}What to do:
- Recalculate
clockOffsetMswith theserverTimeof this error response. - Build the request again with the corrected
sentAtand a newnonce. - Retry.
The first request after the game server starts is /session, and it uses the local clock still without correction. If CLOCK_SKEW comes, it is the normal path: correct and retry.
Replay protection (nonce)
To stop someone from resending an intercepted request, DROPSZ stores the nonce values it receives. The same nonce twice is refused with REPLAY_DETECTED.
How to generate the nonce:
- Use random bytes from a system generator.
- Write them as text of 16 to 64 characters in
[A-Za-z0-9_-]. - Generate a new one on every request, including each retry of the same request.
Valid examples: n_poll_dayz_0005_x7Kp2QvLm9 and n_ack_dayz_0007_x7Kp2QvLm9.
Repeated the request? Generate another nonce
Reusing the nonce on a new attempt returns REPLAY_DETECTED. This applies to a retry after a network failure, RATE_LIMITED, CLOCK_SKEW, and any other case.
If REPLAY_DETECTED comes, the nonce was already used: generate a new one and repeat the request.
The protection has more layers, and two of them belong to the connector:
- Orders: the
orderIdandseqsaved on disk prevent running again (see Orders). - Channel: TLS with a verified certificate and a short session (see How the connector works).
No reliable time base: CLOCK_UNSYNCED
If the connector cannot establish the deadline safely, it does not run:
- the runtime has no monotonic clock and
- more than 10 minutes have passed since the last
serverTimesample.
In this case, reject the order with an ACK rejected and reason: "CLOCK_UNSYNCED". When in doubt, do not run. The viewer gets a credit and nothing runs outside the deadline.
{
"orderId": "ord_01JAD8K3QZ7XKM2P9RWT000004",
"seq": 1044,
"attempt": 1,
"status": "rejected",
"at": "2026-10-16T21:00:01.000Z",
"reason": "CLOCK_UNSYNCED",
"detail": "Sem amostra de serverTime há mais de 10 minutos."
}(The example above follows the real ACK format. The detail is free text, up to 200 characters.)
Checklist
- Update
clockOffsetMson every response and send it in the heartbeat. - Use the corrected time in
sentAtand inat. - Generate a new
nonceon every request, including repeated ones. - Handle
CLOCK_SKEWwithfix_clock: recalculate and retry. - Calculate the monotonic deadline when the runtime has a monotonic clock.
- Use
CLOCK_UNSYNCEDwhen there is no reliable time base.
Modes and pause
The four connector modes, what each one does with orders, the local pause that works without a network, and the minimum connector version.
Action result
The result field of the completed ACK: a short summary of what the action did, like {"spawned": 3}. Format, limits, and what the platform does (and does not do) with it.