Commit graph

1346 commits

Author SHA1 Message Date
Eric House
84f636cbd5 always resend via SMS when opening game
It's done for other comm types too, and is necessary to get linux test
script to pass once I make SMS delivery unreliable. But it may duplicate
the tickle that Android's doing and result in duplicate messages: test.
2018-07-17 07:05:33 -07:00
Eric House
352d87a327 use stream to take apart untrusted message safely
add new stream getters that return false if reach EOS and use them to
exit early and safely if incoming SMS msg is misformatted. I'm getting
random garbage meant for other apps perhaps.
2018-07-13 22:41:52 -07:00
Eric House
669acdcd19 log checksum of messages into smsproto 2018-07-13 07:39:11 -07:00
Eric House
c45c9cd809 read format spec outside assert
since the read inside goes away in release builds!
2018-07-13 06:59:57 -07:00
Eric House
b8c2cd1dd5 don't assert when a stray message wanders in 2018-07-12 20:20:04 -07:00
Eric House
df8558e071 delete partial messages when count mismatches
Had an assert fire when a message ID was reused with a different count.
It was likely because of messages crossing between two variants, but
still, fix: delete what's been saved so far when a new count shows up.
2018-07-12 08:13:32 -07:00
Eric House
95ac66370c fix off-by-one preventing delayed messages from sending 2018-07-10 07:08:57 -07:00
Eric House
9c2a722cc5 change two method names 2018-07-10 07:07:30 -07:00
Eric House
8c14ccc0d2 add new dutil to store by ptr; use for smsproto msgID 2018-07-10 06:36:34 -07:00
Eric House
e898dc509c plug leaks 2018-07-07 23:03:26 -07:00
Eric House
13cc6c79f1 add save/restore of partial messages
Handles case where the app receives only a subset of the SMS messages
into which a larger game-level message has been broken. Now when it
restarts and the remaining parts come in the whole can be reassembled.
2018-07-07 22:56:32 -07:00
Eric House
1941642607 add load and store to dutils, and implement with stubs 2018-07-06 06:56:54 -07:00
Eric House
2e9fbb8204 add common implementation of the SMS proto stuff
And use in linux client. Goal here is to reproduce then improve the
Android SMS pre- and post-processing stuff with a common/ implementation
that can be tested on linux and used wherever.
2018-07-05 21:40:56 -07:00
Eric House
ed90c9c16d implement util->dutil split for Android
So now all jni code uses a single dutil context, but also a single
mempool and jniutil instance instead of new instances of the latter two
per game and dict-iteration.
2018-07-05 08:32:19 -07:00
Eric House
d4436b7706 Break part of util into dutil
Trying to separate what's game-specific from what can be app/device
specific (i.e. with a long lifespan, and available when a game isn't
open.)

Android will be broken after this commit and fixed after the next
2018-07-05 07:58:50 -07:00
Eric House
d46a4d13ba use mem_stream_make_raw() where possible in common code 2018-06-27 23:42:50 -07:00
Eric House
976db7b181 add mem_stream_make_raw 2018-06-27 23:24:45 -07:00
Eric House
382718bcb0 init variable
This might have made valgrind happier, though it's been a while. Can't
hurt.
2018-06-13 14:34:31 +03:00
Eric House
d240e30bf4 test script: log and show tiles left in tray
Once the pool count drops to 0, start showing the number of tiles left
in the user's tray. This prevents there being a long time when nothing
seems to be changing *and* the script from exiting early because it
thinks all games are hung.
2018-05-25 21:36:25 -07:00
Eric House
535dc29646 silence warning 2018-04-18 21:54:51 -07:00
Eric House
cee7d696fc fix stuff to make valgrind happy 2018-04-17 21:13:53 -07:00
Eric House
ff82aa4251 fix asserts that fire when test script includes undos
When I used the --undo-pct flag in discon_ok2.py asserts occasionally
fired. This fixes that, and seems not to break anything.
2018-04-14 10:42:53 -07:00
Eric House
317df71588 more valgrind fixes 2018-04-14 10:17:12 -07:00
Eric House
fecbfdddb6 tweaks to logging for stack hash debugging 2018-04-08 20:46:35 -07:00
Eric House
a221ae43f4 flip arrow when board flipped
Fixing https://sourceforge.net/p/xwords/bugs/8/, flip the arrow before
placing it on top of the tile just returned to the tray.
2018-03-22 07:20:17 -07:00
Eric House
de01c1aadb cleanup/modernize (should be no behavior change) 2018-03-01 08:13:38 -08:00
Eric House
c7bcccf979 cleanup. Should be no behavior change. 2018-02-28 19:23:36 -08:00
Eric House
75c48ddcc5 remove excessive comments 2018-02-28 06:49:35 -08:00
Eric House
760aa3d304 juggle tiles in generated moves (debug only)
Got a report of crashes due to corrupt move records. Given I rarely see
them I wondered if it's because the hint- and robot-generated moves I
work with have tiles in order. So now on debug builds tiles in moves
from those sources are randomly rearranged (as if the user had formed
the word in random order.) The bug isn't showing up, but I figure the
test's worth keeping.
2018-02-28 06:44:44 -08:00
Eric House
aacb0486f5 fix release-only bug showing duplicate moves
The fix I made earlier for this relied on a callback that was skipped in
release builds. Now always take the path that involves making the
callback when one is provided. Also remove an optimization that was
trying to eliminate possible moves based on scores prior to doing the
more expensive full check. In 2018 I prefer simplicity, and can make the
remaining code faster if that's required.
2018-02-18 12:29:30 -08:00
Eric House
4504302b3b make "release" builds compile again
Release isn't really a thing on linux, but I'm fixing something that
only reproduces when DEBUG is undefined.
2018-02-18 11:30:54 -08:00
Eric House
59b82d242c return from only one place. 2018-02-02 21:17:23 -08:00
Eric House
19a6672785 don't show current players tiles in list of remaining 2018-01-18 22:02:06 -08:00
Eric House
4f7a12f5a1 don't claim "no move" when search interrupted
I *think* the reason I'm occasionally seeing toasts about not finding a
move is that when the engine's interrupted by there being a UI event in
the queue that error is posted. Instead try posting only when at the end
of the search nothing's been found.
2017-12-31 09:54:55 -08:00
Eric House
6de1305c8e don't show error twice 2017-12-30 15:15:52 -08:00
Eric House
ec075eff18 comment out assertion that's firing when db wiped 2017-11-11 18:49:23 -08:00
Eric House
057728c287 make gtk include an invite ID in rematch invitations
otherwise Android refuses to accept the second "" it receives.
2017-11-11 16:39:09 -08:00
Eric House
f2c4c82129 a shot at no-conn connecting
Ideally the comms module wouldn't go through its connecting routine in
order to join a game. To that end I added a join() method to relay.py
and code to call it. Joins happen (pairing games, starting new ones,
etc.), but after that communication doesn't. First part of fixing that
would be to make cookieID persistent and transmit it back with the rest
of what join sends (since it's used by all the messages currently sent
in a connected state), but I suspect there's more to be done, and even
that requires a fair number of changes on the relay side. So all that's
wrapped in #ifdef RELAY_VIA_HTTP (and turned off.)
2017-11-10 21:34:02 -08:00
Eric House
c4312a2158 new files that may replace GSList in relaycon
If I want to move relaycon into common so Android can use it (assuming
the jni code starts including json-c and libcurl so it can handle
networking) I'll need a replacement for GSList. This is a start.
2017-11-04 09:27:33 -07:00
Eric House
55f5b500e3 cleanup: method names and logging 2017-11-02 06:19:35 -07:00
Eric House
3045697d31 wip: process moves received 2017-10-19 21:20:14 -07:00
Eric House
baf549189c add compile-time option for forcing square board
Disabled. Needed it for a test.
2017-09-13 07:38:22 -07:00
Eric House
bd250cfe1e log before asserting 2017-07-19 07:16:18 -07:00
Eric House
52a1ccd4dc tweak comments 2017-07-19 06:16:22 -07:00
Eric House
bdc1f5ff51 when game full drop message but don't assert
I'm seeing assertions when a game gets into a state I don't fully
understand: host receives messages that need a channelNo assigned but
the game's full. With luck they're duplicates and can be ignored,
because that's all I can do.
2017-06-28 07:04:15 -07:00
Eric House
0b0a50bd5c add timestamp to chat messages, db and display
On send, add current seconds to message. Store and display in android
code. Display layout needs work.
2017-06-10 11:36:45 -07:00
Eric House
95ec573169 save disabled booleans in comms state
I want them persisted since the GTK UI doesn't make sense and they
should effect background sends and receives too.
2017-05-26 07:30:42 -07:00
Eric House
9e66d294a2 tap on pending blank tile brings up picker
It's been annoying to have to move a placed blank to change its
value. No more.
2017-04-08 13:44:59 -07:00
Eric House
4c9c5b3418 tweak picker; fix no-tiles-left case
Minor changes to strings and code for tile picker, and fix bug where
server.c was asking for 0 tiles (because none are left in pool.)
2017-03-15 07:12:40 -07:00
Eric House
58fc0e9b81 snapshot on the way to working tile picker
New classes implement custom alert and its view, where most of the logic
for putting up one button per tile, hiding and showing buttons based on
what's left, etc. lives. Rough, but works well until rotated, when gets
redrawn without spaces for the buttons that could come back.
2017-03-14 07:23:30 -07:00