React hook that synchronizes the client clock with the host server.
Periodically sends PING messages over the WebSocket and processes PONG
responses to estimate the clock offset and round-trip time.
This hook is used internally by useGameClient and does not need to be
called directly. Access getServerTime() and rtt from the
useGameClient return value instead.
Parameters
socket: WebSocket|null
The active WebSocket connection (or null if not yet connected).
React hook that synchronizes the client clock with the host server.
Periodically sends PING messages over the WebSocket and processes PONG responses to estimate the clock offset and round-trip time.
This hook is used internally by
useGameClientand does not need to be called directly. AccessgetServerTime()andrttfrom theuseGameClientreturn value instead.