Commit graph

4370 commits

Author SHA1 Message Date
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
Andy2
46f085f479 drop rather than asserting failure when unable to create a dialog. 2011-01-18 21:19:02 -08:00
Andy2
f6b95f93a1 use HashSet rather than String[] for faster lookup. 2011-01-18 18:47:24 -08:00
Andy2
bce4a11595 more work on color prefs. Add a list pref at the same level as colors
for setting "scheme".  Implement that as changing potentially several
colors but only empty cell color for now.  Remove prefs for whether
cell letters follow user colors (they always will) and the new one for
frame color -- it'll always be dark grey.
2011-01-18 18:42:25 -08:00
Andy2
8d52149c28 cache the background color on which arrow is based so don't have to
compute its blackness each time.
2011-01-17 20:39:35 -08:00
Andy2
e9e54ba379 toward supporting a light-on-dark theme: add pref for cell border
color; add pref for whether highlight is black-on-white or the
reverse; and remake the board arrow in white if the background is a
dark color.  It's now possible to configure various colors so that
black empty cells looks good.  Next need a single control to do it.
2011-01-17 18:55:36 -08:00
Andy2
33d5246b7a add a new-user hint, displayed the first time the arrow's drawn on the
board, explaining what the arrow's for and how to move and disable it.
Implementation required passing XWActivity into BoardView so the
newbie hint method could be called on it.
2011-01-15 21:46:28 -08:00
Andy2
465370bac6 add ctime and mtime timestamps to DB when creating, and upgrade to new
version by adding them.  Can't have them default to 'now' because
that's not supported for ADDs.  Can't remove columns either, so at
some point I'll need to migrate to get rid of accumulated cruft.
Timestamps are not set nor read yet.
2011-01-14 19:03:08 -08:00
Andy2
c9fec737e5 changes, protected by a disabled compile-time flag, to use cairo-based
API for drawing instead of now-deprecated gdk ones.  Unfortunately
nothing actually draws and I'm putting the debugging off until I have
some time.
2011-01-14 18:15:33 -08:00
Eric House
04d8260f01 Merge branch 'android_branch' of ssh://xwords.git.sourceforge.net/gitroot/xwords/xwords into android_branch 2011-01-14 12:02:15 -08:00
Andy2
13ef8dd098 add hints-allowed to set of defaults for new games 2011-01-13 18:45:38 -08:00
Eric House
e7172fb4af Merge branch 'android_branch' of ssh://xwords.git.sourceforge.net/gitroot/xwords/xwords into android_branch 2011-01-13 14:57:24 -08:00
Andy2
9ebbbb0fec replace robot smart checkbox with a spinner having three settings.
Keep the kludge whereby the settings in all the players are kept the
same.
2011-01-13 06:48:50 -08:00
Andy2
d2ddc5cee7 turn off tile selection for android 2011-01-12 19:01:04 -08:00