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
13c74cfbd5
protect changeDict feature with compile-time flags (since it can't be
...
used on Android)
2012-10-24 06:46:54 -07:00
Eric House
c69dbda36f
add new game_changeDict() and enough gtk code to test it.
2012-10-23 19:06:00 -07:00
Eric House
528c061156
report host-chosen dict name a bit later
2012-10-15 06:21:08 -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
3221fb237a
Make state disallow hints when game over
2012-10-08 07:21:36 -07:00
Eric House
e64ecfb78d
implement resign on top of existing endGame logic, adding "quitter" as
...
new param passed to remote and changing final score formatting and
menu items to match. Still need to show old menu on android in case
where game has already ended.
2012-10-07 12:47:06 -07:00
Eric House
4e0c7923d9
fix bug with clean target introduced when BUILD_DIR was introduced
2012-10-07 12:14:47 -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
2c89f13383
add turn as param to util_turnChanged, and call from server rather
...
than board.
2012-09-27 07:04:57 -07:00
Eric House
94103a4212
track time of most recent turn start, and include it in summary table.
2012-09-27 06:55:46 -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
4fa5c61e14
add option to build in a separate directory, for e.g. case where source files
...
are on ro filesystem.
2012-09-17 06:48:53 -07:00
Eric House
ad67f31573
saveToken can be 0 when only gi is being saved
2012-09-15 15:19:23 -07:00
Eric House
4f18f01cb8
don't malloc(0)
2012-09-11 19:17:10 -07:00
Eric House
5c683f173a
add mem_stream_make_sized, meant to make saving games more efficient
2012-09-11 19:06:27 -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
9a72f252ed
Merge branch 'android_branch' into android_dictname
2012-09-08 13:20:59 -07:00
Eric House
7d51ee99d9
add dict_getMd5Sum
2012-09-08 10:09:31 -07:00
Eric House
5fa9b60846
add md5Sum field to dict struct, and on linux load it if present,
...
otherwise calculate it. In DEBUG builds always calculate and assert
they match.
2012-09-07 20:34:06 -07:00
Eric House
07e6239699
transmit name of failing dict
2012-09-06 08:01:11 -07:00
Eric House
509c832f2f
more progress: copy dict name into badwordinfo and free it successfully
2012-09-06 07:49:05 -07:00
Eric House
2f8b6cceb5
pass additional param into callback -- unused so far.
2012-09-06 07:19:12 -07:00
Eric House
4325d4e709
Merge branch 'android_branch' into android_dictname
2012-09-05 19:30:50 -07:00
Eric House
1ec03e48bb
plug leak: don't alloc stream when it won't be used
2012-09-05 19:09:01 -07:00
Eric House
71c1fc527a
add counter to mpool tracking so easier to find source of leaks
2012-09-05 19:08:22 -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
4cb848582e
fix edge cases in prefix matching
2012-08-28 07:35:11 -07:00
Eric House
145317426d
Fix prefix matching to accept letters constituting the first part of a
...
digraph tile when at the end of a prefix so that e.g. GORIL in Catalan
will list GORIL·LA (rather than nothing since GORIL, ending with the L
tile, is not a prefix.)
2012-08-27 21:50:09 -07:00
Eric House
fddd2c4ed5
fix bug in dict_tilesToString that occurred only when a language had
...
two tiles starting with the same letter: use recursive search to try
both paths in such cases.
2012-08-27 07:10:40 -07:00
Eric House
9d174601b9
add field, and getter, for new dict header description string, and
...
load it in linux client.
2012-08-26 20:58:28 -07:00
Eric House
67ddbf140b
remove comment unintentionally committed
2012-08-23 06:38:45 -07:00
Eric House
c13971e3d8
convert a few more variable names from single- to double-letter
2012-08-23 06:38:29 -07:00
Eric House
32e1530d3f
i => ii; no other change
2012-08-22 07:44:21 -07:00
Eric House
de87b32bb8
fix bug the right way this time: it's ok for a word not to be in the
...
current player's wordlist when the most recent move's being reported,
but not to ignore word legality altogether.
2012-08-15 18:11:16 -07:00
Eric House
de9a408b15
Revert "Fix bug where if word being scored for long-touch-on-scoreboard wasn't"
...
This reverts commit 07912bdcdb
.
Problem is it breaks WARN-PHONIES
2012-08-15 18:01:36 -07:00
Eric House
25e65d3e6f
cleanup: don't return from middle of function
2012-08-12 19:45:54 -07:00
Eric House
07912bdcdb
Fix bug where if word being scored for long-touch-on-scoreboard wasn't
...
in current player's dictionary it'd show up empty: word, once played,
needn't be legal to be displayed.
2012-08-12 19:25:16 -07:00
Eric House
eb8401bb7a
fix bug when turn lost for phonies in networked game: what's sent must
...
match what's expected.
2012-08-12 11:52:20 -07:00
Eric House
464696566d
get rid of NODE_CAN_4. Not change to post-compiled code
2012-08-01 20:29:15 -07:00
Eric House
8f04bfadaf
modify engine score ranking to include estimate of bonus to be earned
...
if all tiles are used (ending the game and triggering penalties for
other players.) Changes are protected by compile-time flags currently
not turned on.
2012-07-29 08:35:08 -07:00
Eric House
9b0436d1ee
Make rem string measure function return boolean to indicate rect will
...
be invisible rather than setting width and height to 0. No real
change beyond simplifying/speeding platform code.
2012-07-15 09:30:27 -07:00
Eric House
b02855b00c
sort tray after an undo adds tiles
2012-07-12 06:48:09 -07:00
Eric House
bfc68656cb
move arrow to where removed tile was, and set its direction based on
...
whether removed tile and the next tile are in the same column or row.
2012-07-10 18:00:23 -07:00
Eric House
bd70a1dd7d
improve text in remaining tiles dialog, and always show the tiles for
...
all trays rather than excluding those in current player's tray.
2012-07-09 21:44:29 -07:00
Eric House
09a81a2639
add some consts
2012-07-09 21:36:17 -07:00
Eric House
6da3f10855
cleanup -- no code change
2012-07-09 06:15:02 -07:00
Eric House
318cc52f5a
we need the base64 stuff even when don't have SMS -- for serialization.
2012-07-07 11:05:45 -07:00
Eric House
c272491db6
add compile-time option to have tap on empty tray space return one
...
tile instead of all of them.
2012-06-29 06:50:46 -07:00
Eric House
c8cd2d500a
fix to compile and save player score rect info for non-keyboard-nav case
2012-06-27 07:04:36 -07:00
Eric House
2fc2a60842
create alternate scoreboard draw flow, disabled by compile-time flag,
...
that does layout and draw in a single pass and with more information
so platform has more responsibilty for dealing with space constraints
and can, I hope, do a better job. There's no change until the flag is
turned on. Works for GTK with flag on, but is stubbed out for ncurses.
2012-06-26 07:20:09 -07:00
Eric House
d8e4b6481c
make rectContainsRect public so can be used in assert
2012-06-26 07:15:26 -07:00
Eric House
405cb23023
fix bug where current player's scoreboard would disappear if other
...
players' names were too long by giving all a the same proportion of
what they request and passing in the percent given in case draw
implementation wants to use it as a cue to truncate.
2012-06-15 06:26:40 -07:00
Eric House
60a4f123a2
include trayVisState in GameStateInfo
2012-06-05 22:13:26 -07:00
Eric House
821add6df5
fix to compile when HASH_STREAM not defined
2012-05-29 07:19:19 -07:00
Eric House
adadc9c90c
use new hash algorithm for new stream version, old for previous
...
versions. Tested upgrade scenario from b44: works.
2012-05-28 11:07:59 -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
0cb217496e
cleanup
2012-05-24 22:22:00 -07:00
Eric House
9354e0e0cd
fix off-by-one error in stream_copyBits that seems to have been
...
responsible for HASH_STREAM not working.
2012-05-24 22:16:22 -07:00
Eric House
60e1d50f43
add stream_copyBits, and use it to hash the move stack -- commented
...
out via conditional compile as it still doesn't work in all cases.
2012-05-22 19:24:54 -07:00
Eric House
2564a660ad
remove logging
2012-05-18 21:23:12 -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
d846f96ec5
post-code-review cleanup: no significant change
2012-05-09 06:51:06 -07:00
Eric House
155df55b5c
break hash finishing stuff out to be called only once
2012-05-07 20:48:00 -07:00
Eric House
08f03af2cc
don't write gameID as 32 bits when it's bound for old-version client,
...
and assert based only on the lower 16 bits in case came from
old-version client. Fixes crashes testing mid-game upgrade from beta
43.
2012-05-07 07:02:43 -07:00
Eric House
3b3439371f
Merge branch 'android_branch' into android_bt
2012-05-05 17:33:21 -07:00
Eric House
5104ca6bc5
always sort tiles prior to including in hash -- as a fix for the case
...
where a game is opened that was created by an earlier version that
didn't save assigned tiles in sorted order.
2012-05-05 17:33:07 -07:00
Eric House
64199c4e64
Merge branch 'android_branch' into android_bt
2012-05-05 11:08:03 -07:00
Eric House
058cbc4e1b
first attempt, commented out, to hash the stream directly rather than
...
its exploded contents. Does't work once there's been some undo
activity as I don't have a way to get the length of the stack below
the undo/redo line. Looks promising though.
2012-05-05 10:47:28 -07:00
Eric House
eb2f5ff6eb
sort assigned tiles before putting them in the move stack. Fixes hash
...
comparison failure when devices are using sort-tiles option.
2012-05-05 09:47:57 -07:00
Eric House
d59b19514b
Merge branch 'android_branch' into android_bt
2012-05-03 21:44:35 -07:00
Eric House
de3107271d
changes to make hashing work -- make sure unused space in structs is 0
...
-- and to detect when an incoming move doesn't make sense. These
latter changes may not be necessary now that hash code is checked
first thing, but can't hurt, and there will be devices without hash
codes for a while.
2012-05-03 19:02:42 -07:00
Eric House
47dde6cf3c
init bitfield to 0 in case I want to hash stream directly
2012-05-03 19:00:43 -07:00
Eric House
652fe6dd64
fix test: unsigned can't drop below 0
2012-05-02 20:42:45 -07:00
Eric House
26913c5a37
get rid of excessive logging
2012-05-02 20:41:46 -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
c52db8a8f0
toward better recovery from out-of-sync move and undo: include a hash
...
of the move stack with every turn (version permitting), and drop
incoming moves created against a move stack different from ours.
2012-05-01 07:58:11 -07:00
Eric House
0e07fab731
add stack_getHash() -- returning hash of current move stack (excluding
...
any pending redos)
2012-05-01 07:56:45 -07:00
Eric House
89ca45357a
add pool_containsTiles()
2012-05-01 07:49:41 -07:00
Eric House
c15b56199c
use marker enum to test for size. no code change
2012-04-22 17:55:53 -07:00
Eric House
033a69be8d
to make it easier to tell games apart, print the number[s] of the
...
remote device[s] as part of summary view and in game config screen
(read-only). Use same field in summaries table for remote phone
numbers and bt addresses.
2012-04-18 23:23:36 -07:00
Eric House
416a1054a7
Merge branch 'android_ack' into android_bt
...
Conflicts:
xwords4/common/comms.c
xwords4/common/comtypes.h
2012-04-13 20:57:35 -07:00
Eric House
f22d9530b1
track what's been ack'd, and add method to ack what hasn't been.
2012-04-13 20:21:59 -07:00
Eric House
404265565b
tighten definition of connected BT or SMS game
2012-04-12 22:14:13 -07:00
Eric House
ac06d730f8
fix so chat works on SMS (and BT, though untested)
2012-03-24 12:04:07 -07:00
Eric House
fe614e9efc
delegate phone number comparison to platform code which in Android
...
case has a method for it. strcmp is not enough.
2012-03-19 07:36:18 -07:00
Eric House
9caeff4a5e
recover a bit better from messages not meant for me, as is happening
...
when a devices sends to self via SMS and client winds up getting a
registration message it just sent. Not perfect yet (and may require a
change in the comms protocol -- that's not versioned :-(.
2012-03-19 07:35:20 -07:00
Eric House
cd8889f90e
Merge branch 'android_branch' into android_bt
...
Conflicts:
xwords4/android/XWords4/src/org/eehouse/android/xw4/DlgDelegate.java
xwords4/linux/Makefile
2012-03-12 07:04:06 -07:00
Eric House
3b5dcdc2e0
add const param decls; remove redundant method call
2012-03-12 06:59:08 -07:00
Eric House
f51c0b39e6
use const where possible for game_writeToStream and others it calls.
...
No other code changes.
2012-03-11 18:28:14 -07:00
Eric House
07fba2c71b
Fix problem with writing server to stream changing its internal state
...
so that snapshotting made score strings disappear. Also rename
stream_copyFromStream to stream_getFromStream to make it clearer that
the src is modified. And swap params in stream_setPos().
2012-03-11 14:57:28 -07:00
Eric House
5c11f1b284
add XP_LOGSTREAM
2012-03-11 14:46:03 -07:00
Eric House
a2493ffa97
Merge branch 'android_branch' into android_bt
2012-03-06 07:47:05 -08:00
Eric House
24ac205917
cleanup -- no behavior change
2012-03-06 06:23:04 -08:00
Eric House
eec1cb00a1
wrap UUID in #ifdef XWFEATURE_BLUETOOTH
2012-02-27 20:30:48 -08:00