Skip to content

Commit 9999ee6

Browse files
committed
Clarify that timestamps are UTC
As obtained directly from NTP; there's no reason to refer to POSIX.
1 parent 37d3280 commit 9999ee6

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

protocol/protocol.rst

+9-8
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ MQTT messages should, unless otherwise indicated, be set persistent so that
99
devices that reboot or lose their connection will display the right thing upon
1010
reconnection. Most messages are designed to be idempotent, in the sense that
1111
they carry timestamps of their veracity, so out-of-order delivery is partially
12-
mitigated.
12+
mitigated. Timestamps are in UTC seconds which is easily obtained over the
13+
network using (S)NTP.
1314

1415
Public, Centrally-set topics
1516
############################
@@ -20,7 +21,7 @@ logins as well as our jail timers' users.
2021

2122
* ``config`` the string ``none`` or a whitespace-separated series of fields:
2223

23-
* ``start_time`` -- POSIX seconds indicating start state
24+
* ``start_time`` -- UTC seconds indicating start state
2425

2526
* ``setup_duration`` -- setup duration, in seconds
2627

@@ -48,12 +49,12 @@ logins as well as our jail timers' users.
4849

4950
* any additional fields are to be ignored.
5051

51-
* ``endtime`` -- a single number, denoting POSIX seconds of a
52+
* ``endtime`` -- a single number, denoting UTC seconds of a
5253
forced game end. If this is larger than the last ``starttime`` gotten
5354
in a ``config`` message, then the game is considered over.
5455

5556
* ``flags`` -- a whitespace-separated text field. The first field is a
56-
POSIX-seconds timestamp; subsequent fields are either the string ``?`` or:
57+
UTC-seconds timestamp; subsequent fields are either the string ``?`` or:
5758

5859
* ``red`` -- red team flag capture count (int, negatives OK)
5960

@@ -62,7 +63,7 @@ logins as well as our jail timers' users.
6263
* any additional fields are to be ignored.
6364

6465
* ``message`` -- Message to be displayed everywhere. This and
65-
all other ``message/#`` topics have a POSIX-seconds timestamp followed by
66+
all other ``message/#`` topics have a UTC-seconds timestamp followed by
6667
whitespace before the message body. These permit messages from previous
6768
games to be suppressed, should they end up resident on the MQTT broker.
6869

@@ -75,14 +76,14 @@ logins as well as our jail timers' users.
7576
* ``message/jail/#`` -- Reserved for messages directed to a particular jail
7677
glyph; at present, our devices do not subscribe to these endpoints.
7778

78-
* ``messagereset`` -- A single number, denoting POSIX seconds
79+
* ``messagereset`` -- A single number, denoting UTC seconds
7980
before which messages should not be displayed. This is useful in the
8081
event that the judges send out an incorrect message.
8182

8283
There are some additional public topics not under ``ctfws/game`` as they do not
8384
pertain to a particular game, but rather to the world more generally:
8485

85-
* ``ctfws/timesync`` -- a single number, denoting POSIX seconds at the time of
86+
* ``ctfws/timesync`` -- a single number, denoting UTC seconds at the time of
8687
its publication. The head judge's computer or the broker should publish to
8788
this topic periodically (every minute?) to assist clients in measuring their
8889
clock skew. Clients must ignore retained messages on this topic, as they are
@@ -98,7 +99,7 @@ Messages for here are composed of whitespace-separated fields:
9899

99100
* ``url`` -- a URL whence the document may be downloaded;
100101
(spaces are to be URL-encoded, naturally enough).
101-
* ``time`` -- (integer) POSIX seconds at which the handbook was last modified
102+
* ``time`` -- (integer) UTC seconds at which the handbook was last modified
102103
* ``sha256`` -- A hex encoding of the SHA256 of the handbook file.
103104

104105
The ``time`` and ``sha256`` fields are to assist clients in suppressing fetches

0 commit comments

Comments
 (0)