Commit graph

26 commits

Author SHA1 Message Date
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
393cccb86c Add MSGONLY state to indicate cref being kept alive only to preserve
messages for a latter connection.
2009-11-09 05:29:06 +00:00
ehouse
aae12428da Add limited support for store-and-forward (where limitations include
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.)
2009-11-08 21:35:39 +00:00
ehouse
ed52582ea4 get rid of states and code for checking numbers of players -- since
any number is allowed now.
2009-11-03 05:03:20 +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
503db9cc6f up copyright 2009-07-30 12:54:17 +00:00
ehouse
4a5d74a0af rename state to take up less space in browser; add number of respawns
to status display.
2009-07-29 04:25:21 +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
8dbfe4ed79 fix new compiler warnings; daemonize, and add handler to kill child if
parent dies so that script can kill based on pid file.
2007-11-13 03:53:10 +00:00
ehouse
0291ec1e75 Turn on self-spawning: main loop should never crash but exists only to
respawn child when it does.  Add crash command to test this.  Add
ability to set logging level from ctrl port.
2007-11-10 05:41:49 +00:00
ehouse
92485783af update email address in header comments: no code change 2006-01-08 01:25:02 +00:00
ehouse
befc90648e add shutdown event and action 2005-10-30 05:07:58 +00:00
ehouse
d74de11771 add XWS_ANY 2005-10-19 03:40:40 +00:00
ehouse
be5078e8f8 removed unused states etc. 2005-10-06 02:36:45 +00:00
ehouse
4e5f69f4e8 rename states so can format to 80 cols; add log level param. No
change to functionality in this checkin.
2005-10-02 16:08:42 +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
c4d212f78c shorten names so table easier to fit in 80 cols 2005-09-14 05:14:04 +00:00
ehouse
87d1c8f593 event name change 2005-09-09 03:15:06 +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
9a2567252b cleanup: get rid of unused states/actions and code to handle them. 2005-09-03 07:15:05 +00:00
ehouse
c82fd2e4f2 Send disconnect events with error codes on heartbeat and connect timer
failures; change how state machine handles heartbeats: only put events
into the machine when there's a failure.
2005-09-03 06:55:08 +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
91abdb3bcc fix bug where client connecting before server would result in attempt
to forward packet to host not yet available.  Drop such packets now.
2005-08-02 04:57:13 +00:00
ehouse
db6f6c258d move to using a formal table-driven state machine for each game (cref
object).  While it makes things more complex at this point, it should
make it easier in the long run to add error handling, timeouts, etc.
2005-07-05 22:05:37 +00:00