Commit graph

747 commits

Author SHA1 Message Date
Andy2
ecaca66a96 move turn-in-range assert to where it won't fail 2011-07-19 06:17:50 -07:00
Andy2
5deb68486c add a ton of asserts (no code change otherwise) 2011-07-18 06:44:17 -07:00
Eric House
febb640049 add name of remote player to notification that remote player moved.
And remove a few dead strings.
2011-07-15 18:13:55 -07:00
Andy2
f4a11d2be5 ignore commit turn request when player has 0 tiles. This catches,
awkwardly, the case in a networked game where a player runs out of
tiles in his turn but the server hasn't responded yet to kill the
game.  It remains the player's turn and he can make lots of 0-point
moves while waiting.  (Making it the next player's turn would be the
right thing to do if that player were always on a different device.)
2011-07-12 07:13:21 -07:00
Andy2
42e7a113b9 tweak logging 2011-07-12 07:09:40 -07:00
Andy2
f3ab40519d add new error message to DEBUG-only printing code. 2011-07-06 06:47:56 -07:00
Andy2
4b75174170 save stateAfterShow as part of serialized game state. Fixes problem
where games with more than two devices would hang because server.c
code was dropping messages that comms.c code thought were good and so
ACK'd preventing them from being sent again.  They were being dropped
because the game was in the wrong state after displaying a move-made
dialog because the state it was to move to after doing that display
had not been saved.
2011-07-04 12:51:00 -07:00
Andy2
0eec455119 change one return type; improve logging 2011-07-04 12:46:48 -07:00
Andy2
8904f37e1a force XW_STATE to be 1 byte. 2011-07-04 12:45:51 -07:00
Andy2
a96dfb57f6 drop-packet test got an assert because we assumed the effects of a
dropped packet.  Instead, now treat the connection as broken and
restart.
2011-06-27 18:30:52 -07:00
Andy2
e886a1aefe lots more changes -- another snapshot, this, rather than stuff
carefully polished and reviewed.  Shows progress, though, in getting
through tests.
2011-06-23 07:12:50 -07:00
eehouse@eehouse.org
484bb295d0 Merge branch 'android_branch' into android_invite 2011-06-06 22:08:49 -07:00
Andy2
1bc70f2c8f google reports a crash in warnIllegalWord that only makes sense if I'm
passing a 0-length array of bad words.  That in turn suggests a
screwup where a move's rejected for some reason other that a word not
being in the dictionary.  This is all supposition, and all stuff
that'd be caught by asserts in a debug build, but: when there are no
bad words don't report them -- even if the move's rejected.
2011-06-06 20:33:10 -07:00
Andy2
a29f08616e what I meant to check in. 2011-05-19 22:53:58 -07:00
Andy2
89911ecaa4 add server_getMissingPlayers to return a bitvector indicating players
not yet received on device.  Meant to be included in summary.  I'm not
happy with how much code it took to figure this.  I don't know
server.c all that well any more.
2011-05-19 22:48:21 -07:00
Andy2
4c5c435fb5 add new parameter so client always gets notified on connection
including how many players are still missing.
2011-05-19 05:51:00 -07:00
Andy2
3b3a822dcc a gmae may have several dictionaries in several places, but all should
share the same language.  So pick one to send to draw_dictChanged
rather than sending all (some of which may be null.)
2011-04-28 18:40:44 -07:00
Andy2
af08b2e5b0 add a couple of asserts 2011-04-25 20:17:54 -07:00
Andy2
4e7570020f remove mistaken (I think) assert 2011-04-20 22:13:44 -07:00
eehouse@eehouse.org
5a21aea2e5 Merge branch 'android_branch' of ssh://xwords.git.sourceforge.net/gitroot/xwords/xwords into android_branch 2011-04-13 06:58:58 -07:00
Eric House
3cc105da0b add ability to dump board (model) as text, protected by ifdef that
will likely only get set on Linux.  Uses lower-case to designate
blanks.  For that and maybe string size assumptions is very broken for
non-ascii languages, including Spanish.
2011-04-13 06:45:22 -07:00
Eric House
92ac25ed3f don't require MAX_NUM_PLAYERS==4 2011-04-12 22:17:45 -07:00
Andy2
002bb40a09 report counts/values using language rather than dictionary name. To
support that, pass lang name from java into jni.
2011-04-11 18:55:42 -07:00
Andy2
96254ad8b5 when opening saved game, notify draw of per-player dicts as well as of
a single game-wide one.
2011-04-11 06:39:31 -07:00
Eric House
c77d3039cc add XP_FREEP. Should be no change in behavior. 2011-04-07 18:07:45 -07:00
Andy2
3b7b4802a9 add ability to specify, track and use separate dictionaries for each
player.  Works for gtk client.  Compiles for Android but there's no UI
yet to specify more than one dict.  Management of dupicate dicts
without duplicating memory -- refcounting -- will be up to the
platforms.
2011-04-01 19:57:10 -07:00
Eric House
67a3349919 Don't move arrow on pen-up if pen-down was in a different cell. 2011-03-29 18:13:38 -07:00
Eric House
f4ea54c30b cleanup; no behavior change 2011-03-29 18:12:55 -07:00
Andy2
d9bb5197d4 Add two new menus to be available only when in trade mode. Hide and
show them and another group depending on whether trading at the time.
To make that work, replace the individual calls made to dis/enable
toolbar buttons with a single jin call that takes a struct full of
booleans and make that struct available in BoardActivity where menus
are hidden/shown.  Remove the individual calls from the jin interface.
2011-03-10 18:13:56 -08:00
Andy2
aa88503cfb have board_canHint() return false when trade in progress. 2011-03-08 07:40:38 -08:00
Andy2
828bd9aa4c fire user error rather than committing turn when trade attempted
without any tiles selected.
2011-03-07 06:28:43 -08:00
Andy2
d2fda267e5 fix assertion failure that happened when I changed whether remote
scores were shown mid-game.  If the value's not as expected just don't
show the score.
2011-02-18 17:43:01 -08:00
Eric House
984227955b make two versions the same since there's been no release since first was added. 2011-02-09 22:17:18 -08:00
Andy2
c56f0b5cea Save cached prev move explanation as part of stream so can be shown to
user when game is opened later. Fixes problem displaying empty
explanation on first open of game that was updated in the background.
2011-02-09 06:30:51 -08:00
Andy2
8a7029435c fix some comments 2011-02-01 18:55:48 -08:00
Andy2
4b8e462b8b check for null ptrs to allow creating loading games that won't draw or
communicate with users.
2011-01-23 21:45:41 -08:00
Andy2
d98a3fe232 when peeking is disabled (the default on android), don't allow
swapping to view of the current player's board if the current player
is remote -- because then won't be able to swap back to own view until
it's your turn.  Fixes annoyance in multi-device game on Android.
2011-01-21 21:32:52 -08:00
Andy2
7d6e136ca3 fix comment 2011-01-19 06:21:31 -08:00
Andy2
cd5dedfa67 add compile-time flag to disable selection of tiles in tray (other
than as part of an exchange) and to remove feature where tapping empty
cell moves selected tile there.  This is to address user confusion on
Android, and I'll ask for testing before putting this in the main
branch.  This leaves only place-arrow-then-tap as an alternative to
drag-and-drop, and may annoy people.  Worth trying: disable only the
automatic selection of another tile after the selected one is dropped.
2011-01-12 19:00:48 -08:00
Andy2
6ccf0c167c fix next-hint which I just broke: need to track whether working on
behalf of robot after all, though it's not needed in the API, to
distinguish case where moves must be cached (for next-hint feature).
2011-01-11 18:10:48 -08:00
Eric House
2b502a39c6 fix mod-by-zero error when iq == 2 2011-01-10 18:19:10 -08:00
Andy2
efb54c7b05 fix compile errors the stricter android compiler found. 2011-01-10 06:56:11 -08:00
Andy2
f111b78714 switch from tracking robot intelligence as a per-game boolean
implemented (when not smart) as trying to match the human's score to a
per-robot value between 1 and 100 that gives the percentage of best
moves to store before picking randomly from among them.  So a 1 means
save only the best move and always pick it; 100 means save all the
best moves (how many are saved is compile-time configurable) and pick
one of them.  Because it's settable per-robot a smarter robot can be
played against a dumber one (though I may choose not to make it
settable per-robot on shipping versions.)
2011-01-10 06:44:28 -08:00
eehouse@eehouse.org
64bcb8bb2b Revert "replace call to rand() with android_only function that reads two bytes"
This reverts commit 1653b9f6e9.
2010-12-08 05:38:41 -08:00
Andy2
4a12f7a96f Revert "in attempt to work around non-random rand() in jni world, call back"
This reverts commit 99c92e779d.

Conflicts:

	xwords4/android/XWords4/jni/utilwrapper.c
2010-12-07 18:43:53 -08:00
Andy2
e4999acc98 add dict_getWordCount() 2010-12-06 18:24:31 -08:00
Eric House
c4cdc24b78 initial changes to add a header to xwd format so that stuff like
number of words can be included.  Changed to build dicts and linux to
open them.  Android still needs to learn.  Also, some of the tools in
dawg/ need to be fixed to read old-format (pre-utf8) .xwd files.
2010-12-05 19:33:10 -08:00
Andy2
99c92e779d in attempt to work around non-random rand() in jni world, call back
into the java world by making it a util_ctxt function.  Do same on
linux to test.  We'll see how it is -- and can back this commit out if
there's no improvement.
2010-12-02 19:02:36 -08:00
Andy2
1653b9f6e9 replace call to rand() with android_only function that reads two bytes
from /dev/urandom.  rand() has been returning pretty crappy numbers
resulting in lots of clustering of tiles in trays.  Let's see if this
is any better.
2010-11-29 17:12:12 -08:00
Andy2
3ee3af8881 init crosshairs correctly so 0th column and row aren't drawn short. 2010-11-22 07:04:51 -08:00