---
title: "Packet 0: ClockSync"
description: "Round-trip clock synchronization. The server returns its loop count while keeping the retail client one simulation tick ahead."
canonical: "https://aosplay.net/protocol-168/packets/0"
markdown: "https://aosplay.net/docs/protocol-168/packets/0.md"
last_updated: "2026-07-16"
protocol: "Ace of Spades Battle Builder 168"
packet_id_decimal: "0"
packet_id_hex: "0x00"
direction: "Both"
family: "Timing"
implementation_status: "Handled + sent"
evidence: "Implementation-backed"
wire_size: "9 bytes"
---

# Packet 0: ClockSync

> Round-trip clock synchronization. The server returns its loop count while keeping the retail client one simulation tick ahead.

- **Decimal ID:** 0
- **Hex ID:** 0x00
- **Direction:** Both
- **Family:** Timing
- **Status:** Handled + sent
- **Evidence:** Implementation-backed
- **Wire size:** 9 bytes

## Exact wire layout

The application packet ID is the first byte. The remaining rows are in decode order. Byte sizes exclude ENet headers, wrapper prefixes, LZF chunk framing, and compression effects.

| # | Field | Encoding | Bytes | Purpose | Condition |
| ---: | --- | --- | ---: | --- | --- |
| 0 | `packet_id` | u8 | 1 | Always 0 (0x00). | — |
| 1 | `client_time` | i32 LE | 4 | Client clock value echoed through the synchronization exchange. | — |
| 2 | `server_loop_count` | i32 LE | 4 | Authoritative server simulation loop. | — |

## Encoding conventions

- `LE` means least-significant byte first.
- `fixed16` is two-byte sign-magnitude at 1/64 precision.
- `orientation16` uses the measured 1/8192 orientation mapping.
- NUL strings consume their encoded byte length plus one `00` terminator.
- Counted arrays repeat immediately in the documented order.

## Related resources

- [HTML packet page](https://aosplay.net/protocol-168/packets/0)
- [Complete packet catalog](https://aosplay.net/protocol-168/packets)
- [Packet catalog in Markdown](https://aosplay.net/docs/protocol-168/packets.md)
- [Protocol 168 guide](https://aosplay.net/protocol-168)
