Commit graph

3935 commits

Author SHA1 Message Date
Eric House
211e9ded7f TIMEOUT needs to be bigger for small NGAMES values 2010-10-18 20:18:24 -07:00
Eric House
3648c22bd4 fix long-standing bug where initial messages were not getting deleted
and multiplying; log md5 sums of messages in debug build.
2010-10-18 20:17:44 -07:00
Andy2
9cfb302a2f don't populate room name; better that people see the hint 2010-10-18 06:48:26 -07:00
Andy2
db3c4da01f set a default value that actually exists 2010-10-18 06:47:31 -07:00
Andy2
b4c1710c66 remove strings dropped with prev change 2010-10-18 06:31:19 -07:00
Andy2
62d054cd46 default show-robot-scores to true; move background-check-frequency
within existing PreferenceScreen
2010-10-18 06:30:56 -07:00
Andy2
a2f0ec232a put back RestartTimer call inadvertently removed 2010-10-18 06:23:24 -07:00
Andy2
dda6e056a0 set summary from the array of use-visible values 2010-10-18 06:18:37 -07:00
Andy2
2d66913323 populate public rooms list as soon as checkbox set -- and mention
language and number of players in failure message
2010-10-17 21:13:14 -07:00
Andy2
56e83bfc1c trim leading and trailing whitespace from roomnames. If somebody has
two spaces between words those will still matter.
2010-10-17 20:45:48 -07:00
Andy2
6b7a92534a make default relay port 10997 (and change key so it'll apply for everybody) 2010-10-17 20:37:51 -07:00
Andy2
332ff27d8a use same string for both 2010-10-17 20:30:43 -07:00
Andy2
a58e74b70a add play game button at bottom of game config dialog. 2010-10-17 20:27:21 -07:00
Andy2
5c958eaadb deal with null socket (e.g. if in airplane mode); deal with new public
rooms format.
2010-10-17 20:18:24 -07:00
Andy2
1621e5932a give label different text from dialog title 2010-10-17 20:00:41 -07:00
Andy2
8972df7b88 add explanatory title to phonies spinner 2010-10-17 18:55:09 -07:00
Andy2
885bfe4779 remove values button. Seven buttons is too much. Add back when have
means of assigning priority so it only shows up when there's space.
2010-10-17 18:42:44 -07:00
Andy2
2cd0bf8c24 add singleline and selectonfocus for roomname edit 2010-10-17 12:45:34 -07:00
Andy2
2bfb26cded sleep (in thread) before closing proxy socket. This works around
problem where, on PRX_HAS_MSGS path only, device reading socket gets
EOF early though logging here confirms additional bytes have been
written.  Gross but effective.
2010-10-17 06:38:28 -07:00
Andy2
b63d730b53 compare languages rather than actual dict names so can switch dicts
mid-game.
2010-10-16 15:05:46 -07:00
Andy2
60e4c624e4 implement reply button; clear message edit field each time 2010-10-16 15:05:16 -07:00
Andy2
21afd79751 make send message first rather than last menuitem 2010-10-16 15:04:12 -07:00
Andy2
26b777acf8 don't post notification when results list returns empty 2010-10-16 11:01:12 -07:00
eehouse@eehouse.org
5d9989eb1b Merge branch 'relay_proxy' of ssh://xwords.git.sourceforge.net/gitroot/xwords/xwords into relay_proxy 2010-10-16 10:50:23 -07:00
Andy2
a82051739b move interface; add some logging. 2010-10-16 10:49:25 -07:00
Andy2
91e95eb48b fix string (which should not be hard-coded!) and use new class. 2010-10-16 10:48:59 -07:00
Andy2
02ea8b13e0 move this functionality into RelayReceiver 2010-10-16 08:08:12 -07:00
Andy2
737b146093 Receiver replaces Activity as target of alarms. This seems to prevent
flasing to the front when alarms fire which was causing all kinds of
grief.  But: not yet tested on device.
2010-10-16 08:07:48 -07:00
Andy2
cd1ce339ed fix off-by-one error in reading from cursor 2010-10-16 07:57:47 -07:00
Eric House
38ae2faacc don't nuke bad files along with good 2010-10-14 22:17:34 -07:00
Eric House
34df149046 include age of room with info returned for open public rooms 2010-10-14 22:16:21 -07:00
Eric House
e5c7f476ba get rid of microseconds in timestamps 2010-10-14 22:15:41 -07:00
Eric House
c92d59fa53 games can be started with multiple dicts; saving of successful games/logs optional 2010-10-14 05:59:45 -07:00
Eric House
f246178b8f Merge branch 'relay_proxy' of ssh://xwords.git.sourceforge.net/gitroot/xwords/xwords into relay_proxy 2010-10-12 19:18:21 -07:00
Eric House
40a7a1b5a3 cleanup; track checked rooms rather than checking each time seen 2010-10-12 19:17:42 -07:00
Eric House
0cf94dda8b fix frequent assertion failure that dates from when no messages passed
outside of ALLCOND state.  With this fix the test script is running
all games to completion if given enough time.
2010-10-12 19:16:46 -07:00
Andy2
a52c18522c use HashSet rather than relying on nesting (which I can't) to track
whether I'm running
2010-10-12 18:53:19 -07:00
Andy2
34428b3460 new Activity class 2010-10-12 18:28:05 -07:00
Andy2
82d5f21d54 extend subclass of Activity or ListActivity 2010-10-12 18:27:50 -07:00
Andy2
c37ad2d650 register self with RelayService to be called directly if running when
there's something to update.  Use handler to do this from non-UI thread.
2010-10-12 18:27:13 -07:00
Andy2
8e8c4f4d31 if GamesList is frontmost when we have relayIDs to update then just
call the interface it's registered.  Otherwise post notification.
2010-10-12 18:25:29 -07:00
Andy2
ad9a249042 new files. Subclass Activity and ListActivity to track whether we're
running (yeah, WTF, but that's what Android dev support says you have
to do!).  Special-purpose Activity to be the target of notifications
so I have more control on how to handle them.
2010-10-12 18:21:18 -07:00
Andy2
673c9858cb fire every 30 for testing 2010-10-12 05:24:23 -07:00
eehouse@eehouse.org
ddb8f508f9 Merge branch 'relay_proxy' of ssh://xwords.git.sourceforge.net/gitroot/xwords/xwords into relay_proxy 2010-10-12 05:23:04 -07:00
Eric House
0d1542ca9d tweaks to logging 2010-10-12 05:18:44 -07:00
Eric House
8011eeec2c cleanup; fix off-by-one bug with NAMES that was breaking runs with
four-device games; check before run that there aren't already waiting
games in db.
2010-10-12 05:17:32 -07:00
Andy2
b124a3f438 add every-five-minutes option; change 10-seconds debug option to 60 2010-10-11 06:54:02 -07:00
Andy2
392aeff7ad replace FLAG_ONE_SHOT with FLAG_UPDATE_CURRENT; seems to fix failure
of notification to fire.
2010-10-11 06:52:26 -07:00
Andy2
86b57526df show game name in title if not hidden 2010-10-11 06:47:33 -07:00
Andy2
e637a64d96 Change param signage to fix compiler warning 2010-10-11 06:20:30 -07:00
Andy2
56cd161d8b Pass list of relayIDs through activity to onNewActivity() added to
GamesList, and inval those list elements that now have messages
pending so they redraw.  And add static method to be called from there
to cancel the status-bar notification now that it's been acted on.
2010-10-09 21:44:42 -07:00
Andy2
6ad074182f make GamesList singleTop so notifications go to existing activity 2010-10-08 17:33:44 -07:00
Andy2
7d9c143d15 string doesn't need localizing 2010-10-08 17:32:51 -07:00
Andy2
76258f609a make sure game is still over before calculating final scores. Fixes
assertion failure in server.c.
2010-10-08 17:30:26 -07:00
Andy2
97d96add5e add stubbed-out strings 2010-10-08 06:53:41 -07:00
Andy2
e855b51491 use new DB api to build list of relayIDs to send; set summary DB field
and post notification on response.
2010-10-08 06:52:43 -07:00
Andy2
3bbbd65077 use same 1.5-safe layout on all devices; add elem (a text field for
now) to be shown when messages are pending; show it.
2010-10-08 06:47:46 -07:00
Andy2
6ce5f36133 add msgsPending field set from new DB column; add methods to set
column and to fetch relayIDs for games where it's not set, and to get
path for game based on relayID.
2010-10-08 06:46:10 -07:00
Andy2
d5eff5af21 new column to track whether game has pending msgs 2010-10-08 06:42:51 -07:00
relay
680b2f31b3 use pid to avoid permission problems for logfile in /tmp 2010-10-07 19:48:38 -07:00
Eric House
f2ad6d92b4 use full paths so pidof doesn't pick up instances of xwrelay launched elsewhere 2010-10-07 19:41:02 -07:00
Eric House
86d73392d5 track bytes sent in db; use defaults to init ctime 2010-10-06 21:45:05 -07:00
eehouse@eehouse.org
46ff3c3b68 Merge branch 'relay_proxy' of ssh://xwords.git.sourceforge.net/gitroot/xwords/xwords into relay_proxy 2010-10-06 05:22:10 -07:00
Andy2
cb4092bb39 make relayID a String rather than a byte[]; log result of pending
messages query to confirm working.
2010-10-06 05:21:19 -07:00
Eric House
6c5b279946 respect TIMEOUT, and kill all remaining processes before exiting 2010-10-05 20:58:29 -07:00
Eric House
a444786a28 reduce logging 2010-10-05 20:57:19 -07:00
Eric House
f0b05da131 reduce logging 2010-10-05 20:57:07 -07:00
Andy2
a78c4b304e custom class for pref 2010-10-05 18:39:00 -07:00
Andy2
df939249e4 fix caps and add too-long string 2010-10-05 18:38:46 -07:00
Andy2
861de8d592 call new method to start polling timer 2010-10-05 18:38:06 -07:00
Andy2
81fb934e4a new custom class for resetting polling timer on prefs change 2010-10-05 18:36:56 -07:00
Andy2
cd0d14b1bb new class will own setting summary for relay-polling frequency so don't do it here 2010-10-05 18:36:15 -07:00
Andy2
ae6edf4ace add static methods for starting timer. 2010-10-05 18:35:35 -07:00
Andy2
ed95d2e794 add proxy port to list whose values are displayed 2010-10-05 06:17:35 -07:00
Andy2
31f3cbc6c8 complete rewrite: use bash's new associative arrays to track games and
pids etc. so that a single process can manage starting and stopping
all games.  Fixes race conditions where a game would be killed after
finishing but before it'd sent out the message that would allow other
games to finish.
2010-10-04 22:16:58 -07:00
Andy2
a13bb34419 plug memory leak 2010-10-04 22:14:44 -07:00
Eric House
2e844d798f replace single db connection protected by a mutex with one connection per thread kept in thread-local storage. 2010-10-04 20:04:14 -07:00
Eric House
d9ca6f5e11 block TERM and INT from all but the main thread. (Pretty much untested; doesn't fix hang-on-SIGINT.) 2010-10-04 20:03:19 -07:00
Eric House
1ff4d67bc0 block TERM and INT from all but the main thread. (Pretty much untested; doesn't fix hang-on-SIGINT.) 2010-10-04 20:03:00 -07:00
Eric House
43bf3cd50f improve log statement 2010-10-04 20:01:00 -07:00
Andy2
fae8faa0be add stubbed-out Reply button to msg received dialog. 2010-10-04 18:59:44 -07:00
Andy2
1ed8e7a66c fix crash: can't call dialog from non-UI thread 2010-10-04 18:53:33 -07:00
Andy2
89f967a016 pass remaining reconnect params in case connName's missing from db.
Should only matter if the relay's db's been deleted.
2010-10-04 18:39:26 -07:00
Eric House
b3c7cb3711 start on sending chat messages. Doesn't even compile -- committing to get onto another machine. 2010-10-04 05:38:05 -07:00
Eric House
1e13e92deb support for receiving and displaying chat messages. Compiles but not tested. 2010-10-03 18:32:39 -07:00
Eric House
d35bc7d748 refuse to store more than four messages at a time for a single
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.
2010-10-03 18:18:15 -07:00
Eric House
14fd1f9023 add test code for chat feature: display incoming chat and send via
menu.  Sent message is hard-coded for now; should fix that.
2010-10-03 18:13:48 -07:00
Eric House
61b228f189 implement simple chat on top of current server-level protocol --
meaning it'll work on any tranport but relay doesn't know about it.
(If relay knew about it I could send a "shutting down for a minute"
message to every connected device, which would be cool.  But this is
easier.)  Written, BTW, enroute from Seattle with help from beer from
Chris in first class. :-)
2010-10-03 18:11:51 -07:00
Eric House
4a5de0a24c cleanup 2010-10-03 18:09:15 -07:00
Eric House
1f87379cd0 change default port 2010-09-29 07:37:26 -07:00
Eric House
1b93654f7e use stored procedure sum_array instead of C macro 2010-09-29 06:21:08 -07:00
eehouse@eehouse.org
d0797af6e5 Merge branch 'relay_proxy' of ssh://xwords.git.sourceforge.net/gitroot/xwords/xwords into relay_proxy 2010-09-28 21:11:17 -07:00
Andy2
f78b1747dd put up an alert when unable to find any public rooms 2010-09-28 18:58:05 -07:00
Andy2
0bfad7cd05 up timeout to 15 seconds. 2010-09-28 18:42:23 -07:00
Andy2
2610ef34ac move dict above connection settings since it provides a parameter 2010-09-28 18:38:47 -07:00
Andy2
978fa010f1 commented-out sleep positioned to give download progress time to come up. 2010-09-28 18:35:33 -07:00
Andy2
814f6887da put up a progress dialog while fetching public names that mentions
params passed.
2010-09-28 18:34:29 -07:00
Andy2
0b143efced add getLangName 2010-09-28 18:33:29 -07:00
Andy2
6b1dabd8e2 don't crash when public rooms list is empty 2010-09-28 18:32:43 -07:00
Eric House
bc65377cfd track device seeds in db. 2010-09-28 18:06:50 -07:00
Eric House
a6f5ea5f4a sync after saving. Seems to improve recovery from TERMs sent by test scripts. 2010-09-28 18:06:05 -07:00
Eric House
a89520a377 use __func__ 2010-09-28 18:04:31 -07:00
Andy2
953e4601b9 fetch public rooms using new class rather than hardcoding. With this
checkin game is possible based on public-room lookup.
2010-09-28 06:48:51 -07:00
Andy2
132321c9fd new AsyncTask subclass to fetch public rooms list from relay 2010-09-28 06:47:58 -07:00
Andy2
89d20578b8 new class to create socket for talking to proxy 2010-09-28 06:47:21 -07:00
Andy2
39827ec894 add new pref for relay's proxy/device port 2010-09-28 06:43:04 -07:00
Andy2
1de029f3f0 skip public rooms if full. (Should do this in the query....) 2010-09-28 06:42:01 -07:00
eehouse@eehouse.org
ac74cc36a5 Merge branch 'relay_proxy' of ssh://xwords.git.sourceforge.net/gitroot/xwords/xwords into relay_proxy 2010-09-26 20:25:30 -07:00
Andy2
986ac4413f parse reply to query for number of pending messages for games on
device.  Not doing anything with the info yet.
2010-09-26 20:25:00 -07:00
Eric House
ae53ce5ea9 Merge branch 'relay_proxy' of ssh://xwords.git.sourceforge.net/gitroot/xwords/xwords into relay_proxy 2010-09-24 20:19:50 -07:00
Eric House
1bfdd1978e move log directory away each time 2010-09-24 20:19:12 -07:00
Eric House
8f77886f72 make column name shorter 2010-09-24 20:18:20 -07:00
Andy2
14edbd7f18 implement setIsServer(). With this change I've been successful --
once -- having two games on the same device play against each other.
2010-09-24 18:49:34 -07:00
Andy2
31c594a06e everybody starts out as client by default, same as on linux 2010-09-24 18:48:52 -07:00
Andy2
63ac6542c6 add new action to be called when relay make me a client. Seems
necessary to get server_initClientConnection connection called when
all's in the right state.  It's not working consistently yet, though,
so may need changes.
2010-09-24 18:48:30 -07:00
Andy2
16001e61d0 image forgotten earlier -- for refresh public games list button 2010-09-24 18:46:14 -07:00
Andy2
4ea9ff8226 add server_reset and util_setIsServer to jni 2010-09-24 18:45:42 -07:00
Andy2
f7bad05390 send msg count query and print results 2010-09-24 05:51:42 -07:00
Andy2
b0c6e6da9c add db method to count messages for connName/hid pairs and handle
query using it.
2010-09-24 05:50:02 -07:00
Andy2
c3e1b243b6 add timestamp to msgs db and set it on adding new records. I will
likely need to add periodic culling on the server for games that will
never fetch their messages.
2010-09-24 05:46:30 -07:00
Andy2
35ff5a7835 exit on logdir being gone before grepping it 2010-09-23 06:41:37 -07:00
Andy2
c44324a32a log, for now as I've seen assertions failures suggesting a race, the
set of checked-out sockets at insert and remove time.
2010-09-23 06:34:18 -07:00
Andy2
40e1d29243 use new methods to store undeliverable messages in a db rather than in
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.
2010-09-23 06:32:57 -07:00
Andy2
74764a493b create the new db 2010-09-23 06:31:42 -07:00
Andy2
eee41377f4 new methods for storing/retrieving messages in new db. 2010-09-23 06:31:29 -07:00
Andy2
451ced44ba cleanup: shorter timeout; set aside games that finish correctly 2010-09-23 06:29:55 -07:00
Andy2
9a035c66ff add assertion 2010-09-23 06:28:13 -07:00
eehouse@eehouse.org
acb52d11dc Merge branch 'relay_proxy' of ssh://xwords.git.sourceforge.net/gitroot/xwords/xwords into relay_proxy 2010-09-23 05:34:43 -07:00
Andy2
85b4f3f075 move hostid assignment and tracking into db so it survives reboots and
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.
2010-09-23 05:33:27 -07:00
Eric House
82825365d4 Merge branch 'relay_proxy' of ssh://xwords.git.sourceforge.net/gitroot/xwords/xwords into relay_proxy 2010-09-22 05:46:10 -07:00
Eric House
659278448b changes to work against remote relay 2010-09-22 05:45:40 -07:00
Eric House
076b211cab tweak to allow to specify host/port for use against remote relay 2010-09-21 20:38:54 -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
e06baf566f get public rooms from the db rather than stubbing it out. 2010-09-21 06:54:47 -07:00
Andy2
be23e06b60 use read_packet to replace duplicate code 2010-09-21 06:38:43 -07:00
Andy2
e7b5923883 finish first pass at sending open public room names -- but with actual
list harvesting stubbed out.
2010-09-21 06:27:31 -07:00
Andy2
2ec67c8ed1 finish rq to work with current format; add to makefile 2010-09-21 06:26:49 -07:00
Eric House
4ad735124c add logging and assertions. There's a race condition in cref
recycling and may be one in tpool socket checking-out.
2010-09-20 22:11:13 -07:00
Eric House
b6ce74be1c add timeout after which all games are killed 2010-09-20 22:08:51 -07:00
Eric House
c671f2ab05 plug memory leak 2010-09-20 22:07:10 -07:00
Eric House
047f41b516 send cookieid as part of [RE]CONNECT_RESPONSE in addition to ALL_COND (where it's now redundant). 2010-09-20 22:06:35 -07:00
Andy2
0df651027f Merge branch 'android_branch' into relay_proxy
Conflicts:
	xwords4/relay/crefmgr.cpp
2010-09-20 19:55:53 -07:00
Andy2
bca8300495 changes for b16: version strings and changes summary text. 2010-09-20 19:48:52 -07:00
Andy2
ddedcee3eb remove commented out foo -- needed to save before prev submission. 2010-09-20 19:39:35 -07:00
Andy2
9b98d89722 add mimeType entry to data. This coupled with the right apache
AddType config means the browser doesn't get a chance to download
dicts, giving users one less way to get confused.
2010-09-20 19:38:26 -07:00
Andy2
0ac23458ba use constant 2010-09-20 18:42:43 -07:00
Andy2
a549ade1fa a bit more work on rc 2010-09-20 18:31:17 -07:00
Andy2
4e9d6e712e escape apostrophe -- new SDK requires it. 2010-09-20 06:18:53 -07:00
Andy2
15cd3af62a just a comment 2010-09-20 05:35:29 -07:00
Andy2
e1c99f53cd work on detecting duplicate packets and devices that have reconnected
on a different socket; print all present seeds for debugging.
2010-09-20 05:35:19 -07:00
Andy2
ac8891016f work on detecting duplicate packets and devices that have reconnected
on a different socket; print all present seeds for debugging.
2010-09-20 05:35:09 -07:00
Andy2
d199ec5168 account for possibility client apps won't exit on TERM 2010-09-20 05:33:58 -07:00
Andy2
84a26c2c1a more to ignore 2010-09-20 05:32:17 -07:00
Andy2
430b033ae0 a bit of progress on cmdline tool 2010-09-20 04:59:09 -07:00
Andy2
6d6ad96cde don't clear seed when changing roles from guest to host. 2010-09-20 04:56:19 -07:00
Andy2
00cdbc97d3 Install a no-op TERM handler at first then replace later with one that
just exits main loop.  Do cleanup/file saving on exit from mainloop.
Fixes occasional crash where TERM came in before we were setup to
cleanup.
2010-09-20 04:55:35 -07:00
Andy2
df1ec1628a replace killSocket(), which jumped right into crefmgr and could get
ahead of processing data arrived on the same socket, with EnqueueKill
that adds to same queue from which data's taken.  So if device dies
immediately after sending data there won't be a race between closing
the cref (if this is the last open socket) and handling the data.  I'm
still dying with assert fails when running 100 games at once, but much
less frequently
2010-09-18 08:47:56 -07:00
Andy2
a4913596db remove logging 2010-09-18 08:42:15 -07:00
Andy2
c5d113a8da remove _locked from name of method since it's not called when holding a lock. 2010-09-18 07:46:10 -07:00
Andy2
53b3d7c32f enque sockets in new object that contains type so later other events
(e.g. socket closes) can also be queued; track what sockets are
currently being handled so no two threads are ever processing events
on same socket.  This makes running 'NGAMES=50
./scripts/discon_ok2.sh' crash very infrequently rather than every
time, but the race condition in crefmgr remains.  Queuing socket
closes should help.
2010-09-18 07:44:14 -07:00
Andy2
54512b9e11 put logs in own dir 2010-09-18 07:35:16 -07:00
Andy2
eec07649a6 put logs in own dir; echo every time game ends successfully. 2010-09-18 07:35:02 -07:00
Andy2
9c8889b429 get rid of mutex guarding reconnect. There shouldn't be any need
since game slots are already assigned, and it's slowing down
reconnects in their race with kills.
2010-09-18 05:07:23 -07:00
Andy2
7e1066dbcc vary room names 2010-09-16 22:20:43 -07:00
Eric House
bb1e46fa81 Merge branch 'relay_proxy' of ssh://xwords.git.sourceforge.net/gitroot/xwords/xwords into relay_proxy 2010-09-16 20:13:54 -07:00
Eric House
d0e707a48e get started with test/cmdline app to query relay's new proxy interface. 2010-09-16 20:13:24 -07:00
Andy2
c5eef29bcc some suspicious crashes and subsequent reading say that multiple
threads can't share the same db connection.  So synchronize all
queries.  Multiple threads *can* access the db concurrently as long as
each has its own connection, so I could add connections to the tpool
threads.  But this will probably be performant enough for the first
10K simultaneous users. :-)
2010-09-16 20:08:32 -07:00
Andy2
1490b2def9 simplify state table, getting rid of a bunch of states: we never leave
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.
2010-09-16 18:59:56 -07:00
Andy2
76e7459a6d various improvements, e.g. random sleeps before and after starting 2010-09-16 18:56:34 -07:00
Andy2
50c387d75e remove players from db as well as runtime when ack times out 2010-09-16 06:49:35 -07:00
Andy2
ca6039e890 new test script attempting to mimic real-world usage 2010-09-16 05:39:50 -07:00
Andy2
25c1824c45 fix broken assertion and add missing state transitions to fix crashes. 2010-09-16 05:39:25 -07:00
Andy2
2b702b48d6 need to clear CID of record in DB when killing corresponding in-memory
cref or reconnect will fail.
2010-09-16 04:47:17 -07:00
Andy2
452e3fc86b timeout in milliseconds instead of seconds 2010-09-16 04:46:04 -07:00
Andy2
fa50bd00f1 timeout final scores alert 2010-09-16 03:42:57 -07:00
Andy2
d1a9c3962a rename cookie->room in db; reposition columns. 2010-09-16 03:30:24 -07:00
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
0d7165f881 add ability to run gtk from newrelay.sh. Trying to run 50 instances
crashes the relay as ACKs take too long to come back.
2010-09-16 01:44:54 -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
Eric House
9fc39a55ed add params to set public-room-related booleans; add timeout option on
modal dialogs so gtk version can run unattended.
2010-09-14 21:13:45 -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
Andy2
86a1e943ca make dict settable too 2010-09-12 03:53:39 -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
eehouse@eehouse.org
0b46455044 Merge branch 'relay_proxy' of ssh://xwords.git.sourceforge.net/gitroot/xwords/xwords into relay_proxy 2010-09-12 02:34:20 -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
8908ca5b1d ignore new test script's log files 2010-09-11 01:40:05 -07:00
Andy2
1cd2d542f7 new test script 2010-09-11 01:39:20 -07:00
Andy2
d5f2a72227 note that file's out-of-date 2010-09-11 01:28:04 -07:00
Andy2
463e9c3ccf pass langCode in reconnect case too 2010-09-11 01:23:39 -07:00
Andy2
bd71a15ddc turn off heartbeats on client side 2010-09-11 01:23:13 -07:00
Andy2
dc957e1a92 add match test on language code and number of players 2010-09-10 13:45:40 -07:00
Eric House
54611df679 nuke unused variable 2010-09-10 05:55:59 -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
b3d3673dc9 read the langcode out of dict and into common struct 2010-09-10 01:57:22 -07:00
Andy2
2ee9031fdc langcode belongs in connect, not reconnect, message 2010-09-10 01:56:58 -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
34a94f23a0 fix error message to not specify host or guest 2010-09-10 01:24:42 -07:00
Andy2
f7c5ff619d turn off heartbeats 2010-09-10 01:24:03 -07:00
eehouse@eehouse.org
a79f50053b Merge branch 'relay_proxy' of ssh://xwords.git.sourceforge.net/gitroot/xwords/xwords into relay_proxy 2010-09-09 04:21:02 -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
Eric House
a64b67a54f reduce amount of logging 2010-09-08 20:17:32 -07:00
Eric House
f8ca35f9b6 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:16:57 -07:00
Andy2
01fe388f85 remove logging accidentally checked in 2010-09-03 06:40:17 -07:00
Andy2
e6545d8d57 set and save new booleans, etc. Relay params UI seems to work now
except for listing public rooms (still hard-coded)
2010-09-03 06:39:46 -07:00
Andy2
b742c7dbb7 add new booleans to relay address record around public rooms 2010-09-03 06:38:46 -07:00
Andy2
e20c63f38c move toward the UI I want: show public room browser or edittext for
new room name depending on checkbox, etc.  Still not fully wired.
2010-09-02 05:46:35 -07:00
Andy2
0b91e9634e save/restore new dictLang field; up stream version 2010-09-01 06:51:44 -07:00
Andy2
c6c1a93de5 copy new dictLang field java<->c 2010-09-01 06:51:09 -07:00
Andy2
6d7ff11dcc add and set new field, dictLang 2010-09-01 06:50:33 -07:00
Andy2
73746e3664 first cut at relay config section, inline this time, with refresh
button and make-public checkbox.  Neither wired up nor hidden in
non-networked case.
2010-09-01 06:49:01 -07:00
Andy2
cad2854d08 fix bug by always enabling set of widgets for local player in case
prev invocation of dialog hid it.
2010-08-31 06:21:46 -07:00
Andy2
784b5c8cdf tweak strings 2010-08-31 06:20:48 -07:00
Andy2
4d1d7ae7ce put space between "Player 1" and "(robot)" 2010-08-31 06:20:29 -07:00
Andy2
9367251b33 lots of changes, still needing cleanup and a bit of debugging, to
simplify game settings dialog and remove role: a game is now
standalone or not.  Games will be matched on the relay (or over BT, I
assume) based on how many players they provide vs. need -- and other
settings like dictionary
2010-08-31 05:43:41 -07:00
Andy2
adf9c28e0d make games list item as tall without delete button as is with. 2010-08-30 20:44:01 -07:00
Andy2
785ae531db add language name to dict names in GameConfig's menu too 2010-08-27 06:26:25 -07:00
Andy2
092236b0dd cleanup; do formatting inside DictLangCache 2010-08-27 06:25:56 -07:00
Andy2
40e266dda0 move lang strings into cache and add method to get 'em 2010-08-26 18:43:59 -07:00
eehouse@eehouse.org
ecd0280353 Merge branch 'android_branch' into relay_proxy 2010-08-26 18:36:55 -07:00
Andy2
5ddbef7829 update for b15 2010-08-26 18:33:22 -07:00
Andy2
0f3867b995 up constants/version for beta 15 2010-08-26 18:22:18 -07:00
Andy2
d1f6057987 fix stupid typo that meant crosshairs started on top row was only
three cols wide at first.
2010-08-26 18:20:24 -07:00
Andy2
0313421634 Add new class to cache lang codes for dicts to prevent expensive
operation of loading them each time.  Will have other uses later.
2010-08-26 18:14:14 -07:00
Andy2
40d8aede88 use new jni method and array of names to append language to name of dict 2010-08-25 06:34:54 -07:00
Andy2
51e2c61962 add array mapping lang code (the proprietary code stored in dicts) to
language name.  (Names should be translated.)
2010-08-25 06:34:29 -07:00
Andy2
cf6d8efb29 new jni method to get lang code. Takes a dict's raw bytes and builds
a dict object just to fetch the code, which is pretty inefficient, so
caching should be added later on the java side.
2010-08-25 06:33:16 -07:00
Andy2
4208c33ecf make lang code support non-conditional 2010-08-25 06:31:38 -07:00
Andy2
3dba8ba13b Fix bug reported by user: if robot finishes a search but fails to find
a move it's still done with its turn and must trade or pass.
2010-08-24 18:38:12 -07:00
Andy2
3b52f7bbd0 don't connect proxy unless there's at least one relay game 2010-08-23 18:53:11 -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
b586fa1a34 add preference controlling how often proxy connects to relay. Still
need to add way to change timer when interval pref is changed and
other cleanup.
2010-08-23 18:39:47 -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
48ac79be51 GamesList starts a repeating alarm that invokes a new activity that
launches the service.  Service can now do a single check with the
relay, notify if needed, and exit (but doesn't yet.)
2010-08-19 08:45:18 -07:00
Andy2
25e7889c28 checkpoint: add service that's launched at app start and spawns a
thread that stops itself immediately.  Eventually that thread will
check the relay for pending moves, put up a notification offering to
open the game that has moves pending, and schedule itself to run again
later before stopping itself.
2010-08-19 07:47:11 -07:00
Andy2
019da83d60 meant to check this in 2010-08-12 06:42:59 -07:00