Commit graph

73 commits

Author SHA1 Message Date
Eric House
c099ea30e6 remove unnecessary saves
all games are saved on app-shutdown now
2023-11-27 21:32:48 -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
3dcac063b5 show quashed state in net state icon (DEBUG only) 2023-11-06 13:11:34 -08:00
Eric House
6ec0e64657 toward changing APIs to allow combined messages for mqtt 2023-03-25 10:24:39 -07: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
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
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
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
16ced1dd49 fix linux compile; log gameID as %X everywhere 2022-12-30 16:15:03 -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
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
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
1e447e9d60 move TransportProcs into cGlobals to fix gtk crash 2022-11-18 11:09:22 -08:00
Eric House
47ea296c39 fix crash by passing missing proc ptrs 2022-11-18 11:09:22 -08:00
Eric House
7587653541 fix memory leaks; get curses using new invite resp. code 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
b9c6551e8b merge android_branch changes to comms_make
Not tested at all on android
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
5bc2a38439 fix so invite via SMS works too (discon_ok2 test passes) 2022-11-18 11:09:22 -08:00
Eric House
8a91970ba8 add sms for curses (untested) 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
381b014b8b change name for clarity 2022-09-06 11:40:09 -07:00
Eric House
4996d3fe89 improve comms address tracking (breaks android for now)
Remove legacy relay-inspired logic around comms addressing. Now when a
device creates a game it's required to provide its "self address," and
if it's a client, the address of the host (which it presumably got
through the invitation in response to which the game is being
created.) Then as registration messages come in from clients, the host
gathers their addresses as always.
2022-09-06 11:40:09 -07:00
Eric House
51abc98647 use same variable name throughout 2022-07-08 21:57:42 -07:00
Eric House
ba132bb23d Replace LangCode with ISOCode, linux and common side
This will break the Android build, but it's the order in which I
work...
2022-06-05 09:07:01 -07:00
Eric House
0eaa71fce6 remove relay from linux client via conditional compile 2022-05-10 20:54:25 -07:00
Eric House
da23bfe23b add debug pref to not add mqtt to all games
I want it for testing that stuff like NBS (data SMS) works for more
than connecting. MQTT works so well nothing ever gets used once it's
there.
2022-05-09 15:10:15 -07:00
Eric House
0e1f10b802 fix assertion by adding missing methods
They're stubbed out; hope they're unused. :-)
2022-03-10 13:06:03 -08:00
Eric House
afc3ff156e make game ask for dicts when needed
It's awkward for platform code to create a dictionary prior to opening a
game whose data contains the information about what dict to open. So add
a dutil method to fetch a dict, and call it from inside game opening
code. Makes linux code better at least.
2021-03-19 14:27:04 -07:00
Eric House
be0a6f83f3 drive letters/values from a three-value enum
There are three choices now. The button pops up a menu on android and
moves through the choices on linux.
2021-02-11 14:11:02 -08:00
Eric House
7fd82b4831 fix to compile on raspberry pi (64-bit ARM) 2020-12-15 10:02:51 -08:00
Eric House
d17ac7ea0b rename gamesdb public functions (linux only) 2020-09-26 09:48:35 -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
Eric House
88335d38f2 stop using thread->env mapping for util callbacks 2020-04-26 13:39:21 -07:00
Eric House
eb9ef738e4 remove comms/transport from using thread->env map 2020-04-26 13:39:21 -07:00
Eric House
b7b7da795a remove use of thread->env mapper for drawing 2020-04-26 13:39:21 -07:00
Eric House
cfaa6849b2 pass env into dict-related methods
I was getting an occasional crash using a stale env to delete a dict's
resources because the dict was cacheing the env that created it. Dumb!
Using the thread->env mapping stuff worked, but that felt risky and so I
tried just passing it in. It's safe, and involves an amount of change I
can tolerate. So likely going that way.
2020-04-26 13:39:16 -07:00
Eric House
b618c99fa8 just print the upper-case versions of tile faces 2020-04-24 22:21:02 -07:00
Eric House
cbf81c64bd track and pass all words when phonies==BLOCKED 2020-04-24 14:58:17 -07:00
Eric House
99df8806c3 wrap test-only feature in new compile-time flag 2020-04-24 13:33:40 -07:00
Eric House
f51030186f fix non-debug build warnings 2020-04-24 08:54:57 -07:00
Eric House
4720ede1d7 fix so curses app can invite two players on one device
Turns out the host, when inviting a remote device, needs to know how
many players are on it (since more than one is supported and the script
currently generates that case.) So pass to --server devices an array,
one per remote -- but don't bother when all entries are "1";
2020-04-22 21:28:27 -07:00
Eric House
9d04b97ec8 add option to have robot words reversed
With reject-phonies set this will trigger the reject path.
Also init CommonPrefs in jni land since its makePhonyPct, left unitialized,
causes the robot to deliberately reverse every turn, firing an assertion that the
robot's moves are legal.
2020-04-22 21:26:55 -07:00
Eric House
410bc00d2e add test for being in background 2020-04-22 11:44:46 -07:00
Eric House
54efffa635 pass the wordlist name too 2020-04-20 09:34:14 -07:00
Eric House
10f509ea1f pass and display the blocked word 2020-04-19 22:27:14 -07:00
Eric House
c0f074c1bf support new phony to block words not in dict
Currently detects the same as tiles not in a line and calls out to a new
util method that's currently parameter-less. On Android the option only
appears in d variants.
2020-04-19 17:31:31 -07:00
Eric House
988facccd1 refactor: make vtable population test xplatform 2020-04-19 12:56:11 -07:00
Eric House
b81bd46645 remove assertion when message mis-delivered
I don't know why, but in my tests the relay seems to be delivering
messages to the wrong device. The linux device detects this. It used to
assert, but now just drops the message. If this is happening on Android
it might be why I'm seeing crashes...
2020-04-11 11:44:09 -07:00
katianderic
126172220f changes to fix curses app test script
especially on the 'sms' side it was broken. Now Android's broken for sure.
2020-03-14 13:43:43 -07:00