Commit graph

1284 commits

Author SHA1 Message Date
Eric House
5fa44e54fa remove unneeded .h file 2021-03-19 12:50:23 -07:00
Eric House
be0a6f83f3 drive letters/values from a three-value enum
There are three choices now. The button pops up a menu on android and
moves through the choices on linux.
2021-02-11 14:11:02 -08:00
Eric House
64f1d83b5d show-values mode now means show along with face
not instead of. It now feels as if it should be a global setting, not a
per-game thing to toggle. We'll see what folks think.
2021-02-10 20:43:11 -08:00
Eric House
2927ded334 default undo pct to 0
Until it's fixed don't need to be have tests always fail for a known
reason
2021-01-18 16:27:16 -08:00
Eric House
64a470185c display known player timestamp when known (debug only)
For some reason it's getting cleared sometimes. Will fix.
2021-01-04 08:12:05 -08:00
Eric House
7fd82b4831 fix to compile on raspberry pi (64-bit ARM) 2020-12-15 10:02:51 -08:00
Eric House
45bc623975 enable RAISETILE feature for linux and android
It's timer-based. Not sure I like that, but let's see how it feels
on-device.
2020-12-02 17:55:49 -08:00
Eric House
aa5bacdd5f save and restore board windows' positions 2020-12-02 14:29:07 -08:00
Eric House
6ae1ec9f81 use a grid for kp dialog layout 2020-10-01 14:44:18 -07:00
Eric House
377bb36c73 cleanup 2020-10-01 13:38:07 -07:00
Eric House
bae7f8a641 add delete button 2020-10-01 11:51:50 -07:00
Eric House
6c5d1b082f start on a gtk dialog displaying/editing knowns 2020-09-30 20:38:44 -07:00
Eric House
f90d76329b use semaphore to protect known players data
Requires adding a common method called by platform code on creating a
new dutil ctxt.
2020-09-30 17:21:18 -07:00
Eric House
0f7d924a8e accept dicts with full paths (linux) 2020-09-28 16:12:24 -07:00
Eric House
fad252d8c0 use created stamp to decide between conflicting addresses
Not at all tested, but now the game's timestamp is kept and passed in to
where it can be used to determine, e.g., which of two Bluetooth device
names to keep for a given opponent.
2020-09-26 09:48:35 -07:00
Eric House
c4b55385a3 add creation timestamp to game struct
Address resolution will want to know which address is older. Game
creation is a good enough proxy for that, so add it in a cross-platform
way.
2020-09-26 09:48:35 -07:00
Eric House
d17ac7ea0b rename gamesdb public functions (linux only) 2020-09-26 09:48:35 -07:00
Eric House
49909c84d6 make known-player stuff conditional
and ifdefs to C and BuildConfig flag to java so the feature can be
hidden in release builds until it's ready.
2020-09-26 09:48:35 -07:00
Eric House
11266ece5b gtk known-player invitation works 2020-09-26 09:48:35 -07:00
Eric House
736c9f3503 harvest players on open; save and make available
Got as far as having gtk client display list of previously harvested
known players to be invited. Their addresses, or at least mqtt ids are
saved. Next is to actually invite one.
2020-09-26 09:48:35 -07:00
Eric House
e4594f36e0 generate new mqtt devid when server reports dupe
Thanks to my use of unseeded() rand() early on to generate mqtt device
IDs, a handful of devices are using the same devIDs. The server notices
this and passes a new response which triggers generating a new id that
should be unique (rand() being seeded earlier now.) Testing says the
games that are left behind with the old devid will limp along thanks to
their relay connection while newer games will be better.
2020-09-13 15:06:08 -07:00
Eric House
e26fd23df1 add addrType to comms' main addr when added to channel
I'm fixing android client not showing stats for or allowing to disable
mqtt after it's added automatically to a game that connects
otherwise. Problem was that only the channel got the mqtt address
flag. So now add the flag for any type that's added.
2020-09-10 15:11:22 -07:00
Eric House
80b7097eee test script: strip extension when making logs dir 2020-09-10 11:13:30 -07:00
Eric House
1c6d28633f don't let keys change with every upgrade (use newest)
Supid bug generating keys from __FILE__ meant each release
build (usually done in /tmp/$$, or on a travis server) had a new key and
generated a new MQTT devID (and other stuff less frequently used.)
Replace the keys with something that won't change, and as a temporary
fix so the upgrade including this fix doesn't generate new keys use the
most recent stored key matching the suffix the old keys will have had in
common.
2020-09-04 20:51:44 -07:00
Eric House
783b4efdeb fix to compile on non-cutting-edge glib 2020-08-31 18:33:20 -07:00
Eric House
58dfc32a6e use new glib datetime api (replaces deprecated) 2020-08-31 17:17:52 -07:00
Eric House
b0f7176b6c fix relay game failure to change roles
If a configured-as-host game joined an existing game the relay would
make it a guest. The android util_ callback for that change was only
implemented in BoardDelegate and so the change was dropped unless the
game was open/visible. Because comms recorded the change, though, the
callback would never be called again and so the game never learned to
behave as a guest and never registered: permanent failure to join game!
Implemented with a new server state so initClientConnection can be
called from server_do() instead of inside comms while processing an
incoming packet.
2020-08-25 14:53:33 -07:00
Eric House
15fde8044f make server_initClientConnection() make its own stream 2020-08-25 14:53:28 -07:00
Eric House
0f61a6d9f4 pass and use mqttid in game-connection code
To avoid inviteless relay games not having an mqtt channel (and so
yielding a crappy experience) pass the mqtt devid when device registers
and when server replies with all-here.
2020-08-23 08:34:12 -07:00
Eric House
dc7064a168 fix bug resulting in invitation droppage
Recent changes in how nli address sets were stored led to rejecting
incoming invitations when BT had been removed (e.g. on emulator) because
I didn't notice the removal when validating.
2020-08-22 12:36:31 -07:00
Eric House
adc8c8d961 add missing deb 2020-08-12 21:50:48 -07:00
Eric House
8511c633ee Merge android_translate branch 2020-08-12 16:50:34 -07:00
Eric House
7a43e95aa8 fix crashes when filter strings are too long 2020-08-11 14:13:11 -07:00
Eric House
0f9bcd9898 let user choose between tile-spellings 2020-08-06 11:37:05 -07:00
Eric House
b8f359c3e5 add filtering to wordlist browser
Add a basic regular expression engine to the dictiter, and to the UI add
the ability to filter for "starts with", "contains" and "ends with",
which translate into ANDed RE_*, _*RE_* and _*RE, respectively (with
_ standing for blank/wildcard). The engine's tightly integrated with the
next/prevWord() functions for greatest possible speed, but unless
there's no pattern does slow things down a bit (especially when "ENDS
WITH" is used.) The full engine is not exposed (users can't provide raw
REs), and while the parser will accept nesting (e.g. ([AB]_*[CD]){2,5}
to mean words from 2-5 tiles long starting with A or B and ending with C
or D) the engine can't handle it. Which is why filtering for word length
is handled separately from REs (but also tightly integrated.)

Users can enter strings that don't map to tiles. They now get an
error. It made sense for the error alert to have a "Show tiles"
button, so there's now a dialog listing all the tiles in a wordlist,
something the browser has needed all along.
2020-08-05 09:47:44 -07:00
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