Commit graph

4772 commits

Author SHA1 Message Date
Andy2
58be931558 remove messages after sending them if they appear to have been sent
successfully.
2011-08-17 19:52:55 -07:00
Andy2
8e6812780d call feedMessages even if there are no messages, and call
comms_resendAll() from feedMessages.  The combination means that all
networked games get a chance to resend dropped packets periodically
which should help prevent stalls.
2011-08-17 19:51:20 -07:00
Andy2
08789c4097 call server_do() up to five times to allow some extra work to get
done.  Required if a host is also a robot.
2011-08-17 19:48:55 -07:00
Andy2
b9be2b45f4 sendMsg needs to report success if no-conn send works. 2011-08-17 18:41:45 -07:00
Andy2
2c26fc03e3 Track messages sent via proxy and credit nsent (accumulator) if
successful.  Previously messages sent via proxy were not counted.
2011-08-17 18:09:10 -07:00
Andy2
b511b4c455 add new RecordSent to take list of msg ids -- and use stringstream
instead of static buffer and snprintf in one case.  May make sense
elsewhere too.
2011-08-17 18:07:21 -07:00
Andy2
8148c7699a don't loop forever on server_do(). It's broken w.r.t. guaranteeing
that it can always change state.
2011-08-17 06:52:04 -07:00
Andy2
30145deba7 add new proxy message handler for no-conn message, and feed into
existing store-and-forward system.  With this checkin a robot-vs-robot
game plays for quite a few moves without either game every loaded into
the foreground (via a BoardActivity instance on Android), with all
moves transmitted as a result of relay checks.  One of the games
refuses to open later, however, and there are certainly other bugs.
And I'm not sure what happens when a message sent no-conn (without a
cookie ID) is received in the foreground.  But this is progress.
2011-08-16 19:41:33 -07:00
Andy2
7ab8c6eca4 re-factor sending code so essentially same message (without cookieID
that implies a connection) is sent and received by no-conn code.  Use
flags to determine if comms can support no-conn sending without making
up the message only to have it fail to send.
2011-08-16 19:36:23 -07:00
Andy2
2dcfb2193c complete the process of sending messages generated in response to
messages passed in in background: send them.  Requires new method
implementing new protocol against proxy.
2011-08-16 19:33:24 -07:00
Andy2
066cef0306 using new send-noconn proc is too expensive if it's only going to fail
(return false) so add new iface comms can call once to get flags to
tell it whether to use that proc.  One implementation of
TransportProcs returns one flag; the other, the other.
2011-08-16 19:31:08 -07:00
Andy2
dfab747504 make server_do() take a new param to allow caller to call it until
there's nothing more to do (without the assumption it's driven from an
event queue.)
2011-08-16 19:28:59 -07:00
Andy2
11f6d96be9 get 'svn' out of the version string variable 2011-08-16 19:26:53 -07:00
Andy2
dc693e4d6a too much logging 2011-08-16 19:20:39 -07:00
Andy2
f61748369a fix non-debug compile warning 2011-08-16 19:17:47 -07:00
eehouse@eehouse.org
be4ec00e55 Merge branch 'android_branch' into send_in_background 2011-08-15 18:28:35 -07:00
Andy2
dc273c7162 fix proxy msg handling to process more than one relayID per message.
Formerly all but the first were dropped.
2011-08-15 18:27:00 -07:00
Andy2
6f22cbd8c9 rename class and pass in from higher so send can be done in the right
place.
2011-08-11 06:49:44 -07:00
Andy2
985f254660 more refactoring -- limit NetUtils method to network stuff as much as
possible.
2011-08-11 06:40:13 -07:00
Andy2
008c70957a refactor -- no behavior change 2011-08-11 06:29:21 -07:00
Andy2
c2ae80cf37 pass the stubbed-out procs into the jni. Now background-generated
packets are getting into the java world.  Next: get 'em to the relay.
2011-08-10 21:28:12 -07:00
Andy2
ea05c34d8f add the alternative send proc to the java transportprocs interface,
and call through to it from the jni.  Add another implemenation of the
interface and pass that when opening games in the background.
2011-08-10 21:06:05 -07:00
Andy2
f6bf91de36 make overridden methods have params in same order (though some are
missing).
2011-08-10 20:49:41 -07:00
Andy2
e88af19e0a toward the ability to send replies to messages received in background
without user having to open the game, which will e.g. allow a host to
assign tiles, or a robot to move, without the phone's owner noticing
there's a message.  This is on a branch because it may never work.
2011-08-10 18:28:34 -07:00
Andy2
e2ef25ae90 add pref for choosing what goes in parens along with the game name
(where <language> was before.)  opponent name still needs to not be
hard-coded; the rest works.
2011-08-09 19:26:59 -07:00
Andy2
ceb2d1ac63 fix indenting -- white space only. 2011-08-09 06:48:10 -07:00
Andy2
c67e92ea2c log sends for a while. I want to fix the occasional stall. 2011-08-09 06:44:09 -07:00
Andy2
8adb925cca only load and pass in dict as byte[] when path isn't available
(i.e. when it's a builtin), and use mmap in that case.  Works!  Still
need to try a speed test.
2011-08-08 20:27:42 -07:00
Andy2
35f059e14c remove logging 2011-08-08 20:21:55 -07:00
Andy2
755d3e5bb2 as first step in using mmap for dictionaries instead of passing byte
arrays into the jni, pass the full file paths in in addition to the
byte arrays.  This isn't possible with the built-in dicts, but does
work for the downloaded ones (which are usually larger).  This checkin
does the mmap and uses memcmp to verify that the bytes are the same as
passed in.  Next step is to not pass the bytes when the path will do
and to actually use the mmap'd ptr.
2011-08-08 19:41:45 -07:00
Andy2
ab64d57f5c adapt a couple of icons as placeholders for standalone and networked
games.  Every games-list item now has an icon.  The networked game
icon is replaced by the sync icon when there's new information.
2011-08-08 18:56:19 -07:00
Andy2
d08eacc4c0 comment: reminder of possible icon for archiving 2011-08-08 18:53:58 -07:00
Andy2
556b78baad remove logging 2011-08-07 20:22:33 -07:00
Andy2
4345fc1543 fix failure of renamegame feature when orientation changes while
dialog is up.  I'm making two fixes, either of which is enough: saving
the rowid across teardown of the activity; and changing the manifest
to not tear down the activity.  The reason for the latter is that the
teardown is unnecessary and wasteful.  The former's just safer coding.
2011-08-07 20:22:11 -07:00
Andy2
f8715feea6 update version and changelog for b32 2011-08-06 23:08:42 -07:00
Andy2
6f7279a6b0 fix crash that happens whenever orientation changes while there's a
dialog up in DictsActivity.  (There are still problems updating the
UI, e.g.  indicating the current loc of a moved dict.)
2011-08-06 23:03:11 -07:00
Andy2
fd61c0af02 'final' not needed 2011-08-06 22:30:48 -07:00
Andy2
c47189e81f fix crasher introduced with eeac03d40f:
update delegate's dialog id constants.
2011-08-06 21:30:38 -07:00
Andy2
b20584b74e fix bug moving dicts: location wasn't getting updated when the move
was successful and so subsequent moves reported wrong location.
2011-08-06 20:06:21 -07:00
Andy2
fc650ef317 fix assertion failure reported by google when unable to create
directory on SD card.  Just return null and carry on as if SD card not
writable.
2011-08-06 20:05:30 -07:00
Andy2
ed832f9545 update database from any version, not just two adjoining. 2011-08-06 19:26:36 -07:00
Andy2
011b283566 tweak copy dialog to suggest using new-from. 2011-08-06 16:18:32 -07:00
Andy2
719fd314a5 move net msg icon outside of hideable part of game list item layout so
it remains visible when not expanded.  Otherwise people won't see that
something happened to a closed game.
2011-08-06 16:03:38 -07:00
Andy2
eeac03d40f query user for html vs text before creating new networked game so it
isn't left sitting if [s]he cancels.
2011-08-06 15:49:55 -07:00
Andy2
66a673c478 make the game name green when it's somebody's turn and player names
are hidden.
2011-08-06 15:46:49 -07:00
Andy2
6cde6be6a5 up version and changelog for beta 31 2011-08-06 14:29:58 -07:00
Andy2
1c28433bd0 store expandedness in DB rather than a class static, which will
eventually die.  Generalize DBUtils methods int get/setInt().  Adds
new column to DB, the second for this version number.
2011-08-06 14:19:07 -07:00
Andy2
13cbca3368 cleanup 2011-08-06 14:03:50 -07:00
Andy2
35a5aad477 make name text larger -- button is anyway. 2011-08-06 13:19:48 -07:00
Andy2
d7dfb89f65 query user before sending invite whether to use html or text and
format differently depending on the answer.  With html only I couldn't
invite using SMS, which bites.
2011-08-06 13:01:40 -07:00