deleted. To do that: added interface to TransportProcs that a caller
can implement and to which it delegates the UI (error code reports).
BoardActivity implements that interface. To avoid a race condition
where the JNIThread would save the game after I'd deleted it I kill
the thread and wait for it to die before deleting the game and calling
finish().
from networked games since as currently implemented it can quickly get
them permanently out-of-sync (and cause the jni code to assert.) Need
to debug this....
Previously did so only when in background, but that leaves a problem:
if device A sends messages to B and B ACKs them so that they're
deleted but exits without saving (for any reason) the game is
permanently horked. It's safer to save immediately.
arrived in the background. When notification that game's over arrives,
add it to the flags, then on game open show the game over dialog (in
addition to raising chat activity and possibly showing recent move.)
dismissed so that they now all go through onCreateDialog() every time.
This allows to shrink or eliminate onPrepareDialog(). The hope is
that it will fix the occasional crash where restoreManagedDialogs
invokes onPrepareDialog() and some ivar I need isn't set because the
class was just reloaded.
GamesList implements that interface and invalidates the list item
corresponding so it'll get redrawn with updated info. Should allow to
replace m_invalPath but doesn't...
work of pinging relay on timer. That work, which can cause receiver
to exceed its timeout if there are e.g. problems resolving hostnames,
must be done in a thread and Receivers aren't supposed to have
threads. Seems to work as well as it did before and also fixes
force-restart bugs when the network is slow/unavailable.
history, and store it in the game record in the DB (new column). This
will allow to not drop chat messages that arrive in the background,
though that's not implemented yet.
workaround to fix a bug where the UI isn't updating often enough and
sometimes delete or other position-based long-tap menu actions on the
list act on the wrong game. This gives an order that won't change.
Revisit later if a more dynamic order is desired.
game they were passed to. This prevents duplicate messages from
generating notifications over and over -- and dupes are common when
messages stay on relay until the receiving game ACKs them.
the only way to have it wind up on top *and without it being a second
instance of the activity* when relaunched in response to a move-made
notification. Even passing the SINGLE_TASK flag to the relaunching
Intent doesn't accomplish this.
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.
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.
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.
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.)
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.
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.
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.
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.
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.
unchanged and I'm trying to mimic the old per-game setting using the
new per-robot setting internally. Still need to change the UI to
allow move than just a boolean choice.
down. When network's down, return -1 from send proc so that comms
timing can retry. This works on both cellphone on carrier network
(with airplane mode as the test for loss/gain of network) and on
emulator (with death/restart of relay as the test since I don't know
how to kill the iface itself). A quick test on phone using wifi this
morning suggested it didn't work, that into/out of airplane mode did
not result in notifications getting set. Need to test that, and back
this out if can't be fixed since I can't break wifi.
that information to connect and not. There seems to be no way to get
notified when a socket's underlying transport goes down (might not
even want to) so this will be the best way to have the arrows go red
when the device goes into airplane mode.
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.
threads. Greatly simplifies things, but only tested for the simplest
case, and I know it won't correctly reconnect when relay goes down.
But folks recommend against nio, and I'd like to see if I'll get
notifications in the form of blocking socket calls returning or
raising exceptions when the network goes down, something that isn't
happenening with nio.
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.
to use when there are other dicts available in the same langauge as
the missing one that offers to substitute, and another dialog
presenting a list of same-language dicts. Then substitute the one
tapped.
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.
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.
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.
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.
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.
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.
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?