Commit graph

25 commits

Author SHA1 Message Date
Eric House
131826d34f fix release build 2023-04-06 20:22:29 -07:00
Eric House
326624e942 on linux, keep a queue of mqtt messages
Was dropping invitations that were posted before I connected to the
remote broker. Now they're kept, and sent until the broker says
publish succeeded. Better would be to have comms resend when mqtt
connects, but I'm not set up for that.
2023-03-25 10:24:39 -07:00
Eric House
7b2c327ba8 change send method to take list instead of array 2023-03-25 10:24:39 -07:00
Eric House
6ec0e64657 toward changing APIs to allow combined messages for mqtt 2023-03-25 10:24:39 -07:00
Eric House
0e14783d3b use negotiated streamVersion to decide what to send via MQTT
No point in sending the old-topic-format MQTT messages to clients that
know about the new one, and in fact it's harmful. Devices in a game
already agree on the stream version to use and communicate it, so pass
that into comms once it's known and from there on to the device code
that builds mqtt messages.
2023-02-09 16:53:18 -08:00
Eric House
e79450ab4c refactor message queue access
Cleanup to reduce changes when queue storage changes, which is coming
to optimize mqtt sends.
2023-02-03 10:18:54 -08:00
Eric House
863a54bfe1 Once received, nuke invite on mqtt broker
To prevent deleted games' ghost invitations from remaining as
persisted on a topic and so being received over and over, have
recipient of invitation send an empty message on the same topic to
remove them. Any message sent once the game start would have replaced
the invitation, but sometimes if the sender is deleted at the right
time there's none.
2023-01-24 17:23:30 -08:00
Eric House
8c8561e2ea linux: subscribe only after connect succeeds 2023-01-11 11:10:45 -08:00
Eric House
4caf660c1c cleanup 2023-01-04 14:13:53 -08:00
Eric House
16ced1dd49 fix linux compile; log gameID as %X everywhere 2022-12-30 16:15:03 -08:00
Eric House
933da2de07 API cleanup and all done
This should complete sending to multiple topics (for backwards
compatibility) and supporting combined messages in the future (sending
them is hard; receiving not so much.)
2022-12-20 11:55:30 -08:00
Eric House
6b029d5a85 invitations work on linux 2022-12-20 09:20:02 -08:00
Eric House
af4e39d921 snapshot: new mqtt msg format allowing multiple messages 2022-12-19 19:53:57 -08:00
Eric House
d799b94169 use persist flag and new per-game mqtt topics (too)
I didn't understand MQTT at all. Per the docs anyway it only keeps a
message around if its "persist" flag is set, and then it only keeps
the most recent per topic. I expected that when a device connected,
messages would be waiting for it, but that's apparently not true (some
evidence to the contrary.) But having all games on a device share the
same topic means only one message can be waiting. So switch to
including gameID in the topic, subscribing to a wildcard topic and
sending to a different one per game. For now, for legacy purposes,
we'll keep sending to the old per-device topic.
2022-12-16 14:35:22 -08:00
Eric House
e960877256 more 2022-11-18 11:09:22 -08:00
Eric House
b4e197f8af snapshot: mqtt invites for gtk work via comms
Merge that won't compile, but I want it to start fromp
2022-11-18 11:09:22 -08: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
d5546b484d cleanup (mostly non-DBG compile errors) 2021-03-19 13:03:39 -07:00
Eric House
f335ea7ad9 remove or tweak logging 2021-03-19 12:50:28 -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
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
e4f213470c add a basic password for mqtt 2020-06-11 13:11:56 -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