Commit graph

1249 commits

Author SHA1 Message Date
Eric House
a75264c8eb tweaks for byod 2020-07-25 13:58:29 -07:00
Eric House
fe7e85c93d fix to store mqtt id using properly-named key
And throw in temporary code so those of us testing the stuff don't have
all our existing games stop working.
2020-07-25 13:58:29 -07:00
Eric House
e4f213470c add a basic password for mqtt 2020-06-11 13:11:56 -07:00
Eric House
436d3c2ad0 fix crashes rematching from linux a games started on android
Didn't handle the case where a game included NFC or BT. I should
probably be stripping those on receipt as I think the android side does
when the devices doesn't support 'em. And that in turn should be common/
code. So just fix it for now so testing can continue.
2020-06-04 11:37:07 -07:00
Eric House
43ce9f390a force 16-letter devids 2020-05-31 23:42:44 -07:00
Eric House
27e784e784 change mqtt proto
Making return address part of a header of all messages so server-side
listener can snoop.
2020-05-31 13:13:31 -07:00
Eric House
f6d7eed84d add mqtt as a new transport
This is meant to replace the relay eventually, but for now it's a new
option, like BT or SMS, to be chosen. Protocol is handled in common/
code for the first time, meaning that linux and android interact without
the need to keep two platforms in sync. Linux uses lib-mosquitto, and
Android uses eclipse's Paho client (the generic java version, not the
one that uses four-year-old Service patterns and so crashes for SDK >=
26.)
2020-05-20 13:58:53 -07:00
Eric House
0e9661aa19 fix search of wordlists containing duplicates
Hungarian is unique (so far) in having two-letter tiles that can be
spelled with one-letter tiles AND in allowing words to be spelled both
ways. This crashed search based on strings because there were
duplicates. So now search is done by tile arrays. Strings are first
converted, and then IFF there is more than one tile array result AND the
wordlist has the new flag indicating that duplicates are possible, THEN
the user is asked to choose among the possible tile spellings of the
search string.
2020-05-04 08:33:15 -07:00
Eric House
98ce0e416f api cleanup: dict_iter -> di
(JNI changed too, so it's not just compiler-checked, but tests ok)
2020-05-03 21:45:08 -07:00
Eric House
353e9cf795 remove assertions from dictiter code on Android
Makes wordlist scrolling really slow, and since it's common code keeping
the assertions in Linux is probably good enough.
2020-05-03 10:18:37 -07:00
Eric House
07f4774a7c refactor so common dictnry does more work
Linux and Android duplicated all the code to parse a wordlist file --
and shared a bug that needed fixing. So now most of that is in a common/
function both call, and the bug -- failing to mask out flag bits I don't
care about -- is fixed.
2020-05-01 09:18:27 -07:00
Eric House
e34da24393 revert wordlist changes
There are bugs there still to resolve and I need to ship. Will return
once they're fixed.
2020-04-29 10:15:58 -07:00
Eric House
e7c96290ea name change only
It was confusing using dict_ as the prefix for two "classes"
2020-04-28 15:24:22 -07:00
Eric House
b2bc4e34cf do wordlist lookups using tiles not chars
Fixing a problem with languages (like Hungarian) where it's legal to use
a two-letter tile or two single-letter tiles to play the same word. When
words are seen, or searched for, as char-arrays, there are
duplicates. Current code crashes, but there's also risk the user gets
unexpected behavior. Crash is fixed, and foundation laid for better UX,
by doing all searches for tile arrays. If a search string translates to
more than one tile array the user must choose. For that choice to make
sense it's now possible to translate tile[] to char[] with a delimiter
between the tile strings.
2020-04-28 13:29:12 -07:00
Eric House
88335d38f2 stop using thread->env mapping for util callbacks 2020-04-26 13:39:21 -07:00
Eric House
eb9ef738e4 remove comms/transport from using thread->env map 2020-04-26 13:39:21 -07:00
Eric House
b7b7da795a remove use of thread->env mapper for drawing 2020-04-26 13:39:21 -07:00
Eric House
cfaa6849b2 pass env into dict-related methods
I was getting an occasional crash using a stale env to delete a dict's
resources because the dict was cacheing the env that created it. Dumb!
Using the thread->env mapping stuff worked, but that felt risky and so I
tried just passing it in. It's safe, and involves an amount of change I
can tolerate. So likely going that way.
2020-04-26 13:39:16 -07:00
Eric House
b618c99fa8 just print the upper-case versions of tile faces 2020-04-24 22:21:02 -07:00
Eric House
267a24619a don't require .xwd's extension to be omitted for file to be found! 2020-04-24 21:36:16 -07:00
Eric House
cbf81c64bd track and pass all words when phonies==BLOCKED 2020-04-24 14:58:17 -07:00
Eric House
99df8806c3 wrap test-only feature in new compile-time flag 2020-04-24 13:33:40 -07:00
Eric House
f51030186f fix non-debug build warnings 2020-04-24 08:54:57 -07:00
Eric House
e8a4c6e39a don't run duplicate games by default
Duplicate games get lots of crashes when mixed with phonies code. Will
need to fix that before enabling duplicate mode. In general there are
lots of assertion failures mixing trades and undos and phonies and
running dozens of games at once. I don't think that's new so will ship
now and fix later.
2020-04-24 08:38:31 -07:00
Eric House
f35136099d don't crash when wordlist provides no bitmap 2020-04-23 22:01:07 -07:00
Eric House
e8c48e792a fix tile picker dialog
I wasn't exiting dialogs correctly. Probably broken since the switch to gtk3.
2020-04-22 21:28:27 -07:00
Eric House
4720ede1d7 fix so curses app can invite two players on one device
Turns out the host, when inviting a remote device, needs to know how
many players are on it (since more than one is supported and the script
currently generates that case.) So pass to --server devices an array,
one per remote -- but don't bother when all entries are "1";
2020-04-22 21:28:27 -07:00
Eric House
e68e972396 send NLI in stream format, not as raw bytes
Bad programmer. And because the raw bytes form was so large it always
caused the fake sms stuff to send immediately rather than waiting for a
timer to expire -- which never happened when run by the test script. So
I'm not allowing any timer for invitation-sends only.

(Another problem is that there's no mechanism in the xplat code to retry
invitation sends. That needs fixing.)
2020-04-22 21:28:27 -07:00
Eric House
29dbeebc94 fix assert with reporting no bad words
Several changes toward not allowing bad things to happen
while waiting for a confirmation from the host
2020-04-22 21:28:27 -07:00
Eric House
9d04b97ec8 add option to have robot words reversed
With reject-phonies set this will trigger the reject path.
Also init CommonPrefs in jni land since its makePhonyPct, left unitialized,
causes the robot to deliberately reverse every turn, firing an assertion that the
robot's moves are legal.
2020-04-22 21:26:55 -07:00
Eric House
410bc00d2e add test for being in background 2020-04-22 11:44:46 -07:00
Eric House
5a28a7fc27 fix gtk games connecting to relay/each other
I broke gtk back in February making curses changes
2020-04-22 11:38:48 -07:00
Eric House
54efffa635 pass the wordlist name too 2020-04-20 09:34:14 -07:00
Eric House
10f509ea1f pass and display the blocked word 2020-04-19 22:27:14 -07:00
Eric House
c0f074c1bf support new phony to block words not in dict
Currently detects the same as tiles not in a line and calls out to a new
util method that's currently parameter-less. On Android the option only
appears in d variants.
2020-04-19 17:31:31 -07:00
Eric House
988facccd1 refactor: make vtable population test xplatform 2020-04-19 12:56:11 -07:00
Eric House
2efc82f4e0 add --phonies arg so this doesn't happen again 2020-04-18 06:41:21 -07:00
Eric House
ab07c1c466 show bonus-square-held
Again, so I can see what's going on. Use timeout so doesn't force
lifting the mouse, closer to what happens on Android with Toasts.
2020-04-17 07:06:31 -07:00
Eric House
18711c1dd3 show gtk dialog with lookup-words
That way I can at least see it's working.
2020-04-16 22:54:05 -07:00
Eric House
91e6e50480 stop broken upgrade early-launch case
Wasn't checking for existance of script and so got and exception
deleting what didn't exist. Instead I define nonexistance as being too
early.
2020-04-16 22:18:17 -07:00
Eric House
22f62d53e0 add DB versioning for linux 2020-04-16 22:18:13 -07:00
Eric House
b81bd46645 remove assertion when message mis-delivered
I don't know why, but in my tests the relay seems to be delivering
messages to the wrong device. The linux device detects this. It used to
assert, but now just drops the message. If this is happening on Android
it might be why I'm seeing crashes...
2020-04-11 11:44:09 -07:00
Eric House
87802150d5 fix logging macro to allow a single argument 2020-04-10 07:12:56 -07:00
Eric House
497007a84f show pending name in scoreboard
when remote hasn't arrived, show same string in scoreboard as in games
list rather than the local player's default name -- duh.
2020-04-10 07:12:56 -07:00
Eric House
858d4bd6b7 fix linux build 2020-04-10 07:12:56 -07:00
Eric House
0a696cf203 cleanup 2020-04-10 07:12:56 -07:00
Eric House
387d88bdde fix assertions when duplicateMode on
Hadn't tested in a while and fixing undo problems added some invalid
assumptions.
2020-04-10 07:12:56 -07:00
katianderic
b1f7b13e78 toward fixing stalls when undo used
There are still some stalls turning up when running the test script,
especially with more than two players in a game, but but it'll be
easier to do the final debugging off my pathetic travel-only
chromebook. And things are already much better. :-)
2020-03-14 14:47:26 -07:00
katianderic
781021d6ca trivial changes to aid debugging 2020-03-14 13:44:56 -07:00
katianderic
5d6c2514fd include milliseconds in log timestamps 2020-03-14 13:43:43 -07:00