Commit graph

4733 commits

Author SHA1 Message Date
Andy2
f956df853d return "" rather than null when there's no java class backing util --
common code is less likely to crash.
2011-02-09 06:17:38 -08:00
Eric House
dada74aad7 delete dict if there's an IO error while writing it. A German
correspondent's having occasional crashes with a single dictionary.
It appears that if it were truncated during the download that it would
appear ok until a word search spread into a missing area.  This fix is
untested, and should probably be replaced by a checksum that computed
and checked after the download, but I think it's an improvement.
2011-02-08 21:18:51 -08:00
Eric House
a2ad3d7c0b cleanup 2011-02-08 21:07:31 -08:00
Eric House
ad7f8252b9 separate out UtilCtxt implementation from BoardActivity so there's no
dependency on an open game having a visual representation.  This
should allow e.g. receiving and caching chat messages that come in
while game is not in foreground.
2011-02-08 21:06:18 -08:00
Eric House
d1ffc3af7b Merge branch 'android_branch' of ssh://xwords.git.sourceforge.net/gitroot/xwords/xwords into android_branch 2011-02-08 20:59:11 -08:00
Eric House
beaa7ba5a5 assume dict is utf8-encoded but check and fail if it isn't 2011-02-08 20:57:41 -08:00
Eric House
861aec127b Merge branch 'android_branch' of ssh://xwords.git.sourceforge.net/gitroot/xwords/xwords into android_branch 2011-02-04 08:09:50 -08:00
eehouse@eehouse.org
a22f50f2f6 Merge branch 'android_branch' of ssh://xwords.git.sourceforge.net/gitroot/xwords/xwords into android_branch 2011-02-04 07:09:59 -08:00
Andy2
c587a11ee2 Add turn and isrobot/islocal flags to summaries DB, and use to
background in green the player whose turn it is provided that player's
local.
2011-02-04 06:20:40 -08:00
Eric House
e196cfb352 add state table entry lack of which caused a bunch of crashes in a
short time on the live relay.  I'm not sure why it's needed, why they
happened only this time (likely due to a single device) or
alternatively why I don't see those crashes in testing, but the
addition doesn't break anything.
2011-02-04 05:41:44 -08:00
Andy2
79bd17e59b put each player in a game list item in its own line with score at
right end and name at the left.  This will allow e.g. marking in green
a local player whose turn it is.
2011-02-03 06:47:20 -08:00
Andy2
935fe0c7a0 remove option to not show bonus values. 2011-02-01 21:13:46 -08:00
Andy2
33bccaaf42 use slightly different, recommended code to test if network's available. 2011-02-01 20:57:05 -08:00
Andy2
223909f560 change what checking with the server means, from calling HAS_MSGS to
GET_MSGS.  When the messages come in, open up saved games and play
them into them, saving them after if there were any changes.  Tested
by playing a two-device game all the way through fetching messages
after every move.
2011-02-01 20:51:46 -08:00
Andy2
f41356c98b fix the show-other param 2011-02-01 18:57:01 -08:00
Andy2
bf0582f0aa make hint buttons en/disabled based on board_canHint() results. 2011-02-01 18:56:37 -08:00
Andy2
8a7029435c fix some comments 2011-02-01 18:55:48 -08:00
Andy2
ee620a3e37 move bonus squares into jni since they're constant rather than e.g. in
an editable resource.
2011-02-01 18:55:00 -08:00
Andy2
c2be642302 add game_getGi to fetch into java world any changes to the gi in the
jni world.
2011-02-01 18:53:29 -08:00
Andy2
383206f5dc move bonus squares into jni since they're constant rather than e.g. in
an editable resource.
2011-02-01 18:52:29 -08:00
Eric House
c6e7b21f8a Merge branch 'android_branch' of ssh://xwords.git.sourceforge.net/gitroot/xwords/xwords into android_branch 2011-02-01 09:39:55 -08:00
eehouse@eehouse.org
71c92bbaef Merge branch 'android_branch' of ssh://xwords.git.sourceforge.net/gitroot/xwords/xwords into android_branch 2011-01-31 21:47:20 -08:00
Andy2
977feada82 use a reference to a byte array in the java heap (locking down the
object) rather than allocating a new array in the C heap -- for the
DAWG data of a dictionary.  This can use up to 5% of the java heap for
huge dictionaries, but I'm hoping it fixes a problem reported by a
user of the large German dictionary that seems to involve allocation.
If I'm reading correctly, as long as I stay within 16M (24M or more on
newer devices) I'm sure to get my memory in the java world while it's
less a sure thing in the JNI world (where in addition linux's
aggressive overallocation is used, meaning I'll fail when I try to
swap in memory on write rather than get back NULL from malloc.)
2011-01-31 18:56:20 -08:00
Eric House
95443ec9d9 Merge branch 'android_branch' of ssh://xwords.git.sourceforge.net/gitroot/xwords/xwords into android_branch 2011-01-28 14:43:20 -08:00
Eric House
bb24694e37 Merge branch 'android_branch' of ssh://xwords.git.sourceforge.net/gitroot/xwords/xwords into android_branch 2011-01-27 21:09:30 -08:00
Eric House
dc82e57f14 add ability to fetch messages for more than one game at a time 2011-01-27 21:08:17 -08:00
Andy2
566a456489 use getChannel().size() rather than available() to decide how many
bytes to read from downloaded dictionary file -- because available()
will not always return the full size.  I suspect this is why a German
user is crashing when using the very large 2_15 German dict.
2011-01-27 21:03:37 -08:00
Eric House
70f52b162b Merge branch 'android_branch' of ssh://xwords.git.sourceforge.net/gitroot/xwords/xwords into android_branch 2011-01-27 14:58:10 -08:00
Andy2
57ec020330 change format of reply to MSG_GET: include number of messages per
device to support fetching for more than one at once.  This is
meaningless for rq as written now but a device will want to do this.
2011-01-27 06:37:36 -08:00
Eric House
481a533e58 ignore uncompressed dicts too 2011-01-24 22:21:44 -08:00
Eric House
4bf613a006 move pipe handling code to where can be shared by curses and gtk -- but use from curses is untested. 2011-01-24 22:20:47 -08:00
Eric House
63d16a99a2 turn off http view 2011-01-24 22:20:01 -08:00
Eric House
4ae8c76959 break printed runtime into hours:minutes:seconds 2011-01-24 22:19:02 -08:00
Andy2
825cda9125 new feature for testing proxy: --with-pipe option causes linux client
to, instead of putting up UI, blocking on pipe and once it's readable
opening saved game and passing messages into it from pipe then saving
it when done.  Works, but requires gtk so far.
2011-01-23 21:52:26 -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
42d1a713c9 add new -f flag to invoke new fetch-message proxy command. Write the
results to stdout in stream format (len + message).  Goal is to be
able to pipe output to the linux clients to test.
2011-01-22 12:54:47 -08:00
Andy2
f96f4a040b add new proxy command that fetches actual messages stored for a device. 2011-01-22 12:52:26 -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
09b5c44fb4 add option to prevent switching players by tapping scoreboard (to
mimic android)
2011-01-21 21:29:28 -08:00
Andy2
96fead3164 add msglen column to msgs table to be used to avoid calculating size
later.  Stores size of string as it was passed to db, not as stored.
2011-01-21 06:46:49 -08:00
Andy2
b863931db5 turn proxy service back on 2011-01-21 06:10:06 -08:00
Eric House
725888cb6c run proxy sockets through same thread pool as game sockets. This
prevents race conditions that are turning up when I'm running multiple
threads -- by allowing me to really not be running multiple threads.
Tested with the usual script.
2011-01-20 18:14:56 -08:00
Eric House
c4bf153d36 log reason game ended to game's logfile 2011-01-20 18:10:33 -08:00
Andy2
b506673946 use only one thread until race condition's fixed 2011-01-19 18:36:50 -08:00
Andy2
3ae62e4704 use an index rather than a ptr to track fd array (so a parallel array
can be added)
2011-01-19 18:36:24 -08:00
Eric House
4202ea5fac Merge branch 'android_branch' of ssh://xwords.git.sourceforge.net/gitroot/xwords/xwords into android_branch 2011-01-19 09:10:51 -08:00
Andy2
a8f4d772f8 set one timestamp when saving game, and another on game creation. 2011-01-19 06:54:23 -08:00
Andy2
7d6e136ca3 fix comment 2011-01-19 06:21:31 -08:00
eehouse@eehouse.org
a9c65aa950 Revert "add ctime and mtime timestamps to DB when creating, and upgrade to new"
This reverts commit 465370bac6.

Better to work with the existing timestamps as ints than mess with largely unsupported TIMESTAMP type.
2011-01-19 06:19:33 -08:00
Andy2
7f866da8da draw dragged tiles translucent 2011-01-18 22:03:17 -08:00