Commit graph

772 commits

Author SHA1 Message Date
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
35a0a3a291 passing pool into word-listing code a mistake as it put tiles back
when undoing and so the pool grew each time.  Fix, and remove server
API as it's unneeded.
2011-09-22 06:41:48 -07:00
Andy2
d000c430b9 thought there was an internal problem with pool and wrote debug-only
code to check.  There wasn't, and it's unused, but no point writing it
again.
2011-09-22 06:40:44 -07:00
Andy2
43e8bd7879 formatting only 2011-09-18 19:05:29 -07:00
Andy2
26ce5a119a in model_getWordsPlayed, make '\n' a separator rather than a
terminator.  Makes it easier to split in the Java world without
getting an extra empty word.
2011-09-18 19:05:00 -07:00
Andy2
9eacdb3856 add server_listWordsPlayed, and implement via function in model.c that
uses existing stack and undo features to run a WordNotifierInfo over
some number of scoring passes to gather the words seen.  Seems to work
as tested from gtk version.  Now need to try from android....
2011-09-18 17:20:01 -07:00
Andy2
63893b8a0d add stream_getPtr() and use to remove a couple of allocs, including
one per message sent.
2011-09-18 16:54:36 -07:00
Andy2
f8f06a7768 raise same error when try to commit exchange out-of-turn is raised for
out-of-turn move attempt -- and don't exit exchange mode.
2011-09-12 18:33:33 -07:00
Andy2
e709ea730c only exit exchange mode if user confirms trade 2011-09-09 21:30:40 -07:00
Andy2
c9c498786e add to game state whether any tiles selected. Use that to disable
'commit exchange' button when there's nothing to commit, and get rid
of error message used when committing nothing since it's now
impossible (on Android).
2011-09-09 19:04:25 -07:00
Andy2
66fb5f87fb don't exit trade mode if no tiles selected; fix warning string to match. 2011-09-09 18:40:19 -07:00
Andy2
201db9415c sort tiles after trade too 2011-09-09 18:32:04 -07:00
Andy2
e4b952222a unify two ways of saving words encountered during scoring, removing
one and changing the site that used it to use the other.  Not visible
outside of common, but should make it easier to harvest a list of all
words for one move or the entire game.
2011-09-02 19:11:04 -07:00
Andy2
2d2f3e23fd change signature of util_playerScoreHeld(): pass player num rather
than formatted text. Client code can use new
model_getPlayersLastScore() or whatever else it wants to build text to
show the user.
2011-09-02 18:36:03 -07:00
Andy2
b6a4621617 trivial optimization 2011-09-02 18:34:07 -07:00
Andy2
99679357a8 Exit trade mode on "commit" even if no tiles selected (in keeping with
error message on Android); don't block trade if pending tiles are on
board; instead undo them. There's redo now so there's no need to
confirm, no data loss.
2011-09-02 06:48:06 -07:00
Andy2
e94524958f get rid of util_setInTrade(); fix passing of selBits when trading
(broken with prev checkin.)
2011-09-01 19:51:26 -07:00
Andy2
8e45dcd720 exit trade mode only in the case where we're asking user to confirm,
and do it before server can call callback that changes selPlayer so
it'll actually work.
2011-09-01 18:50:09 -07:00
Andy2
9c60a5c05b make sure util_setInTrade() gets called every time internal state
changes, including on creation/load from stream.
2011-08-31 06:33:36 -07:00
Eric House
c01981bc8f Make miniwindow stuff compile-time optional. The goal's to use native
features where they look better or are easier to manage, e.g. Toasts
and dialogs on Android.
2011-08-29 20:36:01 -07:00
Andy2
9612b28b1f use goto to avoid having multiple returns. No behavior change. 2011-08-21 14:20:59 -07:00
Andy2
7a1346e530 add assert to catch bad dict earlier 2011-08-18 07:49:40 -07:00
Andy2
35f059e14c remove logging 2011-08-08 20:21:55 -07:00
Eric House
cbfdf992bd add compile-time option to allow passing game seed from commandline.
This should allow testing relay changes to deal better with duplicate
seeds.
2011-07-31 22:23:46 -07:00
Andy2
de16ee93d7 get rid of some logging 2011-07-20 18:46:55 -07:00
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