Commit graph

1821 commits

Author SHA1 Message Date
Eric House
3670af591b cleanup stuff noted in code review -- no behavior change 2024-01-17 21:41:57 -08:00
Eric House
6f0bfe2c82 cleanup: remove unnecessary params 2024-01-17 11:35:35 -08:00
Eric House
b6cff507fa fix sending invitations via BT 2024-01-16 21:47:31 -08:00
Eric House
aa0aded8c4 Change the suggested game name (a vs b) with the RematchOrder
It's bad to display a name based on a player order in the same place
as where you're letting people change that order and not have the
name change. So re-juggle the rematch process to allow the name to
be changed -- but don't change once the user has edited the name.
2024-01-16 17:10:53 -08:00
Eric House
7f3572c96e fix crashes using new logging when comms null 2024-01-14 17:03:50 -08:00
Eric House
9900291eb0 fix Bluetooth inviting and game play 2024-01-14 17:03:50 -08:00
Eric House
23533c6b0e combine rematch-name and rematch-order alerts 2024-01-13 10:22:32 -08:00
Eric House
f84bb85f22 Don't offer to rematch game that can't (yet) be rematched 2024-01-11 22:59:28 -08:00
Eric House
a16a34adc9 cleanup comms ack fix 2024-01-11 10:50:21 -08:00
Eric House
16f525f7b9 don't ACK ACKs 2024-01-09 18:17:36 -08:00
Eric House
1ae714d834 start to remove obsolete XWFEATURE_STANDALONE_ONLY 2024-01-09 18:17:36 -08:00
Eric House
6018392160 send/handle all invitations at once
I'm trying to reproduce with initial invitations the stalls I'm seeing
with rematches (rarely)
2024-01-04 20:28:49 -08:00
Eric House
8388b27002 add comments about problems with signed gameIDs 2024-01-04 18:03:38 -08:00
Eric House
f5526652b5 remove old ifdef'd-out code 2024-01-04 09:50:24 -08:00
Eric House
c91865c991 use invite's channelNo for first incoming message
A rare stall resulted when the invitee on channel 2 responded
first. It would get assigned channel 1 and so the invitation on that
channel would get deleted. If it hadn't already reached the mqtt
server it would never be delivered. My fix is to use an invitation's
channel instead IFF its address matches the return address of the
incoming message. I'm not sure what happens if there's somehow a mix
of invited (via rematch) and invited-some-other-way players. None of
this matters for two-device games anyway.
2024-01-04 09:50:24 -08:00
Eric House
7219206214 get rid of ancient ifdef 2024-01-04 09:50:24 -08:00
Eric House
fcf1e49c16 fix double dispose in curses app 2024-01-04 09:50:24 -08:00
Eric House
4ffaa5dd73 cleanup -- should be no behavior/code change 2024-01-04 09:50:24 -08:00
Eric House
9443bf14a4 make it work on android too 2024-01-04 09:50:24 -08:00
Eric House
5794cc43e3 log gameID wherever possible in comms.c and server.c 2024-01-04 09:50:24 -08:00
Eric House
52a1de0463 add fromRematch to existing api to avoid race condition 2024-01-04 09:50:24 -08:00
Eric House
b5de43e3dc fix assertion failure in mixed-version rematch case 2024-01-04 09:50:24 -08:00
Eric House
ffc64bc5dd cleanup/refactor 2024-01-04 09:50:24 -08:00
Eric House
7275569842 fix crash assuming wrong stream version 2024-01-04 09:50:24 -08:00
Eric House
e2414ff3bd fix NPE crash
Not sure why it happens with one old game...
2024-01-04 09:50:24 -08:00
Eric House
f0ca490b3c fix stuff test script found 2024-01-04 09:50:24 -08:00
Eric House
1181e908dc Add option to choose how rematch-game players will be ordered
When rematching, some users have a convention that e.g. lowest scoring
player in the "parent" game goes first. So allow that, providing the
choice on each rematch until a default has been chosen. Support
changing that default in a new prefs setting.

The place I chose to enforce the order was on the host as invitees are
registering and being assigned slots. But by then there's no longer
any connection to the game that was rematched, e.g. to use its
scores. So during the rematched game creation process I create and
store with the new game the necessary ordering information. For the
3-and-4 device case, it was also necessary to tweak the information
about other guests that the host sends guests (added during earlier
work on rematching.)
2024-01-04 09:50:24 -08:00
Eric House
7b4f9ede41 cleanup: renaming only (server->host) 2024-01-04 09:50:24 -08:00
Eric House
57b78141e9 remove dead (relay) code 2023-12-04 09:31:11 -08:00
Eric House
55e36e10a7 new script to run many games per device
I need it to be much closer to Android....
2023-11-27 21:32:43 -08:00
Eric House
47004a0e08 linux: remove ask to accept duplicate invitations 2023-11-26 19:58:07 -08:00
Eric House
67cf8518de pass topic to ack() (so unretain can work) 2023-11-07 19:55:32 -08:00
Eric House
e78d9fbc33 add quashed to summary, and show as part of games-list state 2023-11-06 13:11:34 -08:00
Eric House
3dcac063b5 show quashed state in net state icon (DEBUG only) 2023-11-06 13:11:34 -08:00
Eric House
259357a818 reduce sending of dead-game mqtt messages
Two cases dealt with here. First, if my opponent deletes the game when
I have an un-ack'd message, I'll keep sending it forever. Fix is to
flip a bit in comms in response to a game_gone event so no more
sending will happen. (Better than emptying the queue, as it leaves
open the possibility of resurrecting the game with code changes
later.) Second, if there's a retained message from a dead game I'll
keep receiving it until it's replaced, and if the game's dead it never
will be. Fix is to add a new api endpoint noSuchGame() to the relay2
server and to call it on receiving a message for which I have no game
to deliver it to. The endpoint "unretains" the message so I won't get
it again unless it's resent.
2023-11-05 12:01:43 -08:00
Eric House
ee2a4aaf72 fix failure to deliver ACKs on MQTT
My combining messages logic failed for ACKs, sending the queue but not
the ACK unless the ACK was in the queue. Appending it at send time is
fraught, so I am instead adding ACKs to the queue, but not persisting
them, so they only last long enough to be sent after they're
added. Seems to fix a common problem of games failing to get ACKs for
their final messages after they finish.
2023-10-26 15:37:50 -07:00
Eric House
629696144f Fix ARM compile by copying rather than casting struct ptr 2023-10-25 13:55:51 -07:00
Prod User
7f1eec654c fix linux client test to compile and run on Anlinux proot on Android tablet 2023-08-14 08:11:01 -07:00
Eric House
76c0ce3a2e add common/ to saved logs
This is risky because requires that the untested way I map threads to
env always work -- but the risk is to DEBUG builds only.
2023-07-18 16:07:26 -07:00
Eric House
185f25953d cleanup: add an assert and remove some logging 2023-07-01 12:14:07 -07:00
Eric House
bc0478abbf include player-specific dicts in gi_copy 2023-05-21 08:40:59 -07:00
Eric House
4dbb7362dd add dbg-only menuitem to set mqtt devid 2023-04-26 13:57:21 -07:00
Eric House
3c56490c01 fix to read any length string from stream 2023-04-21 17:50:01 -07:00
Eric House
dc0c63dc24 don't crash if chat message length > 255 bytes
Crash instead if exceeds 1K. That needs a more complex fix.
2023-04-21 16:51:52 -07:00
Eric House
8c60b99e82 remove some asserts Frank's seeing 2023-04-20 14:24:10 -07:00
Eric House
f9d3f9fd4e fix assertions around dropped (because ancient) messages
I'm seeing these only when opening games several years old, and they
shouldn't matter on release builds. Still....
2023-04-18 20:55:46 -07:00
Eric House
f8c5a4ea58 add assert 2023-04-18 20:55:46 -07:00
Eric House
131826d34f fix release build 2023-04-06 20:22:29 -07:00
Eric House
9a5b1d466d send invites as invites, not messages
Fixes sending of invitations on Android
2023-04-06 19:54:50 -07:00
Eric House
e09fb6776a don't report game as deleted until it's at least connected
Otherwise remote might not have even saved it yet so of course it
won't exist.
2023-04-04 19:55:55 -07:00