Commit graph

149 commits

Author SHA1 Message Date
Eric House
0ac5d6d9e2 don't send more than three unanswered chats per boot -- to avoid
filling up the queues in a way that doesn't reflect real use.
2013-07-02 18:30:23 -07:00
Eric House
dd48cea912 don't log string before it's initialized 2013-07-02 07:26:32 -07:00
Eric House
9fca3792cf don't pile on chat messages when relay isn't even connected: it's an
unfair test that doesn't duplicate what users will likely do.
2013-07-02 05:53:58 -07:00
Eric House
195f873ab0 tweak logging 2013-06-30 07:37:35 -07:00
Eric House
1a73ab26ac tweak logging 2013-06-28 20:33:27 -07:00
Eric House
5612bb000b quick hack to allow testing intermix of chat with normal moves 2013-06-24 18:37:49 -07:00
Eric House
c8f584dad2 don't listen on stdin if it's been closed 2013-06-10 06:15:36 -07:00
Eric House
72a78100b1 fix compile error in non-debug version 2013-05-27 16:18:11 -07:00
Eric House
ffa983db94 use pipe to quit from signal handler since calling g_main_loop_quit()
doesn't work with more recent glib versions (and has always been a bad idea)
2013-05-24 21:19:20 -07:00
Eric House
c4df31892e Fix occasional infinite loop of devices sending and receiving the same
message over and over when getting updated by GCM.  The problem
occurred when one device had an un-ACKable initial message still in
its queue.  I call resendAll a lot, which caused that message to get
resent to the other game which then replied without being able to ACK
it so it remained to be sent again.  This would continue until users
moved forward in the game.  The fix is to add a backoff timer to
resendAll() so that it can't loop.  The timer is reset when an ackable
and new message is received, meaning there's been a change in what's
available to resend.  And since users calling resendAll manually
expect it to do something, add a force param that ignores the backoff.
seems to fix the problem (but needs a lot of testing.)
2012-11-13 21:25:03 -08:00
Eric House
093fc4d1fa cleanup 2012-11-13 07:23:07 -08:00
Eric House
2908802017 try to make linux client mimic Android a bit better in saving after
any network activity so messages get acked more quickly.
2012-11-13 06:15:36 -08:00
Eric House
aec03fc572 When a game's consumated and guest discovers it isn't using the same
dict, give chance to switch, and to download if required.  Because of
the way the JNI thread works, and JNI's requirement in general that
env instances match up (e.g. dicts must be destroyed in the same
thread that creates them), substituting into a live game is too hard.
So the game's saved with its new dict and then reloaded.
2012-10-24 07:17:21 -07:00
Eric House
e90c5ee94f pass index of resigning player into util_notifyGameOver. Not yet
passed into java.
2012-10-09 05:31:12 -07:00
Eric House
968340f665 Fix release-build warnings that new compiler flags. 2012-10-07 11:43:50 -07:00
Eric House
fd9b9f85e2 make util_hiliteCell conditional, and remove from android where it
wasn't used anyway.
2012-10-05 18:51:32 -07:00
Eric House
6ddd4a61c1 fix compile errors (mostly unused variables) found by gcc on latest
Ubuntu (12.04).
2012-09-25 07:28:02 -07:00
Eric House
140c982d41 merge from android_branch 2012-09-24 07:39:44 -07:00
Eric House
0ccc2331b5 address bug where message was getting ACK'd by a device that failed to
save what it had ACK'd leaving the game permanently broken.  Do that
by adding a new method game_saveSucceeded() called after the client
claims to have committed bytes returned by game_writeToStream() to
disk.  In that method comms updates the value it'll use in subseqent
ACKs.
2012-09-10 07:31:45 -07:00
Eric House
95a7b14a3a transmit dict's md5sum along with name in initial message from host to
guest.  On guest, pass that sum into client code along with names so
the appropriate tests can be done and corrections taken.
2012-09-08 20:23:48 -07:00
Eric House
270a19f3aa Revert "first of a set of changes to communicate to clients dictionary being"
This reverts commit b7a0f1489b, which I didn't mean to check in on this branch.
2012-09-03 21:34:51 -07:00
Eric House
ea4d805d5f first of a set of changes to communicate to clients dictionary being
used by server.  Clients need to care if e.g. the server's disallowing
phonies based on its dict.  Can only be sent if client is of latest
version.  In that case, common code calls into new util function.  In
future changes, BoardActivity's implemention of the callback will need
to check if the server's choice of dict is available, and if not offer
to download it.  Once it's available, will want to install it.
2012-09-03 21:33:46 -07:00
Eric House
b7a0f1489b first of a set of changes to communicate to clients dictionary being
used by server.  Clients need to care if e.g. the server's disallowing
phonies based on its dict.  Can only be sent if client is of latest
version.  In that case, common code calls into new util function.  In
future changes, BoardActivity's implemention of the callback will need
to check if the server's choice of dict is available, and if not offer
to download it.  Once it's available, will want to install it.
2012-09-03 21:29:21 -07:00
Eric House
d25916ae5f protect sqlite code with compile-time flag so easier to disable. 2012-07-29 08:37:08 -07:00
Eric House
08e5fbdcc2 add ability to open game in sqlite3 DB from an Android phone. It's
read-only now: changes are not saved.  But it works!
2012-07-26 20:44:33 -07:00
Eric House
0b1a9a67fe add param to server_handleUndo to prevent it from undoing all moves in
robot-vs-robot game, which is the wrong thing to do during a test
simulating play.
2012-05-24 22:25:30 -07:00
Eric House
cd89885cd2 add new periodic (one-second) timer, and commandline option that sets
what percent of the times that timer fires will result in a move being
undone.  Will be used to interject random out-of-order undos into
games played for testing.  (Currently the tests fail when this is
enabled; I need to fix that.)
2012-05-23 19:58:03 -07:00
Eric House
3a54aa0ebc add util_informUndo() that gets called, and puts up a dialog, after
remote device has performed an undo on a committed turn.
2012-05-14 07:01:02 -07:00
Eric House
64199c4e64 Merge branch 'android_branch' into android_bt 2012-05-05 11:08:03 -07:00
Eric House
44a6653166 add passthrough of params present in gtk but not curses 2012-05-05 09:24:41 -07:00
Eric House
d59b19514b Merge branch 'android_branch' into android_bt 2012-05-03 21:44:35 -07:00
Eric House
09f9038cff add option to have robot choose to trade tiles a configurable percent
of the time.  Meant to increase automated test coverage of trades.
2012-05-02 20:14:42 -07:00
Eric House
79a897b428 fix assert (but still leaking) 2012-02-09 05:16:32 -08:00
Andy2
2a34cd1e05 remove second param from server_do() -- it doesn't work anyway. 2011-12-21 18:45:05 -08:00
Andy2
d37424ad7f Merge branch 'android_branch' into send_in_background
Conflicts:
	xwords4/linux/linuxutl.h
2011-11-21 22:18:52 -08:00
Eric House
8a51d5f3e4 fix race condition that was breaking tests: when one device sends two
messages they must be handled by the relay in order.  So modify linux
client to build a single packet of all messages sent instead of
letting rq sent each on a separate socket.  The relay would give the
sockets to different threads and sometimes the wrong one won.  Will
need to make sure the android code's doing the same thing (it appears
to be), or perhaps make the coalescing code common so I only debug it
once.
2011-11-17 19:56:36 -08:00
Andy2
210c59ef9b move bonus square values into model: add API to set an array, and API
to query model for values.  Now everybody else queries new model API
rather than client via util_getSquareBonus(), model uses its internal
values if present otherwise falls back to util_getSquareBonus(), and
internalizes the array as part of the game.  Now it should be easier
to have different bonus patterns and to have them exchanged as part of
network game init.
2011-11-16 19:01:11 -08:00
Andy2
379e5f1d96 use actual rather than max possible board dimensions to apportion
space, fixing crashes when max upped to 32.  Will still fail as actual
size approaches that number.
2011-11-14 20:18:09 -08:00
Andy2
2492e7cfc5 Merge branch 'android_branch' into send_in_background
Conflicts:
	xwords4/linux/cursesmain.c
2011-11-13 17:10:46 -08:00
Andy2
d479b2b979 use timeout rather than idle. Sometimes (due to bug?) curses app is
too busy ever to fire idle proc.
2011-11-10 06:51:05 -08:00
Andy2
8d228ae190 turn on face-up tile picking for Android (though there's no prefs UI
to enable it for a game yet).  In common code, break pick tile utils
method in two, one for blank and the other for tray tiles.  In java,
implement dialog for picking the tiles.  Works, though is a bit clumsy
to have the dialog come and go after every pick.  Better would be a
dialog that stays up and accumulates picks -- but it'd have to know to
reduce the set of tile choices as letters are chosen.  This'll do for
now.
2011-10-28 22:15:56 -07:00
Andy2
4eee7f8aa7 Pass selected tiles into new util function, and from there into java
world, so confirming query can include them.
2011-10-19 18:34:26 -07:00
Andy2
f41d3c27e6 Merge branch 'android_branch' into send_in_background
Conflicts:
	xwords4/common/server.c
2011-10-19 06:23:16 -07:00
Andy2
b31e829414 Remove file-format differences between debug and non-debug versions.
Fix curses to compile non-debug.
2011-10-18 18:52:37 -07:00
eehouse@eehouse.org
471a9d988d Merge branch 'android_branch' into send_in_background 2011-10-05 07:10:52 -07:00
Andy2
dc20b04a4c remove unused param (on the C/jni side) 2011-10-04 18:54:53 -07:00
eehouse@eehouse.org
82615f409b Merge branch 'android_branch' into send_in_background 2011-10-04 06:49:19 -07:00
Andy2
77b9fa11a5 improving lookup words experience: replace
util_userQuery(QUERY_ROBOT_MOVE) with new util_informMove(), into
which the number of words formed and the words themselves are passed.
The process of consing up the score explanation was already passing
over the model, so storing the words is very little effort, and will
save a call back into the model where the user actually wants to do
the lookup.
2011-10-02 16:21:09 -07:00
Andy2
22382b3a19 reduce logging some more 2011-09-30 18:11:08 -07:00
Andy2
c992c65015 changes to support automated testing of background messages sends: new
param gives name of Unix domain socket to be used to accept connection
that passes in messages from relay and receives messages to be sent
back.  Works once but needs debugging....
2011-09-30 06:32:21 -07:00