Commit graph

1461 commits

Author SHA1 Message Date
Eric House
8097a6ba0b fix not indicating when no results 2020-04-28 15:24:32 -07:00
Eric House
e7c96290ea name change only
It was confusing using dict_ as the prefix for two "classes"
2020-04-28 15:24:22 -07:00
Eric House
b2bc4e34cf do wordlist lookups using tiles not chars
Fixing a problem with languages (like Hungarian) where it's legal to use
a two-letter tile or two single-letter tiles to play the same word. When
words are seen, or searched for, as char-arrays, there are
duplicates. Current code crashes, but there's also risk the user gets
unexpected behavior. Crash is fixed, and foundation laid for better UX,
by doing all searches for tile arrays. If a search string translates to
more than one tile array the user must choose. For that choice to make
sense it's now possible to translate tile[] to char[] with a delimiter
between the tile strings.
2020-04-28 13:29:12 -07:00
Eric House
182b8e0489 fix compilation where DEBUG not set 2020-04-26 13:49:54 -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
d4e71caed1 fix warning 2020-04-24 06:34:30 -07:00
Eric House
d01fd5de1c inval score when face for blank chosen
If I'm displaying real-time whether the score is legal, I need to recalc
it after the user tells me what tile a blank is standing in for.
2020-04-22 21:28:27 -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
da0916fdd1 Fix including empty messages.
They're only there when somebody is trying to force an immediate send.
Also, add a bunch of logging of the contents of message arrays being
returned
2020-04-22 21:28:27 -07:00
Eric House
5db0345ffd add util for logging NetLaunchInfo contents 2020-04-22 21:28:27 -07:00
Eric House
29dbeebc94 fix assert with reporting no bad words
Several changes toward not allowing bad things to happen
while waiting for a confirmation from the host
2020-04-22 21:28:27 -07:00
Eric House
0dc39b5d85 clear pending move before applying phonies rejection
If slow network traffic has given a guest time to move tiles to the
board while the host decides its last move must be rejected, those tiles
must be removed before the rejected turn can be undone.
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
5a28a7fc27 fix gtk games connecting to relay/each other
I broke gtk back in February making curses changes
2020-04-22 11:38:48 -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
ddb01d8930 refactor: struct ptr replaces a bunch of params 2020-04-19 10:44:57 -07:00
Eric House
ac376c5dd9 set turn to -1 while waiting for phonies check
When a guest sends a move to the server it's not the next player's turn
until the server checks the move and rejects or accepts it. It was
possible still to manipulate the board, playing new tiles, and even to
attempt to commit them. And if the move came back rejected, the bogus
committed one would be that was cleared. Bad. So I'm just setting the
turn to -1, which disables board etc., and letting nextTurn() assigne it
after the confirmation comes back.
2020-04-19 08:57:54 -07:00
Eric House
3a0294044e fix crashes when actual bad words sent
Same as before, needed to explicitly set the state back to
XWSTATE_INTURN after doing the work the special state required.
2020-04-18 07:31:03 -07:00
Eric House
72cb12f383 fix crash anytime you used PHONIES_DISALLOW
Yikes. I used to assert, in nextTurn(), that you were in the right
state. On release builds that went away, and you were moved into the
right state regardless. The bug happened when I changed that to exit
nextTurn() without changing the state, meaning that for PHONIES_DISALLOW
the host filled up its message queue trying to communicate that the
latest move was ok, never getting out of the state that required sending
that message. The fix is simply to change the state after sending and,
guest-side, after receiving, that message.
2020-04-18 06:14:29 -07:00
Eric House
ab07c1c466 show bonus-square-held
Again, so I can see what's going on. Use timeout so doesn't force
lifting the mouse, closer to what happens on Android with Toasts.
2020-04-17 07:06:31 -07:00
Eric House
388fc4f871 don't offer to display empty list of words 2020-04-17 06:52:36 -07:00
Eric House
5f7bb30307 fix crash: don't offer to commit an illegal move! 2020-04-16 22:54:46 -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
Eric House
87802150d5 fix logging macro to allow a single argument 2020-04-10 07:12:56 -07:00
Eric House
497007a84f show pending name in scoreboard
when remote hasn't arrived, show same string in scoreboard as in games
list rather than the local player's default name -- duh.
2020-04-10 07:12:56 -07:00
Eric House
c0dd9a4ccc upgrade to latest gradle version
Required redoing how I invoke the NDK. The limititations I had to hack
around before seem fixed, so this is probably better. But there will be
glitches. :-)
2020-04-10 07:12:56 -07:00
Eric House
0a696cf203 cleanup 2020-04-10 07:12:56 -07:00
Eric House
387d88bdde fix assertions when duplicateMode on
Hadn't tested in a while and fixing undo problems added some invalid
assumptions.
2020-04-10 07:12:56 -07:00
Eric House
ac6373afa7 fix crash when chat message is too long
Len byte was limited to 255, but would get clipped (masked with 0xFF)
then all the string data would get written. So on receipt, the clipped
length was taken to be that of the string data, with the rest of the
string to be interpreted as something else. An array index, in this
case.
2020-04-10 07:12:56 -07:00
Eric House
c1597cc941 recover from corrupt chat player index
This should never happen, but it did and I want to stop local crashes to
investigate.
2020-04-10 07:12:56 -07:00
Eric House
cd0cf0c3f2 tweaks to logging 2020-03-24 15:59:33 -07:00
Eric House
8bd623d91a fix NFC
A change in how sendMsg() figured out what address types to use dropped
NFC, breaking sending on Android. Fix.
2020-03-24 15:58:06 -07:00
Eric House
5611d17849 fix so games don't stall after undo
With these changes the test script no longer produces games that don't
finish. I think they are recovering from the problems produced by one
device doing an undo while another is making a move, or other problems
produced by undo being allowed to happen on any device at any time, but
haven't analyzed the games beyond the test script's verifying that they
all finish with a Winner after all tiles are consumed.
2020-03-19 16:53:44 -07:00
Eric House
5cae732a60 fix release builds 2020-03-17 20:33:24 -07:00
Eric House
dbb897826e tweak logging 2020-03-14 19:33:58 -07:00
katianderic
1d8bb1d0db fix Android build (requires adding new comms method) 2020-03-14 18:52:28 -07:00
katianderic
b1f7b13e78 toward fixing stalls when undo used
There are still some stalls turning up when running the test script,
especially with more than two players in a game, but but it'll be
easier to do the final debugging off my pathetic travel-only
chromebook. And things are already much better. :-)
2020-03-14 14:47:26 -07:00
katianderic
901b70a5f2 get rid of legacy "incorrect" stuff around hashing 2020-03-14 13:44:56 -07:00
katianderic
1a082f7f15 let move stack determine whose turn it is
When something goes wrong with a move (typically because of undo), the
move stack and server's idea of whose turn it is get out of
sync. Since it being my turn means it's up to me to put the next move
on the stack, let the stack own "next turn". (Can probably eventually
get rid of the ServerCtxt variable that tracks it.)
2020-03-14 13:44:56 -07:00
katianderic
781021d6ca trivial changes to aid debugging 2020-03-14 13:44:56 -07:00