Commit graph

1811 commits

Author SHA1 Message Date
Eric House
ce579213b1 fix asserts 2022-09-06 20:38:56 -07:00
Eric House
674c811a09 pass addresses to game on creation
Current networking, based on invitations rather than a relay that
plays matchmaker, allows host to know its address when a game is
created, and for guest to know its host's address in
addition. Enforcing this makes inviting and rematching in common
code (coming soon) easier. Big change on Android is I used to create a
new game prior to passing it to GameConfigDelegate, but now I have to
wait for user to configure (including choosing how to communicate)
before I can create it.
2022-09-06 18:21:53 -07:00
Eric House
881b9a92ad cleanup 2022-09-06 11:40:09 -07:00
Eric House
381b014b8b change name for clarity 2022-09-06 11:40:09 -07:00
Eric House
4996d3fe89 improve comms address tracking (breaks android for now)
Remove legacy relay-inspired logic around comms addressing. Now when a
device creates a game it's required to provide its "self address," and
if it's a client, the address of the host (which it presumably got
through the invitation in response to which the game is being
created.) Then as registration messages come in from clients, the host
gathers their addresses as always.
2022-09-06 11:40:09 -07:00
Eric House
1b9fd67e9f logging cleanup 2022-08-20 10:24:29 -07:00
Eric House
4106765d53 add some consts 2022-08-16 18:28:53 -07:00
Eric House
cd9ea8ce3f oops: don't revert the bug-fix change to server.c 2022-08-10 12:13:50 -07:00
Eric House
cb362618e9 revert move-reporting changes
They need more testing before the next release, and are fine except
for duplicate-mode play.
2022-08-10 13:33:18 -05:00
Eric House
0497a456e7 cleanup 2022-08-09 22:39:41 -05:00
Eric House
c00bbf8ef1 simplify move expl tracking; don't show for dup-mode robots
Removed a boolean that seemed unnecessary. Stopped showing
move-explanations for robots in duplicate mode. They were being shown
too early thanks to bad logic, but I don't think there's any call for
them at all. A robot's move is only interesting if it's the one that
wins the turn.
2022-08-04 16:03:07 -07:00
Eric House
818868bdb2 remove undo as an option for duplicate mode games 2022-08-03 19:54:53 -07:00
Eric House
e6d516ca1d remove assertion firing in dup mode
The assertion's clearly blocking testing, but I'm not sure it's not an
error for two move explanations to want to co-exist. For now they're
concatenated.
2022-08-01 13:05:19 -07:00
Eric House
10a2c5e4b7 fix assertion failure in dupe mode 2022-07-30 19:50:09 -07:00
Eric House
51abc98647 use same variable name throughout 2022-07-08 21:57:42 -07:00
Eric House
882c717add cleanup/fix compiler warning 2022-07-07 10:00:24 -07:00
Eric House
2dfc9129f3 add timestamp to saved msgs, modify mqtt header to include later
I want receiver to know when message was originally created. This adds
timestamp to messages and passes it via send proc. Client needs to
send it where possible. So far, MQTT format can't include it without
change, so I'm adding a new proto version. This change can read the
new version. Once that's well-enough distributed I can start sending
using it. Other transmission types than MQTT are for later.
2022-06-29 12:34:27 -07:00
Eric House
d24099f52b clean up Hex wordlist
Remove it from known set so it can be used to test. Get rid of
filenames having umlaut since that screws up URLs between Android and
nginx (not sure whose fault and not going there now.) Lang name should
be able to have an umlaut, but it gets used for filename for now so
fix later....
2022-06-05 14:38:33 -07:00
Eric House
7e591f39a5 log isoCode 2022-06-05 09:07:06 -07:00
Eric House
ba132bb23d Replace LangCode with ISOCode, linux and common side
This will break the Android build, but it's the order in which I
work...
2022-06-05 09:07:01 -07:00
Eric House
33b636b458 cleanup around lc code; add to JNI 2022-06-04 14:18:03 -07:00
Eric House
4190926c0a add isoCode to DictInfo, and load it 2022-06-04 14:18:00 -07:00
Eric House
0e665a990e add langName and isoCode to dict struct 2022-05-28 09:00:20 -07:00
Eric House
df1606c8fb use ifdef to remove relay-only params 2022-05-15 12:10:37 -07:00
Eric House
2937aed7e1 log caller/lineno when string in stream too long
I'm seeing it and so want it logged in the future
2022-05-13 18:15:25 -07:00
Eric House
5f4dd46f72 rip out most devid stuff 2022-05-10 20:54:26 -07:00
Eric House
babccc9e21 logf -> logff 2022-05-10 20:54:25 -07:00
Eric House
63b0d7c2fb always clear initial address and add MQTT 2022-05-10 20:54:25 -07:00
Eric House
0eaa71fce6 remove relay from linux client via conditional compile 2022-05-10 20:54:25 -07:00
Eric House
da23bfe23b add debug pref to not add mqtt to all games
I want it for testing that stuff like NBS (data SMS) works for more
than connecting. MQTT works so well nothing ever gets used once it's
there.
2022-05-09 15:10:15 -07:00
Eric House
98cb3b4930 cleanup 2022-04-22 07:59:50 -07:00
Eric House
ab29dfa6ce cleanup 2022-04-21 13:26:26 -07:00
Eric House
05e2d2bdb9 cleanup 2022-04-20 21:00:51 -07:00
Eric House
1c9fe6745c fix crash with 23x23 (linux only); allow 6 blanks
Portuguese will want six blanks for a 21x21 board, so might as well
not crash in case that becomes a thing.
2022-04-20 13:17:07 -07:00
Eric House
5d6d8c7499 bring in changes to make larger boards work for linux
Includes making tile sets vary with board size, calculated from 15x15
unless present in the wordlist. Likely breaks android.
2022-04-04 10:39:29 +02:00
Eric House
9568e4ab03 move extra counts into header so new dicts backward compatible 2022-04-01 07:51:13 +02:00
Eric House
cdc77eaf68 add board sizes to wordlist format (English only)
Modify language metadata to have possibly different counts of tiles
for different board sizes. Make the necessary changes for loading such
files. Works on linux version at least. Only English will build for
now thanks to changes in info.txt format.
2022-04-01 07:51:13 +02:00
Eric House
4b1795cd5b fix crashes when quad-{word,letter} present 2022-04-01 07:51:13 +02:00
Eric House
d0bda214e6 use the right number of bits to store larger scroll vals 2022-04-01 07:51:13 +02:00
Eric House
70d301f210 use the same bonus pattern for all sizes
Just drop the outer "rings" where size < max
2022-04-01 07:51:13 +02:00
Eric House
372d722b58 make number of tiles proportional to board size
Until there's a way to specify specifically for each size, adjusting
from the built-in 15x15 tileset works reasonably well.
2022-04-01 07:51:13 +02:00
Eric House
b34190d62d make 21x21 work on Android
Still needs default colors and the bonus square values working for
smaller sizes.
2022-04-01 07:51:13 +02:00
Eric House
cb2d847e6d add bonus squares for 21x21 board (linux only) 2022-04-01 07:51:13 +02:00
Eric House
1c644d7af0 fix wasm build 2022-03-14 07:42:47 +01:00
Eric House
2175600190 use new webapi to fetch mqttid to replace relayid
And drop relay once we have it. Makes perfecting RelayService backoff
less an issue.
2022-02-12 13:27:24 -08:00
Eric House
4bfcf2afb4 deal better with old relay games
Attempting to stop calling the relay, but to let relay-only games finish
and issue invitations. Big changes are that relay is removed from games
if they have viable mqtt connections, and relay timers fire less often,
then eventually stop getting set if there are no active games. Result is
that a relay-only invitation won't likely be received, but there should
be few or none of those now.
2022-02-10 08:28:34 -08:00
Eric House
acc17c2ce2 Don't connect to relay for games with mqtt
I was determining I need to check the relay for messages if I have open
games using it. But they can also use mqtt, and the goal's go stop using
the relay. So only force the connection if the games can only connect
via relay. Once I've confirmed via a study of relevant databases that
all recent relay games are also connecting via mqtt this can ship, and
should stop nearly all relay traffic .
2022-01-27 08:10:40 -08:00
Eric House
d22ffbec3f handle byod download links
Download the thing and offer to open it on success.
2022-01-24 20:48:13 -08:00
Eric House
2d6ce6cfda fix problems with tile picking introduced by 9-tiles
Not sure if these would show up if you're not picking face-up,
but if so they justify a release.
2022-01-20 22:14:13 -08:00
Eric House
5e028281de fix mis-reporting number of tiles traded 2022-01-17 16:31:19 -08:00
Eric House
d9b1fb4df6 cleanup -- no behavior change 2022-01-10 08:42:41 -08:00
Eric House
8095a0da54 fix uninitialized memory getting treated as a mqtt address
augmentAddrIntrnl() sets the has-mqtt bit in comms->addr but not the
address data (has none). If that address had been loaded from stream
the address bits will be random, not 0, and so get treated as an
address.
2022-01-08 18:55:53 -08:00
Eric House
2e5f6128f2 post new msg message from relay2
This is to have a utility back, but mostly to start playing with being
able to send keepalives to a device that have nothing to do with moves.
2022-01-06 19:07:08 -08:00
Eric House
a8963c952e use variable length ints to store msgID and len 2022-01-04 11:12:58 -08:00
Eric House
759cf12ecf set bingoMin 2022-01-03 20:23:00 -08:00
Eric House
38c80209c4 fix crashes and failure to connect
Seems to be back to working now.
2022-01-03 17:40:23 -08:00
Eric House
a85f5df4e3 another tweak: make version imply format 2021-12-29 07:35:43 -08:00
Eric House
b67ab9e32a refactor, and make msgids variable-length 2021-12-28 20:59:15 -08:00
Eric House
863ef88c22 add varible-length int encoding to streams
And test code that should be removed from linux client at some point.
2021-12-28 18:25:05 -08:00
Eric House
140e1210cc cleanup 2021-12-22 13:01:22 -08:00
Eric House
2b7daf067d shrink the comms header
Sending in 32 bits what can probably fit in 8 -- twice -- is dumb. As is
sending the gameID (as connID) when it's already known. In 2016 I added
a fixed marker, so I can count on all current code sending that. If I
fail to find that, I know the sender is new (current release or better.)
In that case, use 12 bits instead of 32 for two fields, drop the marker
and the connID. Result is that an ACK's size, including MQTT headers,
drops from 28 bytes to 21.
2021-12-21 16:34:04 -08:00
Eric House
0fa43a7394 remove duplicate code 2021-12-16 08:47:12 -08:00
Eric House
14c879a752 fix so ack format is same for DEBUG and RELEASE builds
Was appending garbage to ACKs that, somehow, receiver didn't
mind. Fix. And use the new BEEF format for linux too.
2021-12-15 10:03:09 -08:00
Eric House
79d77410a5 fix failure to send NO_SUCH_GAME over NBS
Wasn't sending zero-length messages, which this one is. Needs testing,
because there must have been a reason for that test.
2021-08-31 10:44:39 -07:00
Eric House
ea1c8125f8 use 16 bits to represent selected tiles
fixes selection of 9th tray tile during trade
2021-08-25 07:24:38 -07:00
Eric House
80f0e35755 allow trade when 7 tiles left, not 9 2021-08-24 21:24:17 -07:00
Eric House
694953c820 add support for trays with up to 9 tiles 2021-07-16 12:15:46 -07:00
Eric House
8f83a390f1 a bit o' cleanup 2021-06-30 11:47:26 -07:00
Eric House
e667291da5 show invitee name where possible
When I've invited a Known Player, use that player's name in parens in
scoreboard and games list elem/summary until a remote device connects
(usually in response to an invitation) and provides an actual player
name. Makes it much easier to tell one pending game from another. And
doesn't really work (yet) where there's more than one remote player in
a game.
2021-05-30 13:31:33 -07:00
Eric House
be698069a4 cleanup of recent changes 2021-05-14 11:34:15 -07:00
Eric House
daf5894d79 call new web api to ack mqtt messages
This is toward debugging. Not sure it'll be use to add functionality yet.
2021-04-19 07:04:58 -07:00
Eric House
92200779ac log connType in nli 2021-04-07 21:40:20 -07:00
Eric House
d74161958e cleanup: remove dead and use new code 2021-03-28 20:27:24 -07:00
Eric House
2a20caa6d7 fix breakage caused by merge 2021-03-27 11:00:06 -07:00
Eric House
64ff2e5f69 Merge branch 'android_branch' into wasm 2021-03-27 10:27:14 -07:00
Eric House
7a7a2db6ce enable chat (without history) 2021-03-24 15:58:25 -07:00
Eric House
561c5c9eb1 cleanup 2021-03-22 10:43:34 -07:00
Eric House
e3ba122ca0 fix to compile with XWFEATURE_RELAY undefined
Didn't change the stream format. That will wait!
2021-03-19 18:51:34 -07:00
Eric House
b1532f19a4 move getDict from dutil to util
It's in the context of a game, and we might want info about the game
when notifying the user. For wasm, though, I just download after failure
to open. User has to try again to open the game. Good enough for now
since missing a wordlist shouldn't happen if you're not me changing
where they're stored.
2021-03-19 17:27:17 -07:00
Eric House
87621c3b51 fix compile 2021-03-19 17:26:48 -07:00
Eric House
e86626d7be don't crash if remote doesn't support chat 2021-03-19 14:30:17 -07:00
Eric House
1aa3ddcde0 cleanup and tweaks 2021-03-19 14:30:17 -07:00
Eric House
585f55c040 use notifications and other tweaks 2021-03-19 14:29:49 -07:00
Eric House
bf88c000b7 fix mempool tracking bug 2021-03-19 14:29:49 -07:00
Eric House
f3b76da8e1 add more info to game "buttons"
Toward a games-list substitute. New game_summarize method will get
fleshed out and eventually replace what's in jni?
2021-03-19 14:29:48 -07:00
Eric House
b0cc6dd744 clear name on delete; remove logging 2021-03-19 14:29:48 -07:00
Eric House
829242c9bb fix to deal with failed downloads 2021-03-19 14:29:48 -07:00
Eric House
52b1300d90 cleanup; remove dead code 2021-03-19 14:29:48 -07:00
Eric House
970c2f6f9a make android compile/run with wasm changes 2021-03-19 14:29:20 -07:00
Eric House
34aee3d7d0 add remaining langs to code-to-lang table 2021-03-19 14:29:20 -07:00
Eric House
f0d8a71deb split dict faces using js so utf8 chars are ok
As with java, the platform knows utf-8 better than vanilla C, so use a
JS inlined function to split a binary stream into its "face" components.
2021-03-19 14:29:20 -07:00
Eric House
567c3dbf9e show mempool stats (DEBUG builds) 2021-03-19 14:27:04 -07:00
Eric House
4937d13273 use indexeddb for storage 2021-03-19 14:27:04 -07:00
Eric House
2a6931fdcf add and start using indexeddb via emscripten APIs
Replace a couple of load/store actions with new APIs that do so
asynchronously (using indexeddb underneath, via emscripten APIs.)
Required restructuring how app starts. More changes to come. The idea is
to replace wordlist storage: this'll keep 'em smaller and not require
conversion to string.
2021-03-19 14:27:04 -07:00
Eric House
d5e7dc4c97 game from a downloaded wordlist works!!!! 2021-03-19 14:27:04 -07:00
Eric House
afc3ff156e make game ask for dicts when needed
It's awkward for platform code to create a dictionary prior to opening a
game whose data contains the information about what dict to open. So add
a dutil method to fetch a dict, and call it from inside game opening
code. Makes linux code better at least.
2021-03-19 14:27:04 -07:00
Eric House
7924c046d6 fix linux compile 2021-03-19 14:27:04 -07:00
Eric House
06b530c443 add notion of index to storage
I'm heading toward being able to know what all the games are by how
they're stored in a xplatform way. This is a start. Adding a second key
to storage, and looking at grouping everything where one key or the
other matches.
2021-03-19 14:27:04 -07:00
Eric House
61be81cf1a invite known players 2021-03-19 14:27:04 -07:00
Eric House
534e245048 change load-from-storage to not require free() 2021-03-19 14:27:04 -07:00
Eric House
41cd3d8f39 open game to receive message 2021-03-19 14:27:04 -07:00
Eric House
23cb7bb85d unsigned->signed to fix drawing garbage in empty tiles 2021-03-19 14:27:04 -07:00
Eric House
74109ce172 fix to send after connect 2021-03-19 14:27:04 -07:00
Eric House
7dc949fb38 choose font sizes to fit
Make on demand rather than guessing. Only wind up with six or so, so the
linear search is probably ok.
2021-03-19 14:27:04 -07:00
Eric House
96829b5478 fix so release build builds
without MEMDEBUG defined that is
2021-03-19 14:27:04 -07:00
Eric House
880bff747d use js runtime for timers too 2021-03-19 14:26:18 -07:00
Eric House
c57471364f get URL-encoded invitation receipt working 2021-03-19 14:26:18 -07:00
Eric House
4612ca70c7 snapshot: message exchange mostly works 2021-03-19 14:26:18 -07:00
Eric House
e3814bf0eb snapshot: sends message to inviter 2021-03-19 14:26:18 -07:00
Eric House
9bc72d0745 move stream storage into super 2021-03-19 14:26:18 -07:00
Eric House
ec9570ab81 improve drawCell() 2021-03-19 14:26:18 -07:00
Eric House
d620461574 fix so all compile 2021-03-19 14:26:18 -07:00
Eric House
633896292a snapshot: drawing empty board 2021-03-19 14:26:18 -07:00
Eric House
b62ab69799 add missing file 2021-03-19 14:26:18 -07:00
Eric House
d5546b484d cleanup (mostly non-DBG compile errors) 2021-03-19 13:03:39 -07:00
Eric House
3f6f16c2f4 add script to print comms msg exchange details 2021-03-19 12:50:32 -07:00
Eric House
f335ea7ad9 remove or tweak logging 2021-03-19 12:50:28 -07:00
Eric House
5fa44e54fa remove unneeded .h file 2021-03-19 12:50:23 -07:00
Eric House
f9e1deabfc don't include dict tiles/values in initial server msg
There's code on all platforms to force user to have dict prior to
opening a game or responding to an invitation. "Empty" dict play hasn't
made sense in a long time.
2021-03-19 12:50:19 -07:00
Eric House
ca88d9c0bf backout ack change for now 2021-03-12 07:16:28 -08:00
Eric House
f947382f4c in comms, send ack on receipt of duplicate msg 2021-03-11 21:43:26 -08:00
Eric House
6c50fcb818 cleanup; make original tiles-values choice the default
We've decided that on upgrade users shouldn't be surprised by a busy
board and unaware of how to fix it. So keep it the way it's been and let
the curious discover the new ability. Also, simplify code.
2021-02-17 15:47:55 -08: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
d3cf74920e remove unused method 2021-02-10 19:37:19 -08:00
Eric House
0ea9b42db8 clear high-bit when generating gameIDs
postgres DB, at least on ARM, doesn't like it.
2021-01-25 07:58:49 -08:00
Eric House
ceec6e7468 fix crash verifying first tray can yield a move
Had never needed an engine for a remote player before. So create one on
demand and nuke after use.
2021-01-18 16:55:20 -08:00
Eric House
d41d5c700f don't let first player have unplayable rack 2021-01-09 20:39:33 -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
35bdd2282e limit pattern parse by max length of tiles 2020-12-27 11:53:36 -08:00
Eric House
d0f5d9949a handle two-letter tiles better
Choose the two-letter tile where possible. Not sure though if this is
always the right move.
2020-12-26 20:45:34 -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
3760d735bc fix compile when XWFEATURE_RAISETILE defined
Doesn't seem to work, and that's not addressed by this.
2020-12-02 17:21:47 -08:00
Eric House
31eeb1de43 when dragging, move crosshairs even over tile
Change so you still see dragging happening via crosshairs movement, but
the dragged tile itself doesn't move except over a place it can be
dropped.
2020-12-02 08:41:52 -08:00
Eric House
99a7930dfb add loop to print a bunch of devids (disabled) 2020-11-29 11:43:19 -08:00
Eric House
623f3ad145 inform when client's game complete too
Board needs to know when to dismiss the waiting-for-host alert. A
similiar need host-side was handled from common/; do same for client
side.
2020-11-28 17:57:33 -08:00
Eric House
00588f50f3 show an cannot-play-yet alert on guest side too 2020-11-28 13:55:36 -08:00
Eric House
f3bb0c99a9 invite alert changes
Create new class that owns the alert. Let it decide whether to post,
remove, etc. Seems to work, but I've removed some of the "reinvite"
options I'm not sure were helpful anyway. To be considered...
2020-11-20 18:07:19 -08:00
Eric House
5d4fd0e58b don't dispose gi before game
gathering players was failing because disposed gi was pointing at
garbage. I'm lucky it didn't segfault.
2020-10-23 19:03:26 -07:00
Eric House
af37fb45f7 Rewrite BT comms to not use a Service
It's simpler this way, and I'm tired of stuff not happening because the
OS chooses not to schedule e.g. an invitation send for minutes. Goal's
to be running BluetoothServerSocket.accept() as much as possible when
there are active BT games in play OR when the game's in the foreground.
If that's happening, sent invitations and moves will be received when
users expect. When there's no traffic and app isn't being brought to
foreground, backoff will ensure I don't try to run accept() too often.

FWIW, BTLE seems to offer a better way to do this (to have an app be
responsive to incoming invitations when it hasn't run in the foreground
in a while), but it requires users to accept FINE_LOCATION
permission. I'm hoping I can make this work to avoid asking for that
permission.
2020-10-21 21:10:09 -07:00
Eric House
9f1f1aeee7 only harvest when closing game 2020-10-01 13:39:02 -07:00
Eric House
21483cf861 add missing file 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
dbde9c87ae list known player in invite info where known
(for mqtt only)
2020-09-30 10:10:43 -07:00
Eric House
2b56b1f8b2 cleanup 2020-09-29 16:06:59 -07:00
Eric House
eb728e4368 fix crash: don't go beyond last edge
An obscure pattern from a user caught this one, but the test should have
been there all along.
2020-09-28 19:18:09 -07:00
Eric House
e9ec30206d add debug-only field tracking place in iterator 2020-09-28 19:18:04 -07:00
Eric House
7b097ea67d Don't allow duplicates when renaming 2020-09-28 11:17:51 -07:00
Eric House
8406d9e551 implement Known Player renaming
Used existing GameNamer which now needs to be made more general.
2020-09-28 08:59:39 -07:00
Eric House
aff75053ac implement deleting known players 2020-09-27 20:52:56 -07:00
Eric House
9e78e47954 fix so non-drag movement stops timer to show words
The last change meant the test whether to show the words under the
pen-down cell would pass when it shouldn't because a drag to an occupied
location didn't register as movement. Change so movement counts to stop
the timer even if it wouldn't change the drag-target's location.
2020-09-27 17:32:23 -07:00
Eric House
80160d740f null-terminate words buffer 2020-09-27 14:23:39 -07:00
Eric House
7fe249ad8d Don't allow drag of tile to place it can't be
Rather than have a tile revert to its original location if it's dropped
where it can't be (on an occupied tile or outside the board), put it in
the last place it could have been. Do that by only updating cur when
it's to a legal location, and then relocating to cur when drag ends.
2020-09-27 13:44:21 -07:00
Eric House
b0c1c5ac1b don't deref ptr after free(); cleanup 2020-09-26 11:00:11 -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
f0f2a598e0 make up new name rather than drop new player 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
fc05612b74 rough implementation of creating and inviting a known player
Followed the way rematch works. Which is gross. Eventually the two
paths (invitee and rematch) should be unified with rematch getting a lot
simpler.)
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
43c1e13563 remove dead code 2020-09-23 12:01:17 -07:00
Eric House
8072a0c629 write 0 where flags will be
unused for now.
2020-09-22 10:56:06 -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
36cc6cc9d6 fix two bits never being set 2020-09-12 21:23:02 -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
79324032b9 remove dead code 2020-09-07 17:59:53 -07:00
Eric House
93a98820e1 cleanup 2020-09-06 14:06:51 -07:00
Eric House
8c3c1b59f6 cleanup 2020-09-05 17:52:00 -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
5998132d4b fix standalone hang introduced by 15f95b52a 2020-08-27 19:47:10 -07:00
Eric House
15f95b52a9 hack to recover from stalled by-room-name games 2020-08-26 13:04:02 -07:00
Eric House
5c150d2f58 don't save isServer in comms
Pass it in so don't have to keep two state locations in sync
2020-08-25 22:27:43 -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
d10d2597d4 add logging; cleanup
I'm chasing a relay problem that's hard to repro and need more info when
it's happened. (These won't show up in shipping builds.)
2020-08-24 17:02:49 -07:00
Eric House
a7acc37395 adding logging 2020-08-24 12:10:25 -07:00
Eric House
99d47fd067 log number of channels 2020-08-23 20:09:21 -07:00
Eric House
55c50ca8b6 don't try to send via mqtt when to dest address 2020-08-23 19:08:29 -07:00
Eric House
587735f607 make gameID's random
using current clock might lead to conflicts
2020-08-23 09:08:40 -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
bd53824d95 replace assert fail with message rejection
Some relay bug (I think) misroutes or duplicates packets. Don't assert
as that means test scripts fail to finish. Instead drop the
message. Scripts seem to recover ok with this change and I've never seen
the assert on a device so suspect it's test-world only
2020-08-23 08:22:21 -07:00
Eric House
55cb36d091 cleanup 2020-08-16 19:29:42 -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
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
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
5f31fedf70 handle new mqtt fcm message
Not sure yet how to restart, but this is a try
2020-06-03 18:53:10 -07:00
Eric House
7f6db851c8 move gameID into header to relay2 can snoop 2020-06-03 09:21:12 -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
5eef348a6c remove mistaken code (replacing with assert for now) 2020-04-29 12:31:31 -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