Commit graph

1784 commits

Author SHA1 Message Date
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
Eric House
d0a53ab3ff send invites as invites, not messages
Fixes sending of invitations on Android
2023-03-27 14:33:14 -07:00
Eric House
50ac11970e fix assertion failure when sending single unqueued message 2023-03-26 10:37:45 -07:00
Eric House
885a20845a don't send null msg queue 2023-03-25 15:31:15 -07:00
Eric House
1a8f91203e Send MQTT messages in batches
Resend sends all types in batches. Send of new messages goes back for
MQTT only and sends the whole un-ack'd queue.
2023-03-25 10:24:39 -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
22d0d50130 add a public part of MsgQueueElem to simplify passing outside 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
b811653c89 remove ifdef-d out code storing all messages in one queue 2023-03-25 10:24:39 -07:00
Eric House
7929ddea47 cleanup comms 2023-03-25 10:24:39 -07:00
Eric House
daac5ca098 store messages in channel rather than a single queue
Moving toward being able to send in groups per device for MQTT
optimization
2023-03-16 07:44:14 -07:00
Eric House
b27384df63 print caller in logging func 2023-03-16 07:44:14 -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
e849d628d9 log when messages could be combined 2023-03-16 07:43:51 -07:00
Eric House
bb2a2dacae cleanup 2023-03-08 20:48:55 -08: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
ac75da2028 fix leak rematching games on 3+ devices 2023-03-04 09:30:58 -08:00
Eric House
4ec6cfe17d plug memory leak 2023-03-04 08:54:31 -08:00
Eric House
07cd95e715 use github code to implement md5sum for mqtt msg ack (wasm only) 2023-02-26 19:53:12 -08:00
Eric House
22bf6c596a as copied from https://github.com/Zunawe/md5-c 2023-02-26 19:53:12 -08:00
Eric House
b758cd3f0f respond to invitations coming in as argv params
including downloading wordlist if necessary
2023-02-26 19:53:12 -08:00
Eric House
32275017a6 implement rematch 2023-02-23 15:51:40 -08:00
Eric House
a0f5e2d5d4 remove dead code 2023-02-23 10:55:05 -08:00
Eric House
5382941f63 snapshot: play via MQTT works for a while 2023-02-22 19:52:45 -08:00
Eric House
78d84a941e compiles, but untested
And certainly won't work!
2023-02-22 19:04:05 -08:00
Eric House
fd36590e7f fix assertions that assumed multi-device 2023-02-21 17:32:21 -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
ee859a6c6a cleanup: remove dead code 2023-02-15 08:31:51 -08:00
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
d924776a84 make invitation to three-device games work on gtk/linux 2023-02-08 10:28:00 -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