From 20a6f9217304838906d3f8b487863ad6c6f5b68b Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Thu, 24 May 2018 13:56:42 +0000 Subject: [PATCH] Add time field to GetState --- docs/api.md | 4 +++- tools/fake-server.py | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/api.md b/docs/api.md index 7fa9160..610a814 100644 --- a/docs/api.md +++ b/docs/api.md @@ -85,6 +85,7 @@ None * teams: mapping from anonymized team ID to team name * log: list of (timestamp, team number, category, points) * notices: list of HTML broadcast notices to display to the user +* now: current server time (unix epoch) ### Example @@ -111,7 +112,8 @@ None "notices": [ "WOPR category is now open", "Event closes at 18:00 today, and will resume tomorrow at 08:00" - ] + ], + "now": 1527170088 } } diff --git a/tools/fake-server.py b/tools/fake-server.py index 8076e9d..340b43b 100755 --- a/tools/fake-server.py +++ b/tools/fake-server.py @@ -1,6 +1,7 @@ #! /usr/bin/python3 from aiohttp import web +import time async def fake_register(request): teamId = request.query.get("teamId") @@ -44,6 +45,7 @@ async def fake_state(request): "WOPR category is now open", "Event closes at 18:00 today, and will resume tomorrow at 08:00" ], + "now": int(time.time()), } } return web.json_response(resp)