Commit graph

1430 commits

Author SHA1 Message Date
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
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
12d8a092d7 move getUsername() to dutils to avoid crash
Being in util meant the default implementation got called, and that
returned a null string: boom.
2022-11-18 11:09:22 -08:00
Eric House
e960877256 more 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
0ed20391c3 save game before summary (summary does UPDATE only, not INSERT) 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
3923a2d9a6 check for duplicate invites; don't create if found
Add dutil proc haveGame() and use it to detect duplicate
invitations. I'm passing, but ignoring on android, the channel, which
means that for now you can't invite yourself and on-device testing
requires having CrossWords and CrossDbg or a second user.
2022-11-18 11:09:22 -08:00
Eric House
980ba68297 fix stuff crashing android 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
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
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
61faf1a730 support comparing SMS addresses too 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
0663bbab5b fix test script param 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
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
2c80787f5c fix gtk invite for sms 2022-08-26 13:26:03 -07:00
Eric House
4ba1b2418c cleanup: remove some relay stuff 2022-08-25 11:20:26 -07:00
Eric House
c00bbf8ef1 simplify move expl tracking; don't show for dup-mode robots
Removed a boolean that seemed unnecessary. Stopped showing
move-explanations for robots in duplicate mode. They were being shown
too early thanks to bad logic, but I don't think there's any call for
them at all. A robot's move is only interesting if it's the one that
wins the turn.
2022-08-04 16:03:07 -07:00
Eric House
e6d516ca1d remove assertion firing in dup mode
The assertion's clearly blocking testing, but I'm not sure it's not an
error for two move explanations to want to co-exist. For now they're
concatenated.
2022-08-01 13:05:19 -07:00
Eric House
7d3502eddd cleanup and force draw
Got rid of pre-cairo drawing stuff, but that didn't fix drawing not
happening without something like a window resize to force it. Instead
I added a manual gtk_widget_queue_draw() call. It's gross, but I'm
this app's only user. :-)
2022-07-31 17:57:57 -07:00
Eric House
9357328747 Fix curses api misuse flagged by new C compiler 2022-07-28 12:00:12 -07:00
Eric House
51abc98647 use same variable name throughout 2022-07-08 21:57:42 -07:00
Eric House
882c717add cleanup/fix compiler warning 2022-07-07 10:00:24 -07:00
Eric House
2dfc9129f3 add timestamp to saved msgs, modify mqtt header to include later
I want receiver to know when message was originally created. This adds
timestamp to messages and passes it via send proc. Client needs to
send it where possible. So far, MQTT format can't include it without
change, so I'm adding a new proto version. This change can read the
new version. Once that's well-enough distributed I can start sending
using it. Other transmission types than MQTT are for later.
2022-06-29 12:34:27 -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
8c335aace3 fix crash on shutdown (post-relay world) 2022-05-28 08:49:07 -07:00
Eric House
df1606c8fb use ifdef to remove relay-only params 2022-05-15 12:10:37 -07:00
Eric House
5f4dd46f72 rip out most devid stuff 2022-05-10 20:54:26 -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
338106dc81 gtk: make inital empty games window bigger 2022-04-20 13:17:07 -07:00
Eric House
5d6d8c7499 bring in changes to make larger boards work for linux
Includes making tile sets vary with board size, calculated from 15x15
unless present in the wordlist. Likely breaks android.
2022-04-04 10:39:29 +02:00
Eric House
3f7885ff59 ignore .xwd files 2022-04-04 08:15:51 +02:00
Eric House
9568e4ab03 move extra counts into header so new dicts backward compatible 2022-04-01 07:51:13 +02:00
Eric House
4b1795cd5b fix crashes when quad-{word,letter} present 2022-04-01 07:51:13 +02:00
Eric House
372d722b58 make number of tiles proportional to board size
Until there's a way to specify specifically for each size, adjusting
from the built-in 15x15 tileset works reasonably well.
2022-04-01 07:51:13 +02:00
Eric House
b34190d62d make 21x21 work on Android
Still needs default colors and the bonus square values working for
smaller sizes.
2022-04-01 07:51:13 +02:00
Eric House
cb2d847e6d add bonus squares for 21x21 board (linux only) 2022-04-01 07:51:13 +02:00
Eric House
55db35867b add --board-size for testing 2022-03-13 15:02:08 +01: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
2d6ce6cfda fix problems with tile picking introduced by 9-tiles
Not sure if these would show up if you're not picking face-up,
but if so they justify a release.
2022-01-20 22:14:13 -08:00
Eric House
924511ac82 remove "room" from relay stuff
which is going away anyway....
2022-01-20 22:14:13 -08:00
Eric House
7546d82876 If can't create new game, say so; don't crash
In curses version there's no new-game dialog, so if the params passed in
don't give enough information NewGame menu can't be handled. Rather than
asserting later, refuse after posting an explanation.
2022-01-17 20:00:04 -08:00
Eric House
a9e44fe132 include line num in log 2022-01-03 16:53:28 -08:00
Eric House
a85f5df4e3 another tweak: make version imply format 2021-12-29 07:35:43 -08:00
Eric House
863ef88c22 add varible-length int encoding to streams
And test code that should be removed from linux client at some point.
2021-12-28 18:25:05 -08:00
Eric House
483a49ad67 fix so mqtt really is the default 2021-12-21 16:34:04 -08:00
Eric House
f49ec19921 make test script default MQTT-only 2021-12-15 10:06:14 -08:00
Eric House
14c879a752 fix so ack format is same for DEBUG and RELEASE builds
Was appending garbage to ACKs that, somehow, receiver didn't
mind. Fix. And use the new BEEF format for linux too.
2021-12-15 10:03:09 -08:00
Eric House
5f1f37a7a2 fix gtk bug not terminating buffer 2021-08-24 21:24:55 -07:00
Eric House
e19f1042cb add option to force number of tiles in tray 2021-07-16 12:15:49 -07:00
Eric House
694953c820 add support for trays with up to 9 tiles 2021-07-16 12:15:46 -07:00
Eric House
9d1214d604 hide dup details when no dupe games present 2021-06-28 12:58:55 -07:00
Eric House
5764a752a7 add default mqtt server to test app 2021-05-30 16:39:55 -07:00
Eric House
e667291da5 show invitee name where possible
When I've invited a Known Player, use that player's name in parens in
scoreboard and games list elem/summary until a remote device connects
(usually in response to an invitation) and provides an actual player
name. Makes it much easier to tell one pending game from another. And
doesn't really work (yet) where there's more than one remote player in
a game.
2021-05-30 13:31:33 -07:00
Eric House
53311acb7f update linux README 2021-04-25 20:57:13 -07:00
Eric House
daf5894d79 call new web api to ack mqtt messages
This is toward debugging. Not sure it'll be use to add functionality yet.
2021-04-19 07:04:58 -07:00
Eric House
2a20caa6d7 fix breakage caused by merge 2021-03-27 11:00:06 -07:00
Eric House
52b1300d90 cleanup; remove dead code 2021-03-19 14:29:48 -07:00
Eric House
f0d8a71deb split dict faces using js so utf8 chars are ok
As with java, the platform knows utf-8 better than vanilla C, so use a
JS inlined function to split a binary stream into its "face" components.
2021-03-19 14:29:20 -07: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
7924c046d6 fix linux compile 2021-03-19 14:27:04 -07:00
Eric House
23cb7bb85d unsigned->signed to fix drawing garbage in empty tiles 2021-03-19 14:27:04 -07:00
Eric House
9bc72d0745 move stream storage into super 2021-03-19 14:26:18 -07:00
Eric House
d620461574 fix so all compile 2021-03-19 14:26:18 -07:00
Eric House
d5546b484d cleanup (mostly non-DBG compile errors) 2021-03-19 13:03:39 -07:00
Eric House
fb0807c14b fix so 0-percent works 2021-03-19 12:50:37 -07:00
Eric House
3f6f16c2f4 add script to print comms msg exchange details 2021-03-19 12:50:32 -07:00
Eric House
f335ea7ad9 remove or tweak logging 2021-03-19 12:50:28 -07:00
Eric House
5fa44e54fa remove unneeded .h file 2021-03-19 12:50:23 -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
64f1d83b5d show-values mode now means show along with face
not instead of. It now feels as if it should be a global setting, not a
per-game thing to toggle. We'll see what folks think.
2021-02-10 20:43:11 -08:00
Eric House
2927ded334 default undo pct to 0
Until it's fixed don't need to be have tests always fail for a known
reason
2021-01-18 16:27:16 -08:00