Commit graph

38 commits

Author SHA1 Message Date
Andy2
86e3cc7286 When device reconnects to a dead game, just deny the connection with a
new error message rather than allow it as if it were a normal game
only to send a game-dead message after.  This solves the problem of
how device knows not to put up welcoming message or suggestion to
invite to a game that's suddenly missing players.  BUT: this change is
incompatible with existing versions and so needs to get pushed out
before the in-use relay can be upgraded to include this code.
2011-07-06 06:47:25 -07:00
Andy2
e886a1aefe lots more changes -- another snapshot, this, rather than stuff
carefully polished and reviewed.  Shows progress, though, in getting
through tests.
2011-06-23 07:12:50 -07:00
Andy2
f96f4a040b add new proxy command that fetches actual messages stored for a device. 2011-01-22 12:52:26 -08:00
Andy2
04e1b0c22b new constants, include new status event type, for relay to accept
notification of deleted game and communicate that to others in the
game as they connect.
2010-11-11 06:26:59 -08:00
Andy2
d1fcdb69da double max room name len since the old value was too small -- only
filled half a text field on android
2010-11-03 18:38:43 -07:00
Andy2
b237277544 put back enum just removed; it's screwing up existing code having all
the followers change.
2010-10-25 18:06:48 -07:00
Andy2
e909e4b343 remove redundant message; advance state to ALLCONNECTED on receipt of
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.
2010-10-23 20:29:24 -07:00
Andy2
1d0c207521 add test command for proxy feature to fetch for connNames whether
there are messages pending for them.  Not handled yet on relay.
2010-09-21 18:28:31 -07:00
Andy2
a549ade1fa a bit more work on rc 2010-09-20 18:31:17 -07:00
Andy2
430b033ae0 a bit of progress on cmdline tool 2010-09-20 04:59:09 -07:00
Andy2
821e4d9c39 add ACK to protocol, returned by device after gets connName on initial
connection.  Space is held for device on assumption ack will come
back, then given up if it fails.
2010-09-14 13:54:52 -07:00
Andy2
20312144dd tons of changes, still rough, snapshoted here: a gtk device vs device
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.
2010-09-10 01:30:40 -07:00
ehouse
fc17df2a7e When guest connects, check if providing too many players before
reponding to connection request so that we just deny the request (with
new error code) rather than revoking it later.
2009-12-14 04:10:23 +00:00
ehouse
26469d734c Modify state machine and return new error codes to force host to
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.
2009-12-04 08:03:27 +00:00
ehouse
3bdfda6548 Make it possible for multiple games to connect using the same room
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.
2009-11-02 01:01:47 +00:00
ehouse
0e43675abf Address problems matching [re]connections to games: first, go back to
setting connName when all in a game are present.  Second, have every
host include in connections a random number.  That number is made part
of the connName and in general used to test whether a host belongs in
a particular game.  Add this "seed" to web interface.  Means new
versions for relay protocol and game stream format.  Latter is handled
correctly so older games can be opened.
2009-09-26 14:37:49 +00:00
ehouse
b219e8b279 Send notification when device disconnnects without closing socket (in
addition to the existing one sent when a socket is closed).
2009-09-20 18:47:47 +00:00
ehouse
18e9301e87 rename Cookie to Invite, a change that may change. Rename everywhere
in clients but not in relay where cookie is too pervasive.  (There are
no code changes in this checkin.)
2009-09-14 03:11:11 +00:00
ehouse
6603949b0e Fix bug where device quitting one game to start another with same
cookie winds up connecting to the old game -- by flagging a cref as
full and no longer accepting connections without connNames even when
in the MISSING state.  Required a protocol changes so that devices get
their connNames as early as possible.
2009-09-14 01:55:03 +00:00
ehouse
dbf9daf71b Fix problems reconnecting hosts where some but not all received the
ALLHERE message and connName: change relay protocol so cookie is
included in RECONNECT message, and hostIDs are not assigned until
ALLHERE, and change host-to-game matching to use connName first but
fall back to cookie.  This fixes nearly all cases failing to reconnect
after relay goes down.
2009-08-21 12:00:09 +00:00
ehouse
503db9cc6f up copyright 2009-07-30 12:54:17 +00:00
ehouse
53b27c96c9 Helps to compile platforms too before checking in... 2009-02-01 16:20:18 +00:00
ehouse
cb1222c0f9 Make cooperation in a heartbeat scheme a compile-time option. This is
meant to allow comms to take over heartbeats.
2007-11-18 23:38:56 +00:00
ehouse
92485783af update email address in header comments: no code change 2006-01-08 01:25:02 +00:00
ehouse
eb8301ade7 return error to client when flags indicate old version; close sockets
when error occurs in processing message.
2005-10-14 08:29:58 +00:00
ehouse
f7443c9f7f catch symbian up with api changes -- but still need to set timers
before it'll talk to relay.
2005-10-02 16:40:16 +00:00
ehouse
6835b6d1eb New scheme for accepting and limiting reconnections. Now device must
send player counts, local and expected.  Based on these the relay
accepts connections, declares the game full and ready for message
forwarding, and decides whether to accept a reconnect.
2005-10-02 15:39:38 +00:00
ehouse
77319b570d make transmitted vars smaller where possible; new relay identifying
scheme where cookie is used only to connect, and is replaced for
reconnects by a relay-generated name that's supposed to be unique
across all games on all relays and includes a hostname read in from
config file; relay assign non-servers' hostIDs.
2005-10-01 16:33:45 +00:00
ehouse
cf5906eacf Add and handle disconnect message so a device can reuse its socket for
a new game.
2005-09-05 15:50:49 +00:00
ehouse
47030320f4 move typedef 2005-09-04 20:55:07 +00:00
ehouse
1f43831219 new error code 2005-09-04 14:35:13 +00:00
ehouse
8072bc687c add XWRELAY_OTHERCONNECT message 2005-09-03 18:32:12 +00:00
ehouse
a4033a44c3 when one device is disconnected for heartbeat, tell others it's going
away.
2005-09-03 15:41:17 +00:00
ehouse
b0cc6f458b add disconnect event and error codes 2005-09-03 06:46:03 +00:00
ehouse
8f32f4f99a loads of changes: get settings from config file; remove sockets and
kill crefs via state machine, and protect access to a cref so it can
die without another thread being in it; do timers via timeout to
poll() rather than interrupt (and integrate into state machine);
detect when all players are present and change state so new
connections on that cookie will get a new cref.
2005-09-02 06:56:34 +00:00
ehouse
abde767154 tweaks to logging and adding some message enums 2005-08-08 23:33:51 +00:00
ehouse
3b53363e16 Pass protocol version code with connect request, and return error if
it isn't what relay can handle.  Report error to user.
2005-07-06 01:36:52 +00:00
ehouse
dc25eb9e35 first checked in. 2005-03-19 22:16:49 +00:00