MQTT must create the same header for each message, so having it set
the current timestamp is bad. I actually think it belongs in the comms
header, not in each transport.
Rematch against self didn't work, and is useful for testing. So in
dutil method hasGame(), check if games with the same gameID are also
for the same channel. And when creating a new game for rematch, make
sure it's channel is 0.
I'm looking for a test case to reproduce the Andorid situation where
invitations are never deleted from comms' queue and so prevent the
game from being considered over. Doesn't seem to happen in Linux, but
more tests are good.
Creating an address record without having heard from the remote is
new, and setting it to an old version was preventing using new msg
format. So set to new by default. Not sure how it'll get downgraded
facing an old client, but a 100-game upgrade test passes.....
Looks like invitations become unsendable before they're deleted
sometimes and so block sending real messages. This fixes device
accepting invitation but never hearing back from host.
This should complete sending to multiple topics (for backwards
compatibility) and supporting combined messages in the future (sending
them is hard; receiving not so much.)
I didn't understand MQTT at all. Per the docs anyway it only keeps a
message around if its "persist" flag is set, and then it only keeps
the most recent per topic. I expected that when a device connected,
messages would be waiting for it, but that's apparently not true (some
evidence to the contrary.) But having all games on a device share the
same topic means only one message can be waiting. So switch to
including gameID in the topic, subscribing to a wildcard topic and
sending to a different one per game. For now, for legacy purposes,
we'll keep sending to the old per-device topic.