Commit graph

1412 commits

Author SHA1 Message Date
Eric House
3dcac063b5 show quashed state in net state icon (DEBUG only) 2023-11-06 13:11:34 -08:00
Eric House
28318eb38a shorten file path in logs
Couldn't figure out how to do it at compile-time on Android.
2023-10-29 08:09:37 -07:00
Eric House
26ea25c011 fix to compile with old and new glib versions 2023-10-28 11:31:07 -07:00
Eric House
cae91d20cb Preliminary sketch of how cmd callbacks work 2023-08-14 08:11:01 -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
53ce78e1ed initial changes toward a new test script
Android has lots of games on a single device. My current test has one
device per game. I'm hoping to fix that, and am starting with figuring
out how the script and "device" instances will communicate.
2023-08-08 12:09:47 -07:00
Eric House
c488235ca7 make new compiler happy 2023-08-03 23:47:05 -07:00
Eric House
280fc3bfe1 fix failure to correctly pass devids into linux client 2023-07-18 21:35:17 -07:00
Eric House
41e8cbf20c fix concurrency issues with mqttcon's msg queue 2023-04-07 10:14:40 -07:00
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
f5f8ae9908 report negative tile count when games not started 2023-03-25 10:24:39 -07:00
Eric House
fb04a6ad0a fix server_getOpenChannel()
Only used by gtk for now but meant to replace hardcoded invitation
code everywhere.
2023-03-16 07:44:14 -07:00
Eric House
073271fe61 tweak test script to better test rematching 2023-03-08 20:48:55 -08:00
Eric House
1083cbd525 improve test script and fix rematching bug it found
Server needs to not rematch if any device has more than one
player (for now, as I'm too lazy to fix this rare condition.) I'm
moving toward having the linux client write status to a unix socket on
exit rather than having the test script parse the log file for
status. GameOver is there now. Tile counts should follow.
2023-03-05 10:23:48 -08:00
Eric House
8f1dfc9817 include rematching in test script
Add new script param setting a timeout before which games will be
rematched on finishing. Add new param to ncurses version telling it to
try to rematch when finishing. This introduces a new problem because
now there are multiple games per "device", and various log-grepping
stuff like listing the number of tiles in play or determing whether
device is finished all assumed one game. I addressed the latter by
adding a way to query the DB to see if all games are done, but that's
not quite right because the number of pending messages is increasing
after a game completes. Still, the testing is useful so I'm pushing
this.
2023-03-04 09:36:42 -08:00
Eric House
4ec6cfe17d plug memory leak 2023-03-04 08:54:31 -08:00
Eric House
9ca291cf0d enable rematch for 3- and 4-device games
Because only the host/inviter knows the addresses of all the devices
in a game it's hard for guests to rematch (unless it's a 2-device
game, as they know the host's address.) So now, as part of telling
guests the game is ready to play, include the addresses of other
guests. It's usually only 9 bytes per device, and only happens when
more than two devices are in a game.
2023-02-16 21:36:46 -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
d924776a84 make invitation to three-device games work on gtk/linux 2023-02-08 10:28:00 -08:00
Eric House
ad5514ac17 clean up error reporting for linux sqlite3 2023-02-05 09:09:26 -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
cea0b9659d remove unused files 2023-02-04 07:33:36 -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
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
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
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
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
a02ea95600 remove dead code: game_reset and friends 2023-01-11 12:28:09 -08:00
Eric House
8c8561e2ea linux: subscribe only after connect succeeds 2023-01-11 11:10:45 -08:00
Eric House
52d2543812 remove IP_DIRECT from Linux
If I support it in android it'll likely look different and I'll want
to start over.
2023-01-06 10:01:59 -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
837991feb4 remove timestamps from mqtt header and procs that feed it
It belongs in comms msg header. Also remove PROTO_2, which shipping
code can read but never could send.
2022-12-30 15:35:01 -08:00
Eric House
fdbd404f37 cleanup 2022-12-27 17:38:20 -08:00
Eric House
30136e22a1 remove relay options from test script 2022-12-26 19:40:57 -08:00
Eric House
1ae4f2d774 make relay-related commandline options compile conditionally 2022-12-26 19:31:23 -08:00
Eric House
3faf4687db don't call a game over until message count drops to 0
I'm looking for a test case to reproduce the Andorid situation where
invitations are never deleted from comms' queue and so prevent the
game from being considered over. Doesn't seem to happen in Linux, but
more tests are good.
2022-12-26 17:15:44 -08:00
Eric House
9b1fe83b61 fix to compile without DEBUG set 2022-12-21 10:29:48 -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
096c13614a use ifdefs to go back to using only old-style per-device topics 2022-12-18 16:17:05 -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
a2806f1c3f show known player name of missing host
This is for debugging use only for now, but it's useful when a host
seems non-responsive to know which it is.
2022-12-05 21:21:46 -08:00
Eric House
34f68a435b include game name in nli when rematching 2022-11-18 21:52:10 -08:00