Commit graph

343 commits

Author SHA1 Message Date
Eric House
c4df31892e Fix occasional infinite loop of devices sending and receiving the same
message over and over when getting updated by GCM.  The problem
occurred when one device had an un-ACKable initial message still in
its queue.  I call resendAll a lot, which caused that message to get
resent to the other game which then replied without being able to ACK
it so it remained to be sent again.  This would continue until users
moved forward in the game.  The fix is to add a backoff timer to
resendAll() so that it can't loop.  The timer is reset when an ackable
and new message is received, meaning there's been a change in what's
available to resend.  And since users calling resendAll manually
expect it to do something, add a force param that ignores the backoff.
seems to fix the problem (but needs a lot of testing.)
2012-11-13 21:25:03 -08:00
Eric House
ba11fcf8df don't bother checking for stream size of 0 in jni since comms does
that now.
2012-11-13 21:01:25 -08:00
Eric House
60814264e7 compile with XWFEATURE_COMMSACK turned off 2012-11-12 20:56:50 -08:00
Eric House
76c938cc67 fix to compile with API change; to drop relayid when it's rejected and
to use register with the GCM id on next [re]connect; and to not leave
variable unintialized when unable to call into java world due to being
called without context.
2012-11-12 08:03:25 -08:00
Eric House
39dbed2004 add missing util method (fixing crash) and with it wire up new devID
scheme: now relay-assigned shorter id will be saved and used for
future games.
2012-11-06 07:08:06 -08:00
Eric House
47f9eb03b9 merge in changes from the -gcm directory: GCM will be a feature of the
non-variant build now.
2012-11-02 05:35:31 -07:00
Eric House
6014e3d76f turn on devid code and implement support in java. Untested, but should work. 2012-10-30 07:57:17 -07:00
Eric House
b40e9b7928 assert non-0 lang code 2012-10-25 07:10:54 -07:00
Eric House
aec03fc572 When a game's consumated and guest discovers it isn't using the same
dict, give chance to switch, and to download if required.  Because of
the way the JNI thread works, and JNI's requirement in general that
env instances match up (e.g. dicts must be destroyed in the same
thread that creates them), substituting into a live game is too hard.
So the game's saved with its new dict and then reloaded.
2012-10-24 07:17:21 -07:00
Eric House
077270f1cd merge in SMS-version UI -- there will not be a separate version for
SMS any more.
2012-10-15 08:29:46 -07:00
Eric House
e90c5ee94f pass index of resigning player into util_notifyGameOver. Not yet
passed into java.
2012-10-09 05:31:12 -07:00
Eric House
e64ecfb78d implement resign on top of existing endGame logic, adding "quitter" as
new param passed to remote and changing final score formatting and
menu items to match.  Still need to show old menu on android in case
where game has already ended.
2012-10-07 12:47:06 -07:00
Eric House
fd9b9f85e2 make util_hiliteCell conditional, and remove from android where it
wasn't used anyway.
2012-10-05 18:51:32 -07:00
Eric House
8281bd7f10 call back into java for util_getCurSeconds implementation so java and
C world are sure to be using the same clock.
2012-09-29 19:27:02 -07:00
Eric House
2c89f13383 add turn as param to util_turnChanged, and call from server rather
than board.
2012-09-27 07:04:57 -07:00
Eric House
94103a4212 track time of most recent turn start, and include it in summary table. 2012-09-27 06:55:46 -07:00
Eric House
65598cdb7b replace DeleteLocalRef calls 2012-09-24 07:44:43 -07:00
Eric House
140c982d41 merge from android_branch 2012-09-24 07:39:44 -07:00
Eric House
598a154693 factor common code into function 2012-09-19 08:09:27 -07:00
Eric House
75398389b3 Merge branch 'android_branch' into android_dictdb
Conflicts:
	xwords4/android/XWords4/jni/jniutlswrapper.c
2012-09-15 16:36:15 -07:00
Eric House
ee1df7eeb7 replace DeleteLocalRef calls with version that checks for NULL 2012-09-15 15:57:38 -07:00
Eric House
937bde6378 combine two jniutils methods into one 2012-09-15 15:21:31 -07:00
Eric House
aa974be567 Before figuring md5sum (via java callback added recently), use new
callback to see if there's already one in the DB.  Required passing
context into jniutils getter, and passing name into jni dict
constructors that previously didn't need it.
2012-09-13 07:38:08 -07:00
Eric House
3e4384c2a8 when dict doesn't have built-in md5sum, or when in DEBUG code, call
back into java to get a sum.  It's very slow for large dicts, but will
eventually be in a DB so only done once per dict that doesn't have it.
2012-09-13 05:39:44 -07:00
Eric House
ae2b6205bd use mem_stream_make_sized 2012-09-11 19:17:27 -07:00
Eric House
0ccc2331b5 address bug where message was getting ACK'd by a device that failed to
save what it had ACK'd leaving the game permanently broken.  Do that
by adding a new method game_saveSucceeded() called after the client
claims to have committed bytes returned by game_writeToStream() to
disk.  In that method comms updates the value it'll use in subseqent
ACKs.
2012-09-10 07:31:45 -07:00
Eric House
95a7b14a3a transmit dict's md5sum along with name in initial message from host to
guest.  On guest, pass that sum into client code along with names so
the appropriate tests can be done and corrections taken.
2012-09-08 20:23:48 -07:00
Eric House
9a72f252ed Merge branch 'android_branch' into android_dictname 2012-09-08 13:20:59 -07:00
Eric House
5a81484cf1 add md5Sum to DictInfo and add a getter 2012-09-08 10:11:18 -07:00
Eric House
077560bcd3 load md5sum if present 2012-09-08 09:42:23 -07:00
Eric House
4f180e9e14 pass rejecting dict name into java layer and display as part of turn
lost message.
2012-09-06 19:04:40 -07:00
Eric House
270a19f3aa Revert "first of a set of changes to communicate to clients dictionary being"
This reverts commit b7a0f1489b, which I didn't mean to check in on this branch.
2012-09-03 21:34:51 -07:00
Eric House
ea4d805d5f first of a set of changes to communicate to clients dictionary being
used by server.  Clients need to care if e.g. the server's disallowing
phonies based on its dict.  Can only be sent if client is of latest
version.  In that case, common code calls into new util function.  In
future changes, BoardActivity's implemention of the callback will need
to check if the server's choice of dict is available, and if not offer
to download it.  Once it's available, will want to install it.
2012-09-03 21:33:46 -07:00
Eric House
b7a0f1489b first of a set of changes to communicate to clients dictionary being
used by server.  Clients need to care if e.g. the server's disallowing
phonies based on its dict.  Can only be sent if client is of latest
version.  In that case, common code calls into new util function.  In
future changes, BoardActivity's implemention of the callback will need
to check if the server's choice of dict is available, and if not offer
to download it.  Once it's available, will want to install it.
2012-09-03 21:29:21 -07:00
Eric House
4ffb4efb0c silence compiler warning 2012-08-30 19:10:52 -07:00
Eric House
145317426d Fix prefix matching to accept letters constituting the first part of a
digraph tile when at the end of a prefix so that e.g. GORIL in Catalan
will list GORIL·LA (rather than nothing since GORIL, ending with the L
tile, is not a prefix.)
2012-08-27 21:50:09 -07:00
Eric House
08aa9b66e8 also load new desc field in android client, and add jni call to retrieve it 2012-08-26 20:59:17 -07:00
Eric House
ec0702d584 initialize buffer that common code will pass to strcat. 2012-08-10 21:31:01 -07:00
Eric House
27cbd0e0c9 go with end-game change that takes remaining tiles into account for
robots but not for hints.
2012-08-01 20:31:21 -07:00
Eric House
464696566d get rid of NODE_CAN_4. Not change to post-compiled code 2012-08-01 20:29:15 -07:00
Eric House
9b0436d1ee Make rem string measure function return boolean to indicate rect will
be invisible rather than setting width and height to 0.  No real
change beyond simplifying/speeding platform code.
2012-07-15 09:30:27 -07:00
Eric House
bd70a1dd7d improve text in remaining tiles dialog, and always show the tiles for
all trays rather than excluding those in current player's tray.
2012-07-09 21:44:29 -07:00
Eric House
318cc52f5a we need the base64 stuff even when don't have SMS -- for serialization. 2012-07-07 11:05:45 -07:00
Eric House
2e6b64a4e4 complete implementation of java part of one-pass scoreboard draw. Now
looks pretty much identical to what the old code draws except that
rather than having width allocated in proportion to requested size all
get the same width except the one whose score it is which gets 2x.
2012-07-01 17:24:50 -07:00
Eric House
2434d85684 don't pass the same player-1 data for every player 2012-07-01 16:01:01 -07:00
Eric House
89ffd972bf more work on single-pass scoreboard drawing. Now the jni stuff is
finished, but disabled via compile-time flag, and there's a
commented-out rudimentary implementation on the java side.
2012-07-01 10:04:10 -07:00
Eric House
b9b58bd0a5 enable tray tap undo 2012-06-29 06:52:49 -07:00
Eric House
c8e2dff962 start process of compiling with XWFEATURE_SCOREONEPASS enabled by
adding stubbed-out methods and making old methods conditionally
compiled.  No change in code.
2012-06-27 07:08:09 -07:00
Eric House
405cb23023 fix bug where current player's scoreboard would disappear if other
players' names were too long by giving all a the same proportion of
what they request and passing in the percent given in case draw
implementation wants to use it as a cue to truncate.
2012-06-15 06:26:40 -07:00
Eric House
6257c14436 include trayVisState in GameStateInfo on the java side 2012-06-05 22:13:58 -07:00