Eric House
34ba254e64
cleanup
2023-02-11 07:50:53 -08: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
646e806ae4
get rid of stream_open(), which was a NO-OP
2023-02-04 07:44:57 -08:00
Eric House
4a57b76817
cleanup: pass xwe with closeProc rather than to destroy
...
It's only needed when there's a close proc, and that's rare.
2023-02-03 22:00:47 -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
c820abb514
remove unused params
2023-02-03 10:18:54 -08:00
Eric House
fcff8dab35
send from inside comms_invite on Linux but not Android
...
This is probably a temporary fix for Linux not being aggressive enough
about calling comms_resendAll() when opening a game. For now, though,
test scripts fail without it.
2023-01-30 12:02:46 -08:00
Eric House
18973675d0
don't send invite from inside comms_invite()
2023-01-27 21:07:39 -08:00
Eric House
6bb14548c9
fix TransportSendInvt to include type
...
In failing to pass the type into TransportSendInvt I was forcing
implementations to send to all types, which led to a lot of duplicate
invitations.
2023-01-24 17:11:05 -08:00
Eric House
ffe571664c
remove asserts flagging problems I can't fix yet
2023-01-24 11:38:11 -08:00
Eric House
7fdf43eba6
add logging
2023-01-23 22:08:50 -08:00
Eric House
873501f8da
changes for better testing invites and sms
2023-01-17 18:01:30 -08:00
Eric House
f1262e49e7
remove unused util method
2023-01-16 10:10:01 -08:00
Eric House
c620f9bc75
Don't allow comms types that aren't in selfAddress
...
(Likely crashes on android)
2023-01-15 16:18:26 -08:00
Eric House
a02ea95600
remove dead code: game_reset and friends
2023-01-11 12:28:09 -08:00
Eric House
a5b0f3dd20
add debug-only code to check for thread-safety
2023-01-06 07:53:10 -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
550248bce0
fix assertions from missing timestamps
2022-12-29 22:39:26 -08:00
Eric House
fdbd404f37
cleanup
2022-12-27 17:38:20 -08:00
Eric House
6648a25dd0
tweak logging
2022-12-26 19:24:39 -08:00
Eric House
5fe02a0888
set initial flags to reflect new version for invites
...
Creating an address record without having heard from the remote is
new, and setting it to an old version was preventing using new msg
format. So set to new by default. Not sure how it'll get downgraded
facing an old client, but a 100-game upgrade test passes.....
2022-12-21 16:11:55 -08:00
Eric House
5887140d9b
use hex for gameID in games list; fix compile error
2022-12-21 10:38:31 -08:00
Eric House
9b1fe83b61
fix to compile without DEBUG set
2022-12-21 10:29:48 -08:00
Eric House
7764c17705
resend all even if some unsendable
...
Looks like invitations become unsendable before they're deleted
sometimes and so block sending real messages. This fixes device
accepting invitation but never hearing back from host.
2022-12-21 10:21:41 -08:00
Eric House
b179a0bade
remove dead code
2022-12-18 18:50:05 -08:00
Eric House
53e1a68d6d
track, and offer to display, comms-sent invites like others
...
I'm only keeping the most recent since they're sent every time a game
opens, app launches, etc.
2022-12-10 22:17:14 -08:00
Eric House
0141f110be
fix to compile without DEBUG set
2022-11-18 11:09:22 -08:00
Eric House
92b02fccb7
cleanup
2022-11-18 11:09:22 -08:00
Eric House
86303475af
fix assertion firing when relay address still present
2022-11-18 11:09:22 -08:00
Eric House
f2b034d710
recognize in-comms invites when opening incomplete game
...
Android offers to invite when it thinks no invitations have been
sent. Now it knows about those buried in comms.
2022-11-18 11:09:22 -08:00
Eric House
6f57665da2
pass number of pending comms invites into informMissing()
2022-11-18 11:09:22 -08:00
Eric House
924695d3fb
add new stream version that skips relay and allows longer string
...
And remove some dead code
2022-11-18 11:09:22 -08:00
Eric House
be9d80533e
cleanup and add helper functions
...
Looking toward a time when channelNo's high-order bits ensuring the
right device is receiving messages go away.
2022-11-18 11:09:22 -08:00
Eric House
e960877256
more
2022-11-18 11:09:22 -08:00
Eric House
066232d234
more stuff
2022-11-18 11:09:22 -08:00
Eric House
f2809e6e15
start of getting rid of gameID part of channelNo
...
Don't seem to need it post-relay, and it complicates things when
invitations are messages too.
2022-11-18 11:09:22 -08:00
Eric House
9a7946de36
fix stall showing up in curses test app
...
Duplicate messages early on, which happened only in the test script
but could have anywhere, broke connectivity. So don't kill address
records when a duplicate shows up. Dupes only escape message ID
checking early (before channel is established). I used to remove
address records when a message was rejected, but don't understand why
so removed that, though asserts show it's not mattering except for
those early messages.
2022-11-18 11:09:22 -08:00
Eric House
4cfc781cd7
remove assert (until I figure out why firing)
2022-11-18 11:09:22 -08:00
Eric House
766554d3f5
snapshot: rematch and invitation handling most work from common
...
But curses will crash, duplicates and missing dicts aren't handled,
etc.
2022-11-18 11:09:22 -08:00
Eric House
8a64d53f61
cleanup
2022-11-18 11:09:22 -08:00
Eric House
6b29ee92e6
tweaks to game_makeRematch
2022-11-18 11:09:22 -08:00
Eric House
b9c6551e8b
merge android_branch changes to comms_make
...
Not tested at all on android
2022-11-18 11:09:22 -08:00
Eric House
10bbab88bf
tweak
...
There's an assertion I need to remove or understand here.
2022-11-18 11:09:22 -08:00
Eric House
98184b9e47
fix to compile and allow invites too late
...
The curses test scripts keep sending invitations, so don't assert
that's not true.
2022-11-18 11:09:22 -08:00
Eric House
61faf1a730
support comparing SMS addresses too
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
fad2c7b3c1
add assert and a debugging aid
2022-10-06 08:45:03 -07:00
Eric House
e55212df9f
improve new game creation
...
There was some confusion around host and self addresses, where they're
created, default values, removing conTypes from defaults that are not
in received host addr, etc. I left in some asserts to help understand
if code that seems wrong but hard to fix is still getting called.
2022-09-14 21:37:44 -07:00
Eric House
ce579213b1
fix asserts
2022-09-06 20:38:56 -07:00