(including seed so it's harder to spoof); respond to that by setting a
DEAD column in the db and flagging the device as gone. Notify any
connected device of the fact. Refuse to accept new connections to
that game. As already-connected devices reconnect, allow them to do
so but send a new status message that their game is dead. Not heavily
tested yet.
remove the artificial limit on number of stored messages. This seems
to fix problems where lots of chats in a row clog up the relay so that
messages never get flowing again. Works more cleanly than
artificially ACKing.
RECONN or CONN that lists the game as full. This means we get the
all-green icon (or the A in the gtk case) when in a consummated game
rather than only when all devices are actually connected.
message to be sent next time it does. And since the cookieID will
change and should be there already anyway, remove it. (Should remove
the hostID too for the same reason.)
connName/hid pair. This works around a problem where a device,
continuing to connect and send all pending messages for another device
that is not connecting, winds up with hundreds of identical messages
stored.
memory. Confirmed that devices can hookup without ever being
connected at the same time and that the messages survive a relay
reboot. No further testing yet.
recycling of crefs between when devices in a game connect. This plus
movement of messages into the DB will re-enable games played without
the two devices ever being connected at the same time.
ALLCOND until it's time to kill the cref. When one device connects
and leaves the cref is recycled, so when a new device joins and is
assigned the same game and a new cref is initialized the number of
players already registered must be set from the db entry; do that.
HostRec. This fixes failure to reconnect so that now a complete game
is possible (gtk version) without the two devices every being
connected at the same time.
consistent: nJoined in DB tracks players "ever seen and issued
connName" rather than "currently connected". Next step: debug game
between two devices never connected at same time.
game works to completion with both signing up as guests (no -s) with
one local and one remote player (identical commandlines.) Not yet
tested: if any signs up as a host, reconnecting rather than
connecting, etc. This is just a snapshot.
connect first, guests second, with clear error messages if the order's
wrong. This seems to make it simpler for users to get a connection
right. Code holding multiple games worth of hosts and guests in a
cref is gone.
that all devices must be connected initially and that it's all memory
based so a crash wipes stored messages.) Accept messages for
forwarding when in the MISSING state, not just the ALLHERE state.
Store messages that can't be sent now, and send any that have
accumulated when a host reconnects. When a cref loses its last
connection, keep it around unless it has no messages stored (as will
be the case when a game ends.)
name. All new connections are stored together, and after each
connection an attempt is made to build one complete game with a host
and however many guests. All remaining devices are moved into a new
pending record in the same state, and the completed game is treated as
always. Seems to work, though nearly 20% of linux instances are
failing to connect the relay run from the new test script samename.sh.
Need to figure out why.
Also added logging of seed and connname to comms.c since games
launched together can no longer be certain to connect on the relay.
This allows the test script to identify joined games from their logs
and detect success or failure.
This checkin changes the relay protocol, so relay and clients will
both need to be upgraded.