Commit graph

242 commits

Author SHA1 Message Date
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
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
de01c1aadb cleanup/modernize (should be no behavior change) 2018-03-01 08:13:38 -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
19a6672785 don't show current players tiles in list of remaining 2018-01-18 22:02:06 -08:00
Eric House
52a1ccd4dc tweak comments 2017-07-19 06:16:22 -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
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
Eric House
1cd863b877 fix assertion around out-of-order tile assignment
Got a crash opening games where tile pick was on and first player was a
robot. Cause: non-robot player's tiles were being assigned before the
robot's, and the move stack didn't like the out-of-order assignments.
Now we assign tiles in order as before, but pause each time we find a
non-robot that needs to pick its own.
2017-03-09 21:40:19 -08:00
Eric House
6e5973c55b toward making tile picking work through rotations
Make face-up tile picker util method return void and add mechanism for
passing in selected tiles asynchronously, as has been done recently with
the rest of the once-blocking util callbacks. Works perfectly in the gtk
case. Likely crashes in curses (if picking face-up option is on.) In
java all the callbacks are there but rather than put up a UI we pretend
the user says "pick 'em for me" each time. Putting up a UI is next.
2017-03-09 20:36:14 -08:00
Eric House
c271202faa make bad phonies alert non-blocking
Continue conversion of alerts that required blocking the JNI thread. Now
board_commitTurn() takes a second boolean indicating whether phonies
found have been approved by user. Common code informs user, and if he
approves client code calls board_commitTurn() again. In case where
turn's lost there's no call to make back, but there's the undesirable
change that if a robot moves next its move will be reported on top of
the turn-lost alert. Ideally new alerts would appear under, not on top
of, those that have not yet been dismissed.
2017-02-20 07:20:19 -08:00
Eric House
1a830fbff2 use clang instead of gcc for ndk builds
And make changes to C code to fix resulting warning. The .so file
basically works but is not thoroughly tested.
2016-10-25 06:09:40 -07:00
Eric House
4c923ead08 add isLocal param to server_getCurrentTurn
I want to store this information separately in summaries tables so
e.g. games can be displayed sorted by whether it's the local player's
turn.
2016-08-26 06:58:55 -07:00
Eric House
2faf9c5334 bug: update lastturn timestamp for single-player games too 2016-07-25 08:38:24 -07:00
Eric House
406eb77f54 post notification (rather than just play sound) when turn comes into
boarddelegate but it's not visible
2016-04-14 22:16:18 -07:00
Eric House
22dde029c8 Merge tag 'android_beta_100' into android_branch
ready for release
2016-01-03 11:36:37 -08:00
Eric House
ebcae1a523 move hashing into memstream impl, and reintroduce the old/broken
treatment of the final 8 bits. I'll need to release a version that
still produces the incorrect hash for compatibility with existing
clients that expect it, but that also looks for the correct hash. When
that's out there I can do a new release that sends the correct hash.
2016-01-01 17:57:14 -08:00
Eric House
4813c95976 cleanup: rename function and remove unused param 2015-12-31 15:47:48 -08:00
Eric House
02d5d26c60 when a move comes in whose hash doesn't match the top of the move
stack, go down the stack looking for a match. If it's found, pop down
to that point then apply the move. This fixes stalls in the test
engine when undo is enabled, and so I assume that undos and turns are
somehow coming in out-of-order. Should be rare that this happens.
2015-12-31 06:04:55 -08:00
Eric House
a2ca381890 remove assert when hashes don't match. As currently implemented, this
can happen when somebody does an undo, since the ordering of undos and
moves is not assured. The result is a temporary (I think) stall, where
a move is rejected because the hash doesn't match, but that will be
accepted later when the undo's been processed and the hash will now
match.
2015-12-30 05:59:06 -08:00
Eric House
c96861b329 wrap hash-related logging in ifdefs so can be easily turned on 2015-12-29 19:00:30 -08:00
Eric House
299b8ddc70 assert when hashes don't match. This may be legit, but I need to
understand when it can happen because I think it's the cause of games
failing to communicate in the field
2015-12-29 07:11:05 -08:00
Eric House
122335c53c Merge branch 'android_branch' into relay_noconn
# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
2015-09-17 07:00:04 -07:00
Eric House
cba1293bec make return value void since it's never used 2015-09-15 20:54:01 -07:00
Eric House
47954f82d0 add index of sending player to chat transmission, and on receiving
side translate that into showing the sender's name in
notification. Not yet done: replacing silly "not me" in chat listing
with same, but now it should be easy.

Conflicts:
	xwords4/android/XWords4/archive/R.java
2015-08-12 07:43:20 -07:00
Eric House
8f7267b3ec add index of sending player to chat transmission, and on receiving
side translate that into showing the sender's name in
notification. Not yet done: replacing silly "not me" in chat listing
with same, but now it should be easy.
2015-08-12 07:36:36 -07:00
Eric House
33d0db93e8 add some consts 2015-07-06 20:23:22 -07:00
Eric House
90dbd52bfd On client, when game ends locally set turn to -1 (nobody) so that
display won't be confusing during the interval before the server
receives the move and responds with a game-over message.
2015-06-10 07:35:39 -07:00
Eric House
e66260950e change final score formatting so it can be properly localized.
Note: because the substitution is done in common code I can't use the
positional specifiers (%1$s vs %s) and so this breaks the generated
"translations". The scripts that do the generation need to be fixed to
understand the formatted="false" attribute.
2015-05-13 07:51:32 -07:00
Eric House
75a805634f increase buffer size so French strings don't overflow and get
truncated.
2015-03-19 06:28:40 -07:00
Eric House
5f33d99c2e toward making full use of getQuantityString(): add util method to pass
quantity through to java world, use it, convert English <string>
resources to <plurals> (using python script) based on parallel changes
in French, and modify callsites to call getQuantityString() where
R.string.xxx became R.plurals.xxx.
2015-03-18 21:23:30 -07:00
Eric House
f039ee8338 reject message for client that arrives for server rather than asserting 2015-02-07 13:20:47 -08:00
Eric House
688b3944bb fixes to invite: don't allow non-servers to invite; have common code
inform of number of missing even when it hasn't dropped to 0 (so
second invite can be sent for 3+ device games); take down older alerts
before posting new (again since number of missing may have changed)
2015-01-05 07:43:45 -08:00
Eric House
4701fe2b90 pass in number of devices already connected so forceChannel can be set
more correctly; put up alert when device rejects an invitation as a
duplicate.
2015-01-03 09:50:07 -08:00
Eric House
28bfa3c904 make forceChannel part of CurGameInfo rather than comms, since Android
needs to save it there on receipt of an invitation (doesn't create
full game with comms until later.)  Passes discon2 tests and seems to
work on a single Android device. (Haven't tested inviting on Android
yet.)
2014-12-29 07:39:28 -08:00
Eric House
c008f55133 add invite button only if I'm a host and am missing players 2014-11-12 06:52:40 -08:00
Eric House
c3e7b12103 merge android_branch 2014-10-23 06:33:28 -07:00
Eric House
51a1ddfe39 include robot name in report of his score 2014-10-23 06:32:24 -07:00
Eric House
878a16b3bc snapshot: android compiles, and works well enough to exchange moves
via relay!  Lots of changes, mostly around treating connTypes as a Set
inside the java world.  Jni to translate to that is a pain.
2014-10-16 06:45:24 -07:00
Eric House
fe4c7b52f2 snapshot: relay test script works with a second address type set
(though with its actual transport stubbed out).  Android doesn't even
compile.
2014-10-15 07:26:18 -07:00
Eric House
aa566ad1f0 call util_informMissing when the pendingPlayers count drops to 0 2014-09-25 06:36:07 -07:00
Eric House
1e80109c3e add assert, and don't pass pendingRegistrations to clients -- it confuses them 2014-09-24 19:33:59 -07:00
Eric House
743d532fc7 putting back recent change: this works for automated test and gtk
manual app.  I'm not sure what's up with pendingRegistrations but it
needs more studying before I can change it.
2014-09-24 19:16:06 -07:00