Submission protocol
The line protocol the flag submission endpoint speaks, and every reply it gives.
The submission endpoint follows the ctf-gameserver submission protocol, with one addition: your team’s token is the first line of every connection, the way ForcAD’s TCP submission works. The endpoint is reached over TLS on port 443 of the hostname Downloads shows; see Submit flags from a farm for the connection.
A session
The endpoint greets you with a banner ending in a blank line:
Welcome to Athena attack/defence flag submission.
Send your team token on the first line, then one flag per line.
Send your token on one line. If it is live, the endpoint answers:
Team accepted, enter your flags
If not, it answers Invalid or revoked team token and closes the connection.
Then send one flag per line, as many as you like on the same connection. Each gets one reply line:
<flag> <CODE> <message>
Replies
| Code | Message | Meaning | What a farm should do |
|---|---|---|---|
OK |
Flag accepted |
The capture scored. | Drop the flag. |
DUP |
Flag already submitted |
Your team already captured this flag. | Drop the flag. |
OWN |
This is your own flag |
The flag is from your own box. | Drop the flag. |
OLD |
Flag expired, too old to submit |
The flag is past its validity window. | Drop the flag. |
INV |
Invalid flag, unknown to this event |
No such flag. | Drop the flag. |
INV |
Invalid flag format |
The line isn’t a flag. | Drop the flag. |
INV |
Invalid flag, its service is no longer in play |
The flag’s service has been taken out of play. | Drop the flag. |
INV |
Invalid team token: revoked |
The connection’s token was revoked; the connection closes. | Drop the flag and replace the token. |
ERR |
Game not running, try again later |
The game is paused, hasn’t started or the tick isn’t ready yet. | Retry later. |
ERR |
Rate limited, try again later |
Your team is submitting too fast. | Retry later. |
ERR |
Submission failed, try again later |
The submission couldn’t be recorded. | Retry later. |
A farm that classifies replies by their wording, as DestructiveFarm does, handles all of these correctly. A reply ending in try again later is the only kind worth retrying.
Limits
- A line is at most 256 bytes. A longer one is answered
<invalid> INVand doesn’t affect the flags after it. - Each team has a submission rate limit. Beyond it, flags are answered with
Rate limited, try again later. - An idle connection is closed after two minutes. Reconnect and send your token again.
- When the endpoint is at capacity, it answers
Submission endpoint is busy, try again laterand closes the connection.
Tokens
A token identifies your team, never your address. The organizers can issue a new token while the old one stays live, and revoke any of them.
If the token a connection authenticated with is revoked while the connection is open, the next flag on it is answered
<flag> INV Invalid team token: revoked
and the connection closes. That flag didn’t score. A farm classifies the reply as rejected and drops that flag, but it keeps the flags it has queued and will be refused again at its next connection, so replace the token in your farm’s configuration with the current one from Downloads.