By waiting and collecting buzzes over a short period of time we can try
to compensate for network latency. This opens up a way to cheat for the
player by forging timestamps, but normally it should makes things more
fair.
Share the time syncing code, and while we're at it wrap the whole
connection thing in a class. Makes it easier to pass the connection
around & later on add more advanced handler registration if we want to.
Control messages are messages that are broadcast to all clients and have
no clearly defined content. The idea is that this can be used to
control a monitor without having to keep adding support for specific
commands on the protocol layer.
This also changes some of the existing messages and adds another
ridiculous convenience layer to our HTML/JS templating: data-eval.
We should probably just bite the bullet and use some reactive framework.
In its current state the implementation should allow a user to resume
their session if the websocket connection is reset, for whatever reason.
This could be expanded to allow session sharing (multiple agents logging
in to the same client), or manual session resume via some sort of
password (encode uid & key to some pass-phrase kinda thing, or QR code).