Andy2
b25579b893
greatly simplify state machine for connections. Now (with DEVACK=20
...
on conf file) newrelay.sh will complete running 50 4-device gtk games.
Haven't tested reconnect case which I almost certianly broke.
2010-09-16 01:53:43 -07:00
Andy2
06c8fdc67f
stop tracking seeds separately until have a use for 'em separate from
...
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.
2010-09-16 01:13:26 -07:00
Andy2
a870cac86d
break connect and reconnect into separate paths to simplify. Be
...
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.
2010-09-15 14:05:51 -07:00
Andy2
8961910263
field name change
2010-09-15 14:03:59 -07:00
Eric House
b8a431cf01
fix bug in sql statement
2010-09-14 21:28:18 -07:00
Eric House
54d268b718
pass through to database whether room is public
2010-09-14 21:20:11 -07:00
Eric House
e3053370d0
add cmd to build the database and main table
2010-09-14 21:18:04 -07:00
Eric House
ddcc338ed7
don't break out of loop without unlocking mutex
2010-09-14 21:16:16 -07:00
Eric House
56a920740a
remove unused funtion declaraion
2010-09-14 21:15:24 -07:00
Andy2
3b5b5f0241
factor dbmgr code; add and call method to zero CIDs on boot.
2010-09-15 01:14:28 -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
f8c1c016cc
remove special-case states and handling of first connect; track number
...
of players sought in the cref itself, adding in constructor, and not
in HostRec instances. This is cleanup with no behavior change.
2010-09-13 13:49:13 -07:00
Andy2
100ed8532f
timestamp records on creation
2010-09-12 05:04:52 -07:00
Andy2
ded6e22180
do finding of open games using database rather than cref list, which
...
requires updating the number of players when new devices join. Drop
requirement that cid be unique.
2010-09-12 04:49:03 -07:00
Andy2
663551fcb5
improve db, adding uniqueness contraints. Pass in connName so can
...
meet that constraint. Figure out next cid using a query at startup.
2010-09-12 03:57:23 -07:00
Eric House
c1da64b96a
instantiate and use the new dbmgr class
2010-09-11 19:45:04 -07:00
Eric House
87de53cf96
add new class to interface with postgres database in an experiment to
...
simplify things by using a db to survive a crash/reboot. So far (with
next checkin) manages to update a db. Next need to do queries instead
of searches through in-memory data.
2010-09-11 19:44:37 -07:00
Andy2
54d49d450a
add back state and table entries to get rid of an unused cref.
2010-09-11 01:40:40 -07:00
Andy2
463e9c3ccf
pass langCode in reconnect case too
2010-09-11 01:23:39 -07:00
Andy2
dc957e1a92
add match test on language code and number of players
2010-09-10 13:45:40 -07:00
Andy2
e60495ff93
read, pass, store and display langCode. Not yet used to route
...
connections to crefs.
2010-09-10 01:59:37 -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
Andy2
f7c5ff619d
turn off heartbeats
2010-09-10 01:24:03 -07:00
Eric House
89e7a506a4
reduce amount of logging
2010-09-08 20:28:14 -07:00
Eric House
90d505abea
call accept() in main thread rather than in thread proc to fix
...
long-standing bug where main thread kept finding socket to be readable
and forking new threads to call accept() on it and then block forever.
2010-09-08 20:24:36 -07:00
Andy2
33d60452a3
fork a thread to handle proxy connects. Later may want to use thread
...
pool as for game threads.
2010-08-23 18:52:52 -07:00
Andy2
a34ccb424f
device now passes list of "relayID"s, consisting of connName plus
...
device id, to relay, one for each stored game that's communicating via
the relay. Relay parses out each relayID. Next relay can use these
to look up whether messages are available and reply with that, and
device can put up a notification.
2010-08-22 12:16:57 -07:00
Andy2
56b6a425e2
proxy now writes one byte to relay and reads one byte reply.
2010-08-19 18:34:28 -07:00
Andy2
019da83d60
meant to check this in
2010-08-12 06:42:59 -07:00
Andy2
416b379781
add second class of socket to be listened on, meant for per-device
...
rather than per-game connection, and when adding connected sockets to
active set track the type.
2010-08-12 06:42:33 -07:00
eehouse@eehouse.org
3b7abc2a31
Merge branch 'android_branch' of ssh://xwords.git.sourceforge.net/gitroot/xwords/xwords into android_branch
2010-07-29 21:13:00 -07:00
Eric House
e857b01783
ignore logs and core files
2010-07-29 21:07:20 -07:00
Eric House
d7a3795355
add static decl
2010-07-29 21:04:33 -07:00
Eric House
d7d2a7523b
kill cref when in bad state.
2010-07-29 19:46:52 -07:00
eehouse@eehouse.org
13ecb2f929
Merge branch 'android_branch' of ssh://xwords.git.sourceforge.net/gitroot/xwords/xwords into android_branch
2010-07-29 05:41:48 -07:00
Eric House
b170a04dec
drop duplicate [re]connect packets before they enter the state
...
machine. Fixes problems where crefs get stuck in the
XWS_CHK_ALLHERE_2 state. Still should probably kill a cref where
there's no state table entry.
2010-07-28 22:21:01 -07:00
Eric House
f70b9e1d10
use constructor to save some code; no behavior change
2010-07-28 20:17:54 -07:00
eehouse@eehouse.org
958ec15a19
Merge branch 'android_branch' of ssh://xwords.git.sourceforge.net/gitroot/xwords/xwords into android_branch
2010-07-27 21:32:17 -07:00
Eric House
ad1be65236
Merge branch 'android_branch' of ssh://xwords.git.sourceforge.net/gitroot/xwords/xwords into android_branch
2010-07-27 20:47:42 -07:00
Eric House
b335151172
log when no event pushed while adding players -- this may be how state machine is getting screwed up
2010-07-27 20:47:04 -07:00
Andy2
51ffdce185
comment out pthread_create failure log; seeing it too often and it's
...
just for the web view.
2010-07-26 18:37:44 -07:00
Andy2
f05bfcb3d8
log when dropping message that would mess up cref player counts
2010-07-16 06:23:20 -07:00
Eric House
a52fc5a4fd
don't call removeSocket when none was added
2010-07-15 18:21:32 -07:00
Eric House
8e5abb189b
add mutex for reconns too; log socket and ip addr connecting on it
2010-07-15 18:14:44 -07:00
Eric House
5ea1f3b470
list newest crefs first
2010-07-15 18:13:01 -07:00
Eric House
78f965b979
replace asserts that have been firing on integrating reconn events
...
with dropping the reconn messages; move log of state table lookup failure
into cref so cref id can be included
2010-07-14 21:32:19 -07:00
eehouse@eehouse.org
f9d8df8cea
don't track xwrelay.conf so local changes don't show as local mods
2010-07-14 06:29:50 -07:00
Andy2
41f8f574b1
use git describe for version info/stamp
2010-07-07 20:26:25 -07:00
Andy2
5365ea4f4e
fix crash when empty string given on ctrl port
2010-07-07 18:59:48 -07:00
Eric House
6456165a92
replace svnversion with gitversion.sh
2010-06-05 07:27:14 -07:00