Commit graph

10720 commits

Author SHA1 Message Date
Eric House
803b4ff0f3 cleanup: load/initialize only when first needed 2018-07-30 08:00:00 -07:00
Eric House
bf06d4b4c2 fix not sending ACK_INVITE
Logic error meant it was never sent. Now always send on receipt of a
well-formed invitation, even if e.g. the recipient's missing a wordlist
and the game can't be started immediately.
2018-07-30 07:37:20 -07:00
Eric House
a23777bade move byte[]<->NetLaunchInfo convert into the class 2018-07-27 07:44:02 -07:00
Eric House
2f10712379 revert to old invite data format
Had inadventently changed how NetLaunchInfo was transmitted, and crashed
on receiving from older builds. Fix to not crash, and then fix to send
and recieve in the old format.
2018-07-27 07:24:27 -07:00
Joan Montané
2c9d619f71
Translated using Weblate (Catalan)
Currently translated at 96.6% (723 of 748 strings)
2018-07-27 10:35:25 +02:00
Eric House
e637f49b95 include port and proto
Pretty sure couldn't have played against an older build without this.
2018-07-26 21:13:09 -07:00
Eric House
dfd4a3f6f6 put the api-26 changes back
lost in a rebase apparently
2018-07-26 19:16:50 -07:00
Eric House
9ddc6e4b89 Move transision of cmd and gameid and port (pending) into smsproto
common code, simplifying and unifying what the platform-specific code
has to do. Seems to work.
2018-07-26 07:50:16 -07:00
Eric House
a65498c132 add missing Overrides -- in one file 2018-07-26 07:24:23 -07:00
Eric House
70b22f7d11 revert to sdk-23
Too much breaks with the upgrade and I don't have time to deal.
2018-07-21 21:36:51 -07:00
Eric House
affb13207e up sdk version in the second place 2018-07-20 08:24:48 -07:00
Eric House
e1ba676a8e Merge branch 'quick-bt-fix' into android_branch 2018-07-19 07:17:15 -07:00
Eric House
723e7d7953 update changes to include translations included 2018-07-19 06:57:21 -07:00
Allan Nordhøy
6abff25946 Translated using Weblate (Norwegian Bokmål)
Currently translated at 55.2% (413 of 748 strings)
2018-07-19 06:54:32 -07:00
Joan Montané
5ced000c8c Translated using Weblate (Catalan)
Currently translated at 94.3% (706 of 748 strings)
2018-07-19 06:54:14 -07:00
Eric House
a9701525b7 up version string for new release 2018-07-19 06:47:18 -07:00
Eric House
fcefa9ca97 dismiss the BT invite progress thing on success
Not sure how this broke in the reorg of XWService stuff, but let's be
agressive about dismissing that thing.
2018-07-19 06:33:05 -07:00
Eric House
4450a8d56c fix NPE by inspection
I'm not sure how it happened -- race condition -- but it's harmless to
drop the action when it does.
2018-07-19 06:33:00 -07:00
Eric House
7cb00b6266 fix assertion: return a f*ing sink
Messed this up in February apparently.
2018-07-19 06:32:48 -07:00
Eric House
b0cf3a795c fix NPE by inspection
fix crash reported by user. Looks like a race on the way out so check
for null first.
2018-07-19 06:32:36 -07:00
Eric House
d40b8b7cad dismiss the BT invite progress thing on success
Not sure how this broke in the reorg of XWService stuff, but let's be
agressive about dismissing that thing.
2018-07-19 06:29:59 -07:00
Eric House
e1fec99860 fix NPE by inspection
I'm not sure how it happened -- race condition -- but it's harmless to
drop the action when it does.
2018-07-19 06:29:03 -07:00
Eric House
67d09a79b5 fix assertion: return a f*ing sink
Messed this up in February apparently.
2018-07-19 06:07:26 -07:00
Eric House
a3fb82ebc4 Merge branch 'android_branch' into android_translate 2018-07-18 22:30:58 -07:00
Eric House
a3ac3c4c8a fix NPE by inspection
fix crash reported by user. Looks like a race on the way out so check
for null first.
2018-07-18 22:26:26 -07:00
Eric House
807fe8633f add forgotten file 2018-07-17 08:46:39 -07:00
Eric House
84f636cbd5 always resend via SMS when opening game
It's done for other comm types too, and is necessary to get linux test
script to pass once I make SMS delivery unreliable. But it may duplicate
the tickle that Android's doing and result in duplicate messages: test.
2018-07-17 07:05:33 -07:00
Eric House
8f9c9e0623 fix crash around uri permissions for new OS version
Use a FileProvider with all the necessary xml changes to pass apk to
installer without crashing it or myself.
2018-07-17 07:02:36 -07:00
Eric House
276ef38108 use sdk26 -- will be required soon anyway 2018-07-15 10:33:09 -07:00
Eric House
2d8ac995b7 add test case where (fake) sms messages never arrive 2018-07-14 15:43:42 -07:00
Joan Montané
cc714a96cb Translated using Weblate (Catalan)
Currently translated at 94.3% (706 of 748 strings)
2018-07-14 12:35:09 +02:00
Eric House
352d87a327 use stream to take apart untrusted message safely
add new stream getters that return false if reach EOS and use them to
exit early and safely if incoming SMS msg is misformatted. I'm getting
random garbage meant for other apps perhaps.
2018-07-13 22:41:52 -07:00
Eric House
019cc628e4 fix crash figuring md5sum of null bytes
Just return null String
2018-07-13 22:35:44 -07:00
Eric House
89ec7987e6 move test to after db's inited to avoid crash 2018-07-13 18:20:56 -07:00
Eric House
5d6c743087 fix (I hope) null jni array dereference 2018-07-13 18:20:05 -07:00
WaldiS
cf24b1e4a0 Translated using Weblate (Polish)
Currently translated at 0.2% (2 of 748 strings)
2018-07-13 21:41:10 +02:00
Eric House
669acdcd19 log checksum of messages into smsproto 2018-07-13 07:39:11 -07:00
Eric House
c45c9cd809 read format spec outside assert
since the read inside goes away in release builds!
2018-07-13 06:59:57 -07:00
Eric House
b8c2cd1dd5 don't assert when a stray message wanders in 2018-07-12 20:20:04 -07:00
WaldiS
2d53673ae5 Added translation using Weblate (Polish) 2018-07-12 20:57:43 +02:00
Eric House
df8558e071 delete partial messages when count mismatches
Had an assert fire when a message ID was reused with a different count.
It was likely because of messages crossing between two variants, but
still, fix: delete what's been saved so far when a new count shows up.
2018-07-12 08:13:32 -07:00
Eric House
bd1cc4276b cleanup and variable rename (no code changes) 2018-07-11 07:33:36 -07:00
Eric House
3477bcf7b6 fix release-build scripts for new gradle output paths 2018-07-11 06:48:42 -07:00
Eric House
af0ddaa0f7 up version code and strings 2018-07-11 06:41:36 -07:00
Eric House
6bab91803d fix release builds
(broken since 091299c 2 months ago)
2018-07-11 06:38:54 -07:00
Allan Nordhøy
3959c73a86 Translated using Weblate (Norwegian Bokmål)
Currently translated at 55.2% (413 of 748 strings)
2018-07-11 00:39:41 +02:00
Eric House
95ac66370c fix off-by-one preventing delayed messages from sending 2018-07-10 07:08:57 -07:00
Eric House
9c2a722cc5 change two method names 2018-07-10 07:07:30 -07:00
Eric House
8c14ccc0d2 add new dutil to store by ptr; use for smsproto msgID 2018-07-10 06:36:34 -07:00
Eric House
08c41ddd3e add debug preference controlling new smsproto format
Don't use the message-combining feature for sends unless this is
set. After a release the default value will switch to true.
2018-07-10 06:19:16 -07:00
Eric House
a9769efe1c implement load/store on android 2018-07-09 07:11:54 -07:00
Eric House
e898dc509c plug leaks 2018-07-07 23:03:26 -07:00
Eric House
13cc6c79f1 add save/restore of partial messages
Handles case where the app receives only a subset of the SMS messages
into which a larger game-level message has been broken. Now when it
restarts and the remaining parts come in the whole can be reassembled.
2018-07-07 22:56:32 -07:00
Eric House
1c58ab3d99 clean up linux db usage
For load/store I'll need more flexibility to store large values.
2018-07-06 08:04:53 -07:00
Eric House
1941642607 add load and store to dutils, and implement with stubs 2018-07-06 06:56:54 -07:00
Eric House
3437ae2ebc use smsproto in Android 2018-07-06 06:48:56 -07:00
Eric House
2e9fbb8204 add common implementation of the SMS proto stuff
And use in linux client. Goal here is to reproduce then improve the
Android SMS pre- and post-processing stuff with a common/ implementation
that can be tested on linux and used wherever.
2018-07-05 21:40:56 -07:00
Eric House
87418d63d1 fix linux "sms" and modify script to test it
My linux sms hack used inotify and didn't check for messages that were
there when the app launched. Replace inotify with a simple glib periodic
timer. A bit of latency mimics SMS better anyway. Update test script to
support SMS, and add params to and otherwise fix linux client so
everything works.
2018-07-05 21:22:20 -07:00
Eric House
ed90c9c16d implement util->dutil split for Android
So now all jni code uses a single dutil context, but also a single
mempool and jniutil instance instead of new instances of the latter two
per game and dict-iteration.
2018-07-05 08:32:19 -07:00
Eric House
d4436b7706 Break part of util into dutil
Trying to separate what's game-specific from what can be app/device
specific (i.e. with a long lifespan, and available when a game isn't
open.)

Android will be broken after this commit and fixed after the next
2018-07-05 07:58:50 -07:00
Eric House
d46a4d13ba use mem_stream_make_raw() where possible in common code 2018-06-27 23:42:50 -07:00
Eric House
d70b089835 use mem_stream_make_raw() where possible in linux code 2018-06-27 23:37:28 -07:00
Eric House
976db7b181 add mem_stream_make_raw 2018-06-27 23:24:45 -07:00
Eric House
9cdd5a7b72 share mpool and vtable in jni calls
A number of jni calls were "stateless", which meant they allocated their
own vtmgr and mpool instances each time invoked. Instead invoke them
with the global jni closure and add to it vtmgr (already has mpool) and
use these instead of allocating/freeing each time. To make sure no race
conditions are introduced (mpool, though debug-only, is probably not
thread-safe), guard these new uses with an in-use flag. If that fires
I'll need a mutex or something.
2018-06-27 21:17:44 -07:00
Eric House
d2ab796fac test script tweaks 2018-06-18 07:11:38 -07:00
Eric House
382718bcb0 init variable
This might have made valgrind happier, though it's been a while. Can't
hurt.
2018-06-13 14:34:31 +03:00
Eric House
80167fb2d9 one more assert 2018-06-01 05:58:04 -07:00
Eric House
b7981cc8da print based on time rather than number of iterations 2018-05-31 23:06:51 -07:00
Eric House
ffaa47f893 fix creation of bogus game
Snapshot can be the first write. Save the rowid if it's new.
2018-05-31 22:19:03 -07:00
Eric House
b24d60e7bf add assert to verify no need for mutex 2018-05-31 21:23:25 -07:00
Eric House
dff130d6c6 ignore log dir 2018-05-31 21:23:10 -07:00
Eric House
d240e30bf4 test script: log and show tiles left in tray
Once the pool count drops to 0, start showing the number of tiles left
in the user's tray. This prevents there being a long time when nothing
seems to be changing *and* the script from exiting early because it
thinks all games are hung.
2018-05-25 21:36:25 -07:00
Eric House
89f4246e83 track and log types of (un-acked) messages 2018-05-24 21:03:25 -07:00
Eric House
39a5ce92ee refactor a bit (no behavior change) 2018-05-23 22:03:16 -07:00
Eric House
1821d197b9 fix to compile on 32-bit system 2018-05-23 19:48:30 -07:00
Eric House
32c93786b3 fix assert when buffer too small
read directly into vector rather than first loading into a fixed-size
buffer that's apparently occasionally not big enough.
2018-05-21 21:19:32 -07:00
Eric House
40ce484a92 fix mistaken and very broken commit
(Fortunately I never ran a relay with this in it!)
2018-05-21 21:19:25 -07:00
Eric House
7fa0cb1b93 rewrite as Thread instead of AsyncTask
I want to be able to use it in contexts where AsyncTask doesn't make
sense, e.g. from timer in background.
2018-05-11 10:23:49 -07:00
Eric House
091299c030 upgrade AS and gradle and with luck travis will work 2018-05-06 14:33:10 -07:00
Eric House
32df1777d3 Merge branch 'android_branch' into android_translate 2018-05-03 06:46:44 -07:00
Eric House
82e6c5495b fix to delete dict even when loc is wrong
Somehow I got a wordlist into a location different from what was
recorded in the DB table and since the delete command matched on
location as well as name it was never deleted (which meant the checksum
was never updated and so upgrading never seemed to succeed.) Removing
the match on location fixed that problem, and since I don't see any harm
in cacheing only one version of a wordlist will simply leave it that
way.

Did a bunch of cleanup as well.
2018-05-01 07:22:59 -07:00
Eric House
a27e8c4c04 move static method into enum 2018-05-01 07:00:14 -07:00
Eric House
1e766ee52d show usage when no args provided 2018-04-29 20:12:22 -07:00
Eric House
535dc29646 silence warning 2018-04-18 21:54:51 -07:00
Eric House
681e2cd8a0 up version code and strings 2018-04-18 21:49:04 -07:00
Eric House
cee7d696fc fix stuff to make valgrind happy 2018-04-17 21:13:53 -07:00
Eric House
1b71198d4e add valgrind option to test script 2018-04-14 10:48:20 -07:00
Eric House
ca54371515 tweaks to test script
Make fewer games with > 2 players, as that's rare. Fix calculation of
total number of launches to include games that have ended.
2018-04-14 10:42:53 -07:00
Eric House
ff82aa4251 fix asserts that fire when test script includes undos
When I used the --undo-pct flag in discon_ok2.py asserts occasionally
fired. This fixes that, and seems not to break anything.
2018-04-14 10:42:53 -07:00
Eric House
317df71588 more valgrind fixes 2018-04-14 10:17:12 -07:00
Eric House
05892c630e lazy: use glib to avoid gcc warnings 2018-04-14 09:39:27 -07:00
Eric House
3bb6f842b2 fix valgrind-flagged errors 2018-04-14 09:13:43 -07:00
Eric House
fecbfdddb6 tweaks to logging for stack hash debugging 2018-04-08 20:46:35 -07:00
Joan Montané
08e74b5dc7 Translated using Weblate (Catalan)
Currently translated at 93.3% (698 of 748 strings)
2018-04-07 09:34:52 +02:00
Eric House
afbf5a2218 fix python script to catch relay.py errors 2018-04-06 21:50:13 -07:00
Eric House
89809e051d compile with latest gcc (untested on old) 2018-04-06 21:49:51 -07:00
Eric House
a221ae43f4 flip arrow when board flipped
Fixing https://sourceforge.net/p/xwords/bugs/8/, flip the arrow before
placing it on top of the tile just returned to the tray.
2018-03-22 07:20:17 -07:00
Eric House
8f86cf9a77 don't assert on debug builds either
I'm seeing several IllegalStateException crashes due to e.g. having an
alert posted when app's in the background. Need to fix them, but the
debug build crashing isn't helpful. Log.e() instead.
2018-03-22 06:55:49 -07:00
Eric House
ab0764fa5a hack around IllegalStateException with Wait alert
The pesky thing is back. When app's in the background with an
unconnected game open displaying the "resend/wait" alert and the game
connects get IllegalStateException because the fragment stack's being
modified after onSaveInstanceState() (or, because the dialog fragment,
saved as an instance variable in BoardDelegate, dates from an earlier
state. Anyway, catching and dropping the exception and elsewhere failing
silently to rebuild the alert seems to fix the problem, but the right
fix is likely different. I suspect hanging onto that iVar is wrong, and
that the dialog should go away when onStop() is called and then be
rebuilt later from saved state. But for now, not crashing is good.
2018-03-21 08:11:07 -07:00
Eric House
fef4db0ee4 make easier to comment out 2018-03-21 07:28:49 -07:00
Eric House
a8db820b68 change strings for new release 2018-03-14 20:07:05 -07:00
Eric House
36c9e8c93b Merge branch 'android_branch' into android_translate 2018-03-14 19:32:25 -07:00
Eric House
77e40619ce Merge branch 'android_translate' of git://git.weblate.org/xwords into android_translate 2018-03-14 19:29:13 -07:00
Markus Enzenberger
dc0436e80d Translated using Weblate (German)
Currently translated at 99.0% (743 of 750 strings)
2018-03-11 09:37:11 +01:00
Eric House
74406c9bba on failure, don't log what looks like success 2018-03-09 06:45:21 -08:00
Eric House
e207b1e9fa log intent contents
trying to track down why/when they wind up empty
2018-03-08 08:30:01 -08:00
Eric House
2a2558a011 add/fix utility for printing Intent contents 2018-03-08 08:17:56 -08:00
Markus Enzenberger
a47381ed53 Translated using Weblate (German)
Currently translated at 98.4% (738 of 750 strings)
2018-03-04 08:39:34 +01:00
Eric House
de01c1aadb cleanup/modernize (should be no behavior change) 2018-03-01 08:13:38 -08:00
Eric House
2c153d1b9e log pending score drawing
I'll occasionally see the pending score in tray drawn dim after hint
fails to find a move, but can't reproduce. So add logging.
2018-03-01 06:58:37 -08:00
Eric House
c7bcccf979 cleanup. Should be no behavior change. 2018-02-28 19:23:36 -08:00
Markus Enzenberger
a24977dddc Translated using Weblate (German)
Currently translated at 86.2% (647 of 750 strings)
2018-02-28 19:13:52 +01:00
Eric House
75c48ddcc5 remove excessive comments 2018-02-28 06:49:35 -08:00
Eric House
760aa3d304 juggle tiles in generated moves (debug only)
Got a report of crashes due to corrupt move records. Given I rarely see
them I wondered if it's because the hint- and robot-generated moves I
work with have tiles in order. So now on debug builds tiles in moves
from those sources are randomly rearranged (as if the user had formed
the word in random order.) The bug isn't showing up, but I figure the
test's worth keeping.
2018-02-28 06:44:44 -08:00
Joan Montané
98dd664a35 Translated using Weblate (Catalan)
Currently translated at 93.0% (698 of 750 strings)
2018-02-28 11:35:02 +01:00
Eric House
b3559915e9 replace AsyncTask with Thread
It didn't even use the runOnUiThread feature!
2018-02-26 07:57:28 -08:00
Eric House
61993fc079 add tests to the rest of the forever loops 2018-02-26 07:03:47 -08:00
Eric House
aaafe1af00 assert we aren't looping infinitely
Stuff I'm doing with invitation resends is making the relay loop
inifintely. Let's assert a small loop count instead: better to crash and
restart than loop forever unable to process requests.
2018-02-25 20:44:06 -08:00
Eric House
73c7494e30 move invitation handling into superclass
Remove a bunch of duplicated code, replacing with implementation in
XWService. Fixes duplicate invitation and game opening policies being
slightly different.
2018-02-24 07:56:57 -08:00
Eric House
aacb0486f5 fix release-only bug showing duplicate moves
The fix I made earlier for this relied on a callback that was skipped in
release builds. Now always take the path that involves making the
callback when one is provided. Also remove an optimization that was
trying to eliminate possible moves based on scores prior to doing the
more expensive full check. In 2018 I prefer simplicity, and can make the
remaining code faster if that's required.
2018-02-18 12:29:30 -08:00
Eric House
4504302b3b make "release" builds compile again
Release isn't really a thing on linux, but I'm fixing something that
only reproduces when DEBUG is undefined.
2018-02-18 11:30:54 -08:00
Eric House
0bccf565c6 cleanup: ivar becomes local variable 2018-02-07 07:35:25 -08:00
Eric House
c762b43047 up version strings and changelog 2018-02-06 07:25:07 -08:00
Eric House
102671398b truncate player name, not score
Try some funky layout shite to get, within a horizontal linear layout,
the first text field trucated if necessary so that the second (holding
the score) can be fully displayed. Tested on exactly one emulator so
far.
2018-02-03 20:11:03 -08:00
Eric House
9c9a19d445 truncate player name, not score
Try some funky layout shite to get, within a horizontal linear layout,
the first text field trucated if necessary so that the second (holding
the score) can be fully displayed. Tested on exactly one emulator so
far.
2018-02-03 20:08:55 -08:00
Joan Montané
a152b169e8 Translated using Weblate (Catalan)
Currently translated at 75.4% (566 of 750 strings)
2018-02-03 10:34:50 +01:00
Eric House
cf1f4a9114 replace one with other in Catalan <plurals> elem
I think there's a bug in Weblate because I've seen this before: where
the English provides only an <other> the translation comes back with
only a <one>. That's wrong. Try adding a <one> in the English case to
see if that makes a difference.
2018-02-02 21:32:30 -08:00
Eric House
9855ef55ae replace one with other in Catalan <plurals> elem
I think there's a bug in Weblate because I've seen this before: where
the English provides only an <other> the translation comes back with
only a <one>. That's wrong. Try adding a <one> in the English case to
see if that makes a difference.
2018-02-02 21:30:15 -08:00
Eric House
1b36e734a4 Merge branch 'android_branch' into android_translate 2018-02-02 21:20:43 -08:00
Eric House
59b82d242c return from only one place. 2018-02-02 21:17:23 -08:00
Joan Montané
71b959aef3 Translated using Weblate (Catalan)
Currently translated at 75.4% (566 of 750 strings)
2018-02-01 09:34:48 +01:00
Eric House
757c5b4ece cleanup: move db access into doInBackground() 2018-01-29 19:29:18 -08:00
Eric House
5326d42438 enable smart scrolling
Otherwise it takes too long to scroll if you have hundreds of
games. To make this work had to move scroller to left side of games
list display as otherwise the scroller steals events from the expander
thingies.
2018-01-29 05:33:48 -08:00
Eric House
875d956836 don't need the local threadinfo at all
I think the crash was just due to removing env from the global state
rather than just leaving it be.
2018-01-23 21:26:11 -08:00
Eric House
ffaa232dba fix dictname being an empty string early on
Likely because of something in the jni world unset per-player dict name
is empty string rather than null, so test for that too. Fixes dicts
popup in newly-created game have an empty first line " (in use)".
2018-01-23 21:14:27 -08:00
Eric House
fd0c5767e6 toast status for resend should include the "re" 2018-01-23 06:56:18 -08:00
Eric House
d809ff4f7c give dict iter its own threadmap
I like this better than the previous fix: rather than share a
thread->env map with the game world allocate a new one for each
iterator. This could cause problem if the iterator is used on threads
that don't currently call map_thread(), or if there are callbacks that
need to look up the env that I'm not aware of. Needs testing...
2018-01-22 22:02:57 -08:00
Eric House
7242a709cb fix crash (race condition?) downloading dict info
Stumbled on a NPE opening up the wordlist browser configuring the first
game on a new install. So now test for null there and init early if
necessary. Seems to work, and won't do anything in places were not
needed.
2018-01-22 21:46:04 -08:00
Eric House
ff92c4a627 update changelog 2018-01-22 21:37:43 -08:00
Eric House
9654241fcf remove ability to set a min > max or max < min
Remake the min and max spinners every time either value changes so they
can't be used to set nonsensical values. (Which leads to immediate
crashes.) I'm sure this wasn't always a problem, but...
2018-01-22 21:31:41 -08:00
Eric House
efad90dd64 update strings for new release 2018-01-22 08:31:17 -08:00
Eric House
cbb683fc74 fix env-mapping crash in jni due to race condition
As reported to google, dict iterator destruction was crashing due to a
race condition if it happened after a game using the same dict had been
closed since it needed a mapped env that the game closure would
remove. Fixed in two ways, one by adding the mapping prior to the code
that uses it (a common pattern: add happens many times, whenver it might
be needed, but remove only once), and second by passing env into the
code that was crashing.

The mapping stuff remains inherently racy and I'm not sure now how to
fix that. It depends on there being a place to unmap after which it's
guaranteed the mapped value won't be needed again. When two
objects (game and dict_iter in this case) map the same env/thread combo
there's a race.
2018-01-22 07:45:43 -08:00
Eric House
134bcbdfa4 cleanup
Add new method with default values, etc: no change in behavior
2018-01-21 21:53:04 -08:00
Eric House
5f0c3bf4bd fix DEBUG assertion: unexpected Actions are expected
Looks like the assertion was left in when adding support for dual-pane
mode, as all other onPosButton() implementations called super rather
than assert. Which this one does now too.
2018-01-21 21:39:14 -08:00
Eric House
ecd6531ce3 add comment; tweak string
best I can do to respond to a suggestion on weblate.
2018-01-19 22:54:20 -08:00
Eric House
19a6672785 don't show current players tiles in list of remaining 2018-01-18 22:02:06 -08:00
Eric House
5afd8763b4 include Catalan translation in changes 2018-01-17 21:19:57 -08:00
Eric House
cdb22defcf cleanup; don't list unack'd acks 2018-01-17 21:17:09 -08:00
Eric House
339779e88e add ip of localhost as comment
Stops having to remember it every six months....
2018-01-17 21:07:28 -08:00
Eric House
efec6aba66 Merge branch 'android_branch' into android_translate 2018-01-17 20:54:49 -08:00
Eric House
42b521f144 switch positions of two PreferenceScreens
putting more oft-used on top
2018-01-16 07:54:33 -08:00
Eric House
a83f3617de up copyright for new year 2018-01-16 07:50:02 -08:00
Weblate
0aa8874e4d Merge remote-tracking branch 'origin/android_translate' into android_translate 2018-01-08 22:20:10 +01:00
naofum
999b7c1217 Translated using Weblate (Japanese)
Currently translated at 73.8% (549 of 743 strings)
2018-01-08 22:20:09 +01:00
Joan Montané
9278179d4c Translated using Weblate (Catalan)
Currently translated at 74.0% (550 of 743 strings)
2018-01-08 22:20:08 +01:00
Eric House
8c9e79f0fc add settings for debugging/tracking GCM 2018-01-03 21:32:23 -08:00
Eric House
11be66eb3f correctly report number of pending moves resent
Was overwriting rather than accumulating.
2018-01-02 22:50:41 -08:00
Eric House
e5ae940216 use AtomicReference. 2018-01-01 20:19:24 -08:00
Eric House
b24a004cab wip: get rid of join() from main thread
Getting ANRs because (I think) the main thread's waiting for the write
thread to die and now the write thread's doing a ton of work
sometimes. So move the threads into a standalone object that can be
allowed to die on its own time without anybody waiting.
2018-01-01 20:19:16 -08:00
Eric House
ea985e2f7a tweak changelog 2017-12-31 12:20:41 -08:00
Eric House
11c3d8fdf6 skip trying UDP after five failures 2017-12-31 10:19:06 -08:00
Eric House
4f7a12f5a1 don't claim "no move" when search interrupted
I *think* the reason I'm occasionally seeing toasts about not finding a
move is that when the engine's interrupted by there being a UI event in
the queue that error is posted. Instead try posting only when at the end
of the search nothing's been found.
2017-12-31 09:54:55 -08:00
Eric House
6de1305c8e don't show error twice 2017-12-30 15:15:52 -08:00
Eric House
2c5720fddc tweak icons; make and add untrade 2017-12-30 15:07:11 -08:00
Eric House
b0fe00f502 update build instruction
And include the problem with 'convert' on MacOS
2017-12-29 17:56:50 -08:00
Eric House
5e20e54638 try to speed up delivery when udp not working
Having reconfigured to use non-existent relay port as a test of falling
back to the web apis, tweak stuff: send the packets that have been
accumulated when an EOQ is found (rather than dropping all of them
immediately) before exiting the write thread; and start the threads up
when posting a packet in case they aren't (they may not be when the post
happens via timer firing.)
2017-12-27 15:03:28 -08:00
Eric House
9fd4a90ccd use currentTimeMillis() for time
Everybody else does....
2017-12-27 14:43:25 -08:00
Eric House
17f27a1b65 remove relayStatus() from jni
Making it a no-op as the only thing it did, tweaking the net status
indicator, isn't useful.
2017-12-27 14:42:15 -08:00
Eric House
de691af7ca oops: save outgoing UDP acks, not web ones
Incorrect ! meant that outbound ACKs were saved for web sends rather
than UDP and so couldn't be resent in the case where fallback to web was
needed.
2017-12-27 12:30:02 -08:00
Eric House
10df914897 ignore folders and generated file 2017-12-22 08:02:49 -08:00
Eric House
7099a7627a wip: toward being able to resend ACKs again 2017-12-21 21:22:40 -08:00
Eric House
d134077d87 move ack timer off of ui thread
Seemed to be causing ANRs. Integrate instead into outgoing message queue
by using poll(timeout) then checking for unack'd packets every time
through the loop (but not more than once/3 seconds or so.)
2017-12-21 21:22:40 -08:00
Eric House
af58110489 add missing deb packages 2017-12-20 21:45:20 -08:00
Eric House
8d9889ccc4 cleanup, e.g. use label to exit outer loop 2017-12-19 07:30:31 -08:00
Eric House
ed57a744b6 use the new built-in game_receiveMessage
I'd forgotten it...
2017-12-19 07:28:19 -08:00
Eric House
16dc1b15bd update release strings and changelog 2017-12-18 22:45:45 -08:00
Eric House
5772718537 mark packets with udp-sent time
Presence of timestamp instead of a boolean determines whether packet
should next via Web. Timestamps might also allow to process a larger
number of unacked packets in a single timer fire....
2017-12-18 18:58:19 -08:00
Eric House
2339f09557 start skipping UDP when acks aren't coming
Track ack'd and unack'd packets. When there are ten more of the latter,
skip the UDP-send step. This is probably not the algorithm I'll settle
on (an explicit PING to the relay over UDP might be simpler), but it's
simple and easy.
2017-12-18 18:13:04 -08:00
Eric House
ec698c4c62 remove empty strings (currently an error) 2017-12-17 11:17:23 -08:00
Eric House
de8993c2e5 Merge branch 'android_translate' into android_branch 2017-12-17 11:13:32 -08:00
Eric House
771c9ba4a6 add three navbar icons from The Noun Project
with attribution of course.
2017-12-17 11:07:43 -08:00
Eric House
dc964ea6c1 catch up small-board menu 2017-12-16 08:17:15 -08:00
Eric House
39dbe67929 add archive menuitem
As with Rematch, you should have the option once you've dismissed the
special alert that comes up when finished games are opened.
2017-12-16 08:06:20 -08:00
Eric House
da1c3f992a Merge branch 'android_branch' into relay_via_http 2017-12-15 07:20:53 -08:00
Eric House
b0befa62e3 remove logging 2017-12-15 07:17:14 -08:00
Eric House
2db67ed339 try send via udp, then web
Send each packet via UDP if that's thought to be working (always is,
now) and start a 10-second timer. If it hasn't been ack'd by then,
resend via Web API. Tested by configuring to use a UDP socket that the
relay isn't listening on. Only problem is that the backoff timers are
broken: never stops sending every few seconds.
2017-12-15 07:12:14 -08:00
Eric House
c7a635285c change text and names around native-vs-web choice
The plan's to use the native relay protocol first, then to fall back to
the slower but more reliable (esp. on paranoid/block-everything wifi
networks) webAPI. This is the name change without behavior
change (except that the native kill() to report deleted games is gone.)
2017-12-14 06:47:03 -08:00
Eric House
bda545fc8e comment out iface
On Linode anyway the relay's unreachable from python scripts unless I do
this, and it seems harmless in local tests too.
2017-12-14 06:39:40 -08:00
Eric House
e96a982f24 get rid of moved file already 2017-12-12 06:59:31 -08:00
Bernard Massot
70aeef6c8e Translated using Weblate (French)
Currently translated at 99.1% (737 of 743 strings)
2017-12-11 17:46:23 +01:00
Eric House
ddadee9bef copy in changes from dev branch 2017-12-11 07:09:44 -08:00
Eric House
4746f153e3 add assertion
Need to revisit that join() call; this'll help.
2017-12-11 06:56:53 -08:00
Eric House
4fa8079bf0 log outgoing "post" params json 2017-12-11 06:55:25 -08:00
Eric House
d1a5a94740 fix crash processing multiple packets
When grouping to allow multiple packets per outbound API call I forgot
that some are there to mark the end-of-queue: can't be sent! Trying
caused a NPE. Now if any EOQ is found in the queue that batch is dropped
and the thread's exited.
2017-12-11 06:42:35 -08:00
Eric House
701e6968de file to pull an apk
app-id is hardcoded for now.
2017-12-10 11:56:52 -08:00
Eric House
fc4e577f1b bring changes over from dev branch
old tests pass without any socket leakage
2017-12-10 08:21:22 -08:00
Eric House
2e71aedc02 fix --game-dict option 2017-12-09 21:32:05 -08:00
Eric House
8d10dca23e pull in test scripts from dev branch 2017-12-09 20:39:16 -08:00
Eric House
afda9ce446 add assertion 2017-12-09 13:30:25 -08:00
Eric House
530e0181e5 list open sockets 2017-12-09 13:30:08 -08:00
Eric House
811c8f535e add socket refcounting
AddrInfo now has ref()/unref() and keeps a global socket->refcount map
(since actual AddrInfo instances come and go.) When the
count drops to 0, the existing CloseSocket() method is called. This
seems to fix a bunch of race conditions that had a socket being closed
and reused while old code was still expecting to write to the device
attached to the socket the first time (along with lots of calls to close()
already-closed sockets, attempts to write() to closed sockets, etc.)
2017-12-07 07:18:09 -08:00
Eric House
dbf38f7759 don't use mlock in config; don't close socket
Use of mutex logging recurses infinitely if config uses mlock, so remove
that. And don't free sockets after handling their messages as they may
be in use elsewhere. This likely introduces a leak of sockets.
2017-12-06 19:11:32 -08:00
Eric House
243eb213bb make reply messages a param within result
Makes it easier to debug by adding stuff on the relay end
2017-12-06 18:57:48 -08:00
Eric House
70dea02efc cleanup; fix possible socket drop
Haven't seen it happen, but I think there was a bug that could have led
to all the sockets coming back as ready from poll() being dropped. Fixed
that and added/cleaned up some logging.
2017-12-04 20:40:44 -08:00
Eric House
d5c4ecabce rename class; add some logging
Rename class that's no longer just about UDP as it began. Add a bit of
logging. This commit *should* not change behavior at all.
2017-12-03 19:18:36 -08:00
Eric House
fd5549014a fix logging 2017-12-03 18:52:06 -08:00
Eric House
17d3f14d9e kill script when no change for two minutes
by default -- there's a flag for that too.
2017-12-03 17:05:02 -08:00
Eric House
e485af925f log milliseconds: seconds not enough. 2017-12-03 16:07:30 -08:00
Weblate
6ffd4d4a37 Merge remote-tracking branch 'origin/android_translate' into android_translate 2017-12-01 04:25:46 +01:00
Eric House
45bb36e66c pad log and db file names for better sorting 2017-11-30 07:43:04 -08:00
Eric House
f1b91f4df2 exit if tile line hasn't change in 2 minutes 2017-11-29 20:39:15 -08:00
Eric House
12ab4bdc5c print total runtime on exit 2017-11-29 20:02:27 -08:00
Eric House
db0d5ef746 tweak display; add signal handler for clean shutdown 2017-11-29 19:32:27 -08:00
Eric House
f9c92ca34f tweak device-in-game summary
Group devices by game so connectivity is easier to watch.
2017-11-28 07:08:41 -08:00
Eric House
4b81b784fc Merge branch 'android_branch' into relay_via_http 2017-11-28 06:24:09 -08:00
Eric House
8e37551f8a up changelog for new release 2017-11-27 20:40:16 -08:00
Eric House
455373343a remove requirement for gcm.jar
remove from xw4d version too since it can't work anyway.
2017-11-27 20:40:16 -08:00
Eric House
af81342021 create new fdroid variant 2017-11-27 20:40:06 -08:00
Eric House
503702c0e4 log unack'd packets 2017-11-26 20:56:38 -08:00
Eric House
0d8aef06f3 keep packets until ack'd for retry and better logging 2017-11-26 20:11:25 -08:00
Allan Nordhøy
9572cdca1b Translated using Weblate (Norwegian Bokmål)
Currently translated at 55.6% (411 of 738 strings)
2017-11-26 15:49:40 +01:00
Eric House
58eafd5fd1 fix glitches in XML strings for Norwegian 2017-11-20 22:04:42 -08:00
Eric House
3216ef8a5c Merge branch 'android_branch' into android_translate 2017-11-20 06:53:34 -08:00
Eric House
b6124ca2d1 change version strings and changelog 2017-11-19 20:10:54 -08:00
Eric House
4698c0e54b add not-again explanation for new archive feature 2017-11-19 20:00:45 -08:00
Eric House
039dcdf0cc print how long run has left 2017-11-19 19:40:29 -08:00
Eric House
ae98425c21 output game progress as a table 2017-11-17 08:06:23 -08:00
Eric House
e7d00cbad4 fix TIMEOUT calculation 2017-11-16 08:29:22 -08:00
Eric House
5ff6f2ca22 fix TIMEOUT calculation 2017-11-16 08:27:51 -08:00
Eric House
ba9b94a0c6 move g_free after last use of ptr
(Made same on another branch but couldn't cherry-pick)
2017-11-16 08:18:39 -08:00
Eric House
f45dcb36b1 rewrite of shell script in python3
translate the most-used features of my too-big-for-bash script into python3,
which is clearly much better suited. Tried to keep the structure and variable
names intact so that diff has a chance of showing something, but when a class
replaces a bunch of arrays that were being kept in sync there's only so much
you can to. Currently doesn't support stuff like app upgrades and switching
from tcp to udp, but those should be relatively easy to bring over from the
.sh when/if I need them.
2017-11-16 08:15:06 -08:00
Eric House
9d02237f19 add assertion to catch too many players 2017-11-16 08:14:49 -08:00
Eric House
236124319a rewrite of shell script in python3
translate the most-used features of my too-big-for-bash script into python3,
which is clearly much better suited. Tried to keep the structure and variable
names intact so that diff has a chance of showing something, but when a class
replaces a bunch of arrays that were being kept in sync there's only so much
you can to. Currently doesn't support stuff like app upgrades and switching
from tcp to udp, but those should be relatively easy to bring over from the
.sh when/if I need them.
2017-11-16 08:04:18 -08:00
Eric House
8b4042a082 add assertion to catch too many players 2017-11-16 07:59:06 -08:00
Eric House
768b63df24 move free() after last use of ptr 2017-11-15 05:48:45 -08:00
Allan Nordhøy
e6a1aef7a2 Translated using Weblate (Norwegian Bokmål)
Currently translated at 11.6% (86 of 738 strings)
2017-11-14 06:48:41 +01:00
Eric House
2879055ca9 log url when response code isn't 200 2017-11-13 08:17:26 -08:00
Eric House
8d99ddee7d Merge remote-tracking branch 'maidu2/relay_via_http' into relay_via_http
(Will probably never use this file...)
2017-11-13 07:30:28 -08:00
Eric House
5166933be6 Merge branch 'android_branch' into relay_via_http 2017-11-13 07:27:17 -08:00
Eric House
033ceab9d1 log outgoing params 2017-11-13 07:26:47 -08:00
Eric House
607567cd35 don't allow duplicate group names
If group already exists, warn rather than create another with the same
name.
2017-11-12 22:50:45 -08:00
Eric House
c2eff7d3f2 add "archive" option to dialog on opening done game
Create the group if needed. Name's not user-editable at this
point. Should be a preference, and that preference should be changed if
user renames it.
2017-11-12 22:31:48 -08:00
Eric House
b77ea0aaad copied from relay_via_http branch
(was at: ./xwords4/android/scripts/relay.py) This is the web API clients
can use to talk to the relay.
2017-11-12 20:29:15 -08:00
Eric House
f072c68bf9 bring in changes from relay_via_http branch
It's time to make them live so client development can use a live relay,
and all the old tests pass, so why not.
2017-11-12 20:25:29 -08:00
Eric House
35d172225f Use AtomicInteger rather than synchronization 2017-11-12 20:10:51 -08:00
Eric House
373c0249bc start backoff timer at 5 second, not 30.
Makes the http case nearly as quick as the udp one when both games are
on the same device. Which is all I've tested so far.
2017-11-12 20:04:22 -08:00
Eric House
fb4f44b0fc remove mistaken assert
I'm not quite sure why it was firing, but the pattern of a FindGame
failing due to a race condition and requiring a retry exists elsewhere
in the code. Lots of tests pass once this change is made. :-)
2017-11-12 19:59:20 -08:00
Eric House
8650795a81 don't crash when can't reach relay via http 2017-11-12 08:53:19 -08:00
Eric House
ec075eff18 comment out assertion that's firing when db wiped 2017-11-11 18:49:23 -08:00
Eric House
5bd71ba7c5 put cids back into the database
The hack I came up with for storing them in memory isn't working. Even
if it's just that I don't understand C++ maps they need to be cleared
when the DB's wiped (my favorite test these days) and I don't want to
spend the time now.
2017-11-11 18:46:02 -08:00