Eric House
2e5f6128f2
post new msg message from relay2
...
This is to have a utility back, but mostly to start playing with being
able to send keepalives to a device that have nothing to do with moves.
2022-01-06 19:07:08 -08:00
Eric House
a8963c952e
use variable length ints to store msgID and len
2022-01-04 11:12:58 -08:00
Eric House
759cf12ecf
set bingoMin
2022-01-03 20:23:00 -08:00
Eric House
38c80209c4
fix crashes and failure to connect
...
Seems to be back to working now.
2022-01-03 17:40:23 -08:00
Eric House
a85f5df4e3
another tweak: make version imply format
2021-12-29 07:35:43 -08:00
Eric House
b67ab9e32a
refactor, and make msgids variable-length
2021-12-28 20:59:15 -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
140e1210cc
cleanup
2021-12-22 13:01:22 -08:00
Eric House
2b7daf067d
shrink the comms header
...
Sending in 32 bits what can probably fit in 8 -- twice -- is dumb. As is
sending the gameID (as connID) when it's already known. In 2016 I added
a fixed marker, so I can count on all current code sending that. If I
fail to find that, I know the sender is new (current release or better.)
In that case, use 12 bits instead of 32 for two fields, drop the marker
and the connID. Result is that an ACK's size, including MQTT headers,
drops from 28 bytes to 21.
2021-12-21 16:34:04 -08:00
Eric House
0fa43a7394
remove duplicate code
2021-12-16 08:47:12 -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
79d77410a5
fix failure to send NO_SUCH_GAME over NBS
...
Wasn't sending zero-length messages, which this one is. Needs testing,
because there must have been a reason for that test.
2021-08-31 10:44:39 -07:00
Eric House
ea1c8125f8
use 16 bits to represent selected tiles
...
fixes selection of 9th tray tile during trade
2021-08-25 07:24:38 -07:00
Eric House
80f0e35755
allow trade when 7 tiles left, not 9
2021-08-24 21:24:17 -07:00
Eric House
694953c820
add support for trays with up to 9 tiles
2021-07-16 12:15:46 -07:00
Eric House
8f83a390f1
a bit o' cleanup
2021-06-30 11:47:26 -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
be698069a4
cleanup of recent changes
2021-05-14 11:34:15 -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
92200779ac
log connType in nli
2021-04-07 21:40:20 -07:00
Eric House
d74161958e
cleanup: remove dead and use new code
2021-03-28 20:27:24 -07:00
Eric House
2a20caa6d7
fix breakage caused by merge
2021-03-27 11:00:06 -07:00
Eric House
64ff2e5f69
Merge branch 'android_branch' into wasm
2021-03-27 10:27:14 -07:00
Eric House
7a7a2db6ce
enable chat (without history)
2021-03-24 15:58:25 -07:00
Eric House
561c5c9eb1
cleanup
2021-03-22 10:43:34 -07:00
Eric House
e3ba122ca0
fix to compile with XWFEATURE_RELAY undefined
...
Didn't change the stream format. That will wait!
2021-03-19 18:51:34 -07:00
Eric House
b1532f19a4
move getDict from dutil to util
...
It's in the context of a game, and we might want info about the game
when notifying the user. For wasm, though, I just download after failure
to open. User has to try again to open the game. Good enough for now
since missing a wordlist shouldn't happen if you're not me changing
where they're stored.
2021-03-19 17:27:17 -07:00
Eric House
87621c3b51
fix compile
2021-03-19 17:26:48 -07:00
Eric House
e86626d7be
don't crash if remote doesn't support chat
2021-03-19 14:30:17 -07:00
Eric House
1aa3ddcde0
cleanup and tweaks
2021-03-19 14:30:17 -07:00
Eric House
585f55c040
use notifications and other tweaks
2021-03-19 14:29:49 -07:00
Eric House
bf88c000b7
fix mempool tracking bug
2021-03-19 14:29:49 -07:00
Eric House
f3b76da8e1
add more info to game "buttons"
...
Toward a games-list substitute. New game_summarize method will get
fleshed out and eventually replace what's in jni?
2021-03-19 14:29:48 -07:00
Eric House
b0cc6dd744
clear name on delete; remove logging
2021-03-19 14:29:48 -07:00
Eric House
829242c9bb
fix to deal with failed downloads
2021-03-19 14:29:48 -07:00
Eric House
52b1300d90
cleanup; remove dead code
2021-03-19 14:29:48 -07:00
Eric House
970c2f6f9a
make android compile/run with wasm changes
2021-03-19 14:29:20 -07:00
Eric House
34aee3d7d0
add remaining langs to code-to-lang table
2021-03-19 14:29:20 -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
567c3dbf9e
show mempool stats (DEBUG builds)
2021-03-19 14:27:04 -07:00
Eric House
4937d13273
use indexeddb for storage
2021-03-19 14:27:04 -07:00
Eric House
2a6931fdcf
add and start using indexeddb via emscripten APIs
...
Replace a couple of load/store actions with new APIs that do so
asynchronously (using indexeddb underneath, via emscripten APIs.)
Required restructuring how app starts. More changes to come. The idea is
to replace wordlist storage: this'll keep 'em smaller and not require
conversion to string.
2021-03-19 14:27:04 -07:00
Eric House
d5e7dc4c97
game from a downloaded wordlist works!!!!
2021-03-19 14:27:04 -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
06b530c443
add notion of index to storage
...
I'm heading toward being able to know what all the games are by how
they're stored in a xplatform way. This is a start. Adding a second key
to storage, and looking at grouping everything where one key or the
other matches.
2021-03-19 14:27:04 -07:00
Eric House
61be81cf1a
invite known players
2021-03-19 14:27:04 -07:00
Eric House
534e245048
change load-from-storage to not require free()
2021-03-19 14:27:04 -07:00
Eric House
41cd3d8f39
open game to receive message
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
74109ce172
fix to send after connect
2021-03-19 14:27:04 -07:00
Eric House
7dc949fb38
choose font sizes to fit
...
Make on demand rather than guessing. Only wind up with six or so, so the
linear search is probably ok.
2021-03-19 14:27:04 -07:00
Eric House
96829b5478
fix so release build builds
...
without MEMDEBUG defined that is
2021-03-19 14:27:04 -07:00
Eric House
880bff747d
use js runtime for timers too
2021-03-19 14:26:18 -07:00
Eric House
c57471364f
get URL-encoded invitation receipt working
2021-03-19 14:26:18 -07:00
Eric House
4612ca70c7
snapshot: message exchange mostly works
2021-03-19 14:26:18 -07:00
Eric House
e3814bf0eb
snapshot: sends message to inviter
2021-03-19 14:26:18 -07:00
Eric House
9bc72d0745
move stream storage into super
2021-03-19 14:26:18 -07:00
Eric House
ec9570ab81
improve drawCell()
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
633896292a
snapshot: drawing empty board
2021-03-19 14:26:18 -07:00
Eric House
b62ab69799
add missing file
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
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
f9e1deabfc
don't include dict tiles/values in initial server msg
...
There's code on all platforms to force user to have dict prior to
opening a game or responding to an invitation. "Empty" dict play hasn't
made sense in a long time.
2021-03-19 12:50:19 -07:00
Eric House
ca88d9c0bf
backout ack change for now
2021-03-12 07:16:28 -08:00
Eric House
f947382f4c
in comms, send ack on receipt of duplicate msg
2021-03-11 21:43:26 -08:00
Eric House
6c50fcb818
cleanup; make original tiles-values choice the default
...
We've decided that on upgrade users shouldn't be surprised by a busy
board and unaware of how to fix it. So keep it the way it's been and let
the curious discover the new ability. Also, simplify code.
2021-02-17 15:47:55 -08: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
d3cf74920e
remove unused method
2021-02-10 19:37:19 -08:00
Eric House
0ea9b42db8
clear high-bit when generating gameIDs
...
postgres DB, at least on ARM, doesn't like it.
2021-01-25 07:58:49 -08:00
Eric House
ceec6e7468
fix crash verifying first tray can yield a move
...
Had never needed an engine for a remote player before. So create one on
demand and nuke after use.
2021-01-18 16:55:20 -08:00
Eric House
d41d5c700f
don't let first player have unplayable rack
2021-01-09 20:39:33 -08:00
Eric House
64a470185c
display known player timestamp when known (debug only)
...
For some reason it's getting cleared sometimes. Will fix.
2021-01-04 08:12:05 -08:00
Eric House
35bdd2282e
limit pattern parse by max length of tiles
2020-12-27 11:53:36 -08:00
Eric House
d0f5d9949a
handle two-letter tiles better
...
Choose the two-letter tile where possible. Not sure though if this is
always the right move.
2020-12-26 20:45:34 -08:00
Eric House
45bc623975
enable RAISETILE feature for linux and android
...
It's timer-based. Not sure I like that, but let's see how it feels
on-device.
2020-12-02 17:55:49 -08:00
Eric House
3760d735bc
fix compile when XWFEATURE_RAISETILE defined
...
Doesn't seem to work, and that's not addressed by this.
2020-12-02 17:21:47 -08:00
Eric House
31eeb1de43
when dragging, move crosshairs even over tile
...
Change so you still see dragging happening via crosshairs movement, but
the dragged tile itself doesn't move except over a place it can be
dropped.
2020-12-02 08:41:52 -08:00
Eric House
99a7930dfb
add loop to print a bunch of devids (disabled)
2020-11-29 11:43:19 -08:00
Eric House
623f3ad145
inform when client's game complete too
...
Board needs to know when to dismiss the waiting-for-host alert. A
similiar need host-side was handled from common/; do same for client
side.
2020-11-28 17:57:33 -08:00
Eric House
00588f50f3
show an cannot-play-yet alert on guest side too
2020-11-28 13:55:36 -08:00
Eric House
f3bb0c99a9
invite alert changes
...
Create new class that owns the alert. Let it decide whether to post,
remove, etc. Seems to work, but I've removed some of the "reinvite"
options I'm not sure were helpful anyway. To be considered...
2020-11-20 18:07:19 -08:00
Eric House
5d4fd0e58b
don't dispose gi before game
...
gathering players was failing because disposed gi was pointing at
garbage. I'm lucky it didn't segfault.
2020-10-23 19:03:26 -07:00
Eric House
af37fb45f7
Rewrite BT comms to not use a Service
...
It's simpler this way, and I'm tired of stuff not happening because the
OS chooses not to schedule e.g. an invitation send for minutes. Goal's
to be running BluetoothServerSocket.accept() as much as possible when
there are active BT games in play OR when the game's in the foreground.
If that's happening, sent invitations and moves will be received when
users expect. When there's no traffic and app isn't being brought to
foreground, backoff will ensure I don't try to run accept() too often.
FWIW, BTLE seems to offer a better way to do this (to have an app be
responsive to incoming invitations when it hasn't run in the foreground
in a while), but it requires users to accept FINE_LOCATION
permission. I'm hoping I can make this work to avoid asking for that
permission.
2020-10-21 21:10:09 -07:00
Eric House
9f1f1aeee7
only harvest when closing game
2020-10-01 13:39:02 -07:00
Eric House
21483cf861
add missing file
2020-09-30 20:38:44 -07:00
Eric House
f90d76329b
use semaphore to protect known players data
...
Requires adding a common method called by platform code on creating a
new dutil ctxt.
2020-09-30 17:21:18 -07:00
Eric House
dbde9c87ae
list known player in invite info where known
...
(for mqtt only)
2020-09-30 10:10:43 -07:00
Eric House
2b56b1f8b2
cleanup
2020-09-29 16:06:59 -07:00
Eric House
eb728e4368
fix crash: don't go beyond last edge
...
An obscure pattern from a user caught this one, but the test should have
been there all along.
2020-09-28 19:18:09 -07:00
Eric House
e9ec30206d
add debug-only field tracking place in iterator
2020-09-28 19:18:04 -07:00
Eric House
7b097ea67d
Don't allow duplicates when renaming
2020-09-28 11:17:51 -07:00
Eric House
8406d9e551
implement Known Player renaming
...
Used existing GameNamer which now needs to be made more general.
2020-09-28 08:59:39 -07:00
Eric House
aff75053ac
implement deleting known players
2020-09-27 20:52:56 -07:00
Eric House
9e78e47954
fix so non-drag movement stops timer to show words
...
The last change meant the test whether to show the words under the
pen-down cell would pass when it shouldn't because a drag to an occupied
location didn't register as movement. Change so movement counts to stop
the timer even if it wouldn't change the drag-target's location.
2020-09-27 17:32:23 -07:00
Eric House
80160d740f
null-terminate words buffer
2020-09-27 14:23:39 -07:00