Commit graph

855 commits

Author SHA1 Message Date
Andy2
3a9eb72db3 add static methods to count and list dicts in a given langauge. 2010-11-30 06:34:57 -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
b4fb57de9c move thread inside so it can be started and stopped. And exit the
thread on failure to connect, allowing comms' timer to control when we
retry.  This fixes problem where would try multiple times/second to
connect when relay was down.  Now we try every 15 seconds (per comms,
which can as well back-off), and shortly after the relay comes back up
connect successfully.
2010-11-24 18:14:34 -08:00
Andy2
8623c569e7 move game data from separate files into a BLOB column in the existing
summaries db table, using the existing SNAPSHOT column rather than
adding a new one and upping the version.  Includes utility fired at
game-start to convert existing games that seems to work.  Also
improved a few queries and updates to -- I think -- use the API
better.
2010-11-24 17:22:46 -08:00
Andy2
be35d875b2 move game data from separate files into a BLOB column in the existing
summaries db table, using the existing SNAPSHOT column rather than
adding a new one and upping the version.  Includes utility fired at
game-start to convert existing games that seems to work.  Also
improved a few queries and updates to -- I think -- use the API
better.
2010-11-24 17:22:04 -08:00
Andy2
7c96048ba2 add, but comment out because it requires user permission, code to
notice when cellular data becomes available and notify relay of dead
games then.  Must be a way to notice a network interface cellular or
not without permission since I already have permission to use it.
2010-11-23 19:01:32 -08:00
Andy2
c3f43dd26c when deleting all games don't inform relay until after the last one so
a single connection does it.
2010-11-23 18:28:05 -08:00
Andy2
0bbf7272aa don't create thread if there are no obits in the db -- makes it
cheaper to call when there may be nothing to do.
2010-11-23 18:10:51 -08:00
Andy2
7c8622392d send the list of saved deleted relayID/seed pairs off to the relay and
remove them from db when relay reports success.  TODO: relay always
reports success even if some are malformed and it's aborted parsing.
2010-11-23 17:56:17 -08:00
Andy2
111c59dd30 toward having game deletion get reported even if network isn't live at
the moment: create new "obits" table and put dead game info in it.
Change constant for current table name to be less generic.
2010-11-23 06:44:59 -08:00
Andy2
eebf5f1252 remove the big dictionary. Ideally I'll figure out how to gracefully
allow to switch without downloading before the next beta.
2010-11-22 18:24:37 -08:00
Andy2
983906810c set dropdown view resource on public rooms spinner -- fixes problem
where it was drawing super-small.
2010-11-22 07:39:18 -08:00
Andy2
edab239060 add one more change 2010-11-21 20:12:45 -08:00
Andy2
ead21206e0 up version to 5 not 6 since prev beta was at 4. 2010-11-21 20:12:34 -08:00
Andy2
7d164f2389 complete list of changes 2010-11-20 21:19:56 -08:00
Andy2
d23dc4aee5 No need to use CurGameInfo for any game summary fields since it's all
in the summary db now.  Saves opening the game itself just to show it
in a list.
2010-11-20 20:37:01 -08:00
Andy2
985c3d586c move gameslist summarizing methods from CurGameInfo to GameSummary. 2010-11-20 20:34:41 -08:00
Andy2
b3b9742cdf add serverrole and players summary to summary db 2010-11-20 20:34:00 -08:00
Andy2
a9a1076d02 actually delete dict when no games use it. 2010-11-19 21:47:38 -08:00
Andy2
b2e418436d tweak string 2010-11-19 21:09:36 -08:00
Andy2
e38ac33e00 move dict-missing dialog from DlgDelegate into GamesList because
that's the only place that is or should be calling it.  And since we
can usually figure out the exact url for the dictionary go ahead and
try to download that.
2010-11-19 21:08:09 -08:00
Andy2
0578a0e4f6 When deleting dictionaries, just do it unless the dictionary's in use
in which case tell user how many games are using it when asking for
confirmation.  To do that, add dict into summary DB, and to do that
add CurGameInfo into GameSummary's constructor.  Also, when there's no
summary for a game, make one on the spot and add it to the db.  This
will crash if the game's dict has been deleted.  Need to deal with
that, probably by deleting unsummarazible games, becuase now if
somebody installs this on top of a device where a game's dict is
missing and it has no summary I'll never boot.
2010-11-19 18:37:00 -08:00
Andy2
586b211b04 add dict name and language to summary database. Probably eventually
want to move everything for the display here -- and maybe the file
contents too as a BLOB.
2010-11-19 18:24:56 -08:00
Andy2
71059e6dff remove nPlayers from game_summarize 2010-11-19 18:23:34 -08:00
Andy2
43be0183a5 just assert that dict can be opened as part of opening game. GamesList
is now responsible for not launching a game if its dict is gone.
2010-11-18 19:05:22 -08:00
Andy2
3eb8b723de don't assume no-dict dialog should call finish on its calling
Activity() on exit -- we're not letting the Activity launch any more.
2010-11-18 19:04:43 -08:00
Andy2
198534dce3 check if dict missing and warn rather than do anything that will crash
if it's not there.  Ideally I could open the config dialog so user
could change the dict but that isn't working.  Maybe just offer to
open it after swapping in the default dict?
2010-11-18 19:00:49 -08:00
Andy2
7921ddca10 don't crash when asked to reset a game whose dict has been deleted. 2010-11-18 18:52:04 -08:00
Andy2
163c124072 update for b19 2010-11-17 06:13:31 -08:00
Andy2
fc88742978 up constants for b19 2010-11-16 21:06:43 -08:00
Andy2
a1be555910 improve string for deleted remote game -- but really needs a "delete
now" button.
2010-11-15 19:02:12 -08:00
Andy2
d809db7b21 plug into delete and reset code to notify relay that game's forever gone. 2010-11-11 06:25:08 -08:00
Andy2
cf84cce41a define and handle new other-was-deleted error relay is about to start
returning.
2010-11-11 06:23:48 -08:00
Andy2
e3f373039a add informOfDeath to communicate to relay when game is deleted 2010-11-11 06:22:38 -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
eehouse@eehouse.org
7929167129 Merge branch 'android_branch' into relay_proxy 2010-11-10 07:06:10 -08:00
Andy2
f373b52d45 fix bug drawing tile letters when drawScaled() got triggered (e.g. for
W on non-std-sized screen): pass null as scr rect to drawBitmap so the
whole bitmap gets used.
2010-11-10 07:05:40 -08:00
Andy2
d3e644db83 stop requiring 1.6 sdk when runs fine on 1.5 2010-11-10 06:57:45 -08:00
Andy2
42481a31cc add seed to db; get and set it. 2010-11-08 17:23:54 -08:00
Andy2
82876bda06 add seed and fetch it in jni 2010-11-08 17:23:16 -08:00
Andy2
b49015c9a1 map out-of-range lang codes to 0. Otherwise we get outOfBounds
exceptions once Hex dict is installed.
2010-11-07 15:42:09 -08:00
Andy2
d893632e1b map out-of-range lang codes to 0. Otherwise we get outOfBounds
exceptions once Hex dict is installed.
2010-11-07 15:34:40 -08:00
Andy2
83ae8d316c switch to RelativeLayout, putting lock checkbox at top and play game
button in the middle with everything else scrolling in between.  This
particular application of RelativeLayout works on 1.5 (in emulator).
2010-11-07 15:13:39 -08:00
Andy2
aff3c9a931 stop requiring 1.6 sdk when runs fine on 1.5 2010-11-07 15:12:37 -08:00
Andy2
1e5ac393c1 update for b18 (but leave b17 description below since that represents
two months of work and b18 two hours.)
2010-11-07 14:13:04 -08:00
Andy2
6da013af9d up constants for beta-18 2010-11-07 14:04:37 -08:00
Andy2
c2472c0cb5 don't call java code if rect width is 0. Fixes crash (but not design
problem) where first to connect in room specifies a timer and second
does not.  Second eventually gets message saying there's a timer but
has not layed out space in the board and java freaks out when later
asked to make a 0-width image.  This fix leaves the device not drawing
the timer until the game is reopened.  The better fix would trigger a
re-layout as soon as the change is made.
2010-11-07 14:03:24 -08:00
Andy2
83f6ebca79 work around bug -- or design flaw -- where when timer is set hint or
robot with blank in tray keeps flashing the in-progress indicator by
flagging CMD_TIMER_FIRED as a non-ui event so busy() won't return when
it's what's on the queue.  Problem with that is that the timer stops
advancing during a hint which is clearly not what's happened.
2010-11-07 12:13:07 -08:00
Andy2
2c95179050 don't complain about empty room name for standalone game 2010-11-07 11:50:01 -08:00
Andy2
46a01ace56 work around occasional crash in on-device testing by checking for 0
before passing to getString.  Not sure of the circumstances but the
crash is coming from restoreManagedDialogs() -- might be related to
screen orientation changes.
2010-11-06 21:34:16 -07:00