Commit graph

772 commits

Author SHA1 Message Date
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
Andy2
92940e6638 add model_getNPlayers() 2010-11-19 18:22:39 -08:00
Eric House
7a2d279308 add logging so script can better track what state relay game is in 2010-11-18 22:27:06 -08:00
Andy2
b0a4790ce0 respond to new game-gone message by passing to utils. 2010-11-11 06:41:24 -08:00
eehouse@eehouse.org
048eff92b8 Merge branch 'relay_proxy' of /home/andy2/dev/git/LOCAL_ORIGIN into relay_proxy 2010-11-10 07:17:39 -08:00
Eric House
2a2f4d4395 been a while since cvs... 2010-11-09 05:53:49 -08:00
Andy2
22f7a42c1d make comms_getChannelSeed non-static so jni can call it 2010-11-08 17:22:38 -08:00
Andy2
cfd4345287 remove too-frequent logging 2010-11-07 13:31:43 -08:00
Andy2
99a557a604 fix blanks-first option to assign one blank per tray rather than all
to first.  Makes for more realistic test.
2010-11-07 12:20:39 -08:00
Andy2
dd3bd1f661 don't show hint buttons until there are tiles assigned 2010-11-06 21:31:53 -07:00
Andy2
9e05e6c2b3 add lastMsgRcd to status printout 2010-11-03 18:28:54 -07:00
Andy2
3d70da5a8d cleanup 2010-11-01 06:57:54 -07:00
Andy2
804070efc7 base comms_canChat() on whether connID's been assigned. It's possible
to send a message from a client immediately after its initial message
but init-message dupe-detection in comms will drop that because only
one channel-0 message is expected -- the initial connection message.
So don't encourage platform code to enable the feature before common
code can deliver the message.
2010-11-01 06:57:41 -07:00
Andy2
8c7043d42c fix crash using undo/redo after a turn has overwritten pending tiles:
when redoing need to check that cell is still empty.
2010-10-29 20:07:09 -07:00
Andy2
5b33df4e25 modify model_getTile to take NULL for out parms where the result is
often ignored, then pass NULL instead of the address of variables
called 'ignore'.  Should be no behavior change.
2010-10-29 19:52:15 -07:00
Andy2
0d7f2c4f23 add devOrder (= hostID) to params passed on connect. Should make for
better explanatory message.
2010-10-29 06:31:33 -07:00
Andy2
4cd15a9c6a Merge branch 'relay_proxy' of ssh://xwords.git.sourceforge.net/gitroot/xwords/xwords into relay_proxy
Conflicts:
	xwords4/common/comms.c
2010-10-29 05:27:07 -07:00
Andy2
41fc05106b add room name to callback used when device connects 2010-10-28 18:45:55 -07:00
Eric House
eba5b77494 add comms_isConnected; public room variables default to false 2010-10-27 20:50:11 -07:00
Eric House
b878599f7b remove comment 2010-10-26 20:57:27 -07:00
Eric House
fd85bd35da set dictLang to 0 (unknown) when reading old-version stream 2010-10-26 20:56:41 -07:00
Andy2
e909e4b343 remove redundant message; advance state to ALLCONNECTED on receipt of
RECONN or CONN that lists the game as full.  This means we get the
all-green icon (or the A in the gtk case) when in a consummated game
rather than only when all devices are actually connected.
2010-10-23 20:29:24 -07:00
Eric House
85d29cf560 if can't send allcond to a device because it's not connected queue the
message to be sent next time it does.  And since the cookieID will
change and should be there already anyway, remove it.  (Should remove
the hostID too for the same reason.)
2010-10-22 19:02:52 -07:00
Andy2
99dbbb443c add comms_canChat, which knows better than java code what state a
connected game is in, and call it to determine whether to show the
chat icon.
2010-10-21 19:14:10 -07:00
Andy2
b9e3ca212b turn off glib-dependant checksuming for non-linux builds 2010-10-18 22:08:04 -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
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
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
e637a64d96 Change param signage to fix compiler warning 2010-10-11 06:20:30 -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
a89520a377 use __func__ 2010-09-28 18:04:31 -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
6d6ad96cde don't clear seed when changing roles from guest to host. 2010-09-20 04:56:19 -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
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
bd71a15ddc turn off heartbeats on client side 2010-09-11 01:23:13 -07:00
Eric House
54611df679 nuke unused variable 2010-09-10 05:55:59 -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
01fe388f85 remove logging accidentally checked in 2010-09-03 06:40:17 -07:00
Andy2
b742c7dbb7 add new booleans to relay address record around public rooms 2010-09-03 06:38:46 -07:00
Andy2
0b91e9634e save/restore new dictLang field; up stream version 2010-09-01 06:51:44 -07:00
eehouse@eehouse.org
ecd0280353 Merge branch 'android_branch' into relay_proxy 2010-08-26 18:36:55 -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
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
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
09bc83429e add and set new flags for crosshairs so platforms can do better than
fill cells as is done for focus.
2010-08-11 18:50:16 -07:00
Andy2
205723e03b add missing event to logging 2010-07-30 17:44:20 -07:00
Andy2
d67e421541 get rid of excess logging 2010-07-27 21:36:14 -07:00
Andy2
5b3e41f4e9 fix bug: allow switch *to* player whose turn it is even if allowPeek
is off (typically because it was turned off after game was loaded and
while non-turn player's tiles are visible)
2010-07-17 07:11:46 -07:00
Andy2
639feb8965 nuke extra line -- change I forgot to save 2010-07-17 06:23:14 -07:00
Andy2
5b8cf716b3 add pref controlling whether can switch to look at tray of user whose
turn it isn't
2010-07-17 06:21:24 -07:00
Andy2
dbed23e240 change definition of movement during drag to include not just drag of
a tile but motion on the board which will include crosshairs.  This
prevents miniwindow from coming up and stopping crosshairs movement
when it happened to start on a bonus square.
2010-07-16 18:57:08 -07:00
Andy2
a99e8142b0 Merge branch 'android_branch' into toolbar
Conflicts:
	xwords4/android/XWords4/jni/Android.mk
	xwords4/android/XWords4/jni/xwjni.c
	xwords4/android/XWords4/res/values/strings.xml
	xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardView.java
	xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/XwJNI.java
2010-07-16 06:32:32 -07:00
Andy2
a76cdac0c5 don't put up mini window when have penned-down on a draggable tile. 2010-07-13 06:26:55 -07:00
Andy2
21d705c6e7 make wrap code for popping tile up above cursor hotspot (or finger)
conditionally compiled.  I probably want it off on Android now that I
have crosshairs.
2010-07-12 19:11:24 -07:00
Andy2
0957c95c8e write and read dummy values to/from stream when KEYBOARD_NAV isn't
defined so that the versions are compatible.  This will let existing
saved games be read if I turn this off on Android.
2010-07-12 18:49:36 -07:00
Andy2
de32e514ab cherry-pick three revisions from toolbar branch (d1c7d4097c, f848473c1a and 6484a2fb9b) and manually fix conflicts. 2010-07-12 18:48:03 -07:00
Andy2
fd9464b909 first cut at crosshairs: drawing in focus color the entire column and
row that's currently being touched/dragged through.  Meant to aid
users of capacitive touch screens in figuring out what cell they're
on.
2010-07-12 06:39:46 -07:00
Andy2
8172e38cef write and read dummy values to/from stream when KEYBOARD_NAV isn't
defined so that the versions are compatible.  This will let existing
saved games be read if I turn this off on Android.
2010-07-09 18:21:05 -07:00
Andy2
6b9b97231a fix to compile with KEYBOARD_NAV undefined 2010-07-09 06:49:32 -07:00
Andy2
40323b03d2 board_canFlip -> board_visTileCount 2010-07-08 06:38:51 -07:00
Andy2
ac6dc400ce add board_canHint 2010-07-07 18:47:02 -07:00
Andy2
c98451c62a remove excess logging 2010-07-07 06:50:47 -07:00
Andy2
a7c77785f6 return false if no move found -- to really fix the crash 2010-07-07 06:40:34 -07:00
Andy2
5725f36db8 detect when no moves found that meet criteria to fix (I think) crash
when iterating from highest to lowest move using prevMove.
2010-07-07 06:33:01 -07:00
Andy2
992f45e1bf new feature: previous move. Modify engine to traverse the set of all
possible moves in either order both within a cached subset and when
building cached subsets.  Still a bit buggy (shows the same move twice
when moving backwards and reaches the top-scoring move) and not well
tested.
2010-07-07 05:27:57 -07:00
Andy2
5f92491ca3 add and implement board_canTogglePending 2010-07-03 11:38:37 -07:00
Andy2
d44b9907cf save redoable pending tiles -- and up stream version since format's
changed
2010-07-03 11:25:01 -07:00
Andy2
57e246da3b handle blanks as well in redo of undone pending tiles 2010-07-02 22:44:50 -07:00
Andy2
f77cf0e23d add board_redoReplacedTiles and model_redoPendingTiles. The latter
works as long as no blanks are involved.  And new state isn't being
saved so will be lost unless format changed.
2010-07-02 18:52:55 -07:00
Andy2
491cfe7616 add board_canShuffle and implement 2010-07-01 18:55:49 -07:00
Andy2
43c34aa466 add board_canFlip and model_canFlip -- which seem to work though
there's no test that when a single tile is on the board it's not in
the middle.  Sue me.
2010-06-30 20:25:34 -07:00
Andy2
953b2bcc55 cleanup; allow setting NUM_SAVED_ENGINE_MOVES per-platform 2010-06-28 21:08:13 -07:00