Commit graph

30 commits

Author SHA1 Message Date
ehouse
a1be2fb8fc add ports relay is listening on to http display 2009-12-16 02:43:52 +00:00
ehouse
337c36dfd2 remove unused parameter 2009-12-04 07:59:07 +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
7a71c4636b change varible names; remove instance variable than can be on the stack. 2009-11-01 01:38:03 +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
b15665e041 serve http view from cached data and make cache refresh rate
configurable.  Should make it harder to attack the relay on http port.
2009-08-21 12:32:57 +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
e96becb05f variable name change only (for clarity) 2009-08-13 12:59:55 +00:00
ehouse
acbf8180ef add missing lock(); track and display uptime of daemon child as well as parent 2009-07-31 12:56:04 +00:00
ehouse
503db9cc6f up copyright 2009-07-30 12:54:17 +00:00
ehouse
8be31357ad track per-cref lifetime and display it via http 2009-07-28 05:41:15 +00:00
ehouse
8284799abe Fix crashes resulting from deleting cref instances in one thread while
another wanted to operate on them.  The root problem is that you can't
dispose of a mutex while somebody's blocking on it.  So now the
locking mutexes live inside the cref class.  When the lock owner
realizes the cref needs to die, it sets a flag and it's moved to a
recycled list.  A thread blocking on the mutex will then get it, but
checks the flag and releases it immediately if it's being recycled.
(Also improve the http interface a bit.)  With these changes I've run
31K (and counting) games against the relay without a crash or deadlock
(using sim_real.sh.)  The main problem that remains is that sometimes
two games using the same cookie wind up with two crefs (and so never
connect.)
2009-07-28 05:15:26 +00:00
ehouse
c5e73fd725 Add to http display number of games currently being hosted. 2009-07-13 03:01:22 +00:00
ehouse
2ef16d44ca Include number of games played in html output; don't report closed
sockets found while reporting closed sockets (to avoid deadlock);
remove sockets from crefmgr's map when closing them so new connections
using same (re-used) socket aren't treated as belonging to open games.
2009-07-06 01:50:51 +00:00
ehouse
9a8abb770d in web console list hosts present rather than just the count 2009-02-28 19:35:32 +00:00
ehouse
3bf116c936 Add an http interface (read-only web console). 2009-02-28 16:15:59 +00:00
ehouse
644dc3b5ad detect duplicate initial connect packets by checking what socket they're on. 2009-02-07 18:17:17 +00:00
ehouse
1ac4ef3bc6 Attempt to detect connections that are duplicates by checking if that
socket is already in a connection.  This doesn't seem to always work,
and I may be leaking cref instances when it does, so needs debugging
still.
2009-02-01 16:00:20 +00:00
ehouse
ea6fff8f28 replace int with bool where appropriate; fix to compile with newer g++ 2008-12-30 05:13:30 +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
b31cb6612b call shutdown on cref rather than deleting it; wrap mutex actions with
debugging logfs like those in mlock.h.
2005-10-30 05:16:35 +00:00
ehouse
deb0a2d265 shutdown in response to SIGINT 2005-10-23 15:49:48 +00:00
ehouse
74b6ccbd52 cleanup ctrl printing; repeat most recent command; cleanup internal names. 2005-10-16 01:19:25 +00:00
ehouse
a8352fa745 fix leak; move heartbeat timer into crefmgr, and only run it when
there are active crefs.
2005-10-15 16:30:10 +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
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
9ac04243b5 first checked in. works. 2005-09-02 06:35:25 +00:00