Commit graph

3727 commits

Author SHA1 Message Date
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