From 958ca380029d141dcad6477d206b177fdf3be859 Mon Sep 17 00:00:00 2001 From: Eric House Date: Fri, 20 Feb 2015 07:52:19 -0800 Subject: [PATCH 1/4] don't log normal case as error --- xwords4/relay/xwrelay.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/xwords4/relay/xwrelay.cpp b/xwords4/relay/xwrelay.cpp index 67d480995..70bbb94b6 100644 --- a/xwords4/relay/xwrelay.cpp +++ b/xwords4/relay/xwrelay.cpp @@ -414,14 +414,15 @@ getClientIndex( const uint8_t** bufpp, const uint8_t* end, uint8_t result = 0; uint8_t clientIndx; if ( getNetByte( bufpp, end, &clientIndx ) ) { - if ( 0 < clientIndx && clientIndx < nPlayersT ) { - result = 1 + clientIndx; // postgres arrays are 1-based - } else { + if ( 0 == clientIndx ) { + // unset on device: leave it alone + } else if ( clientIndx >= nPlayersT ) { logf( XW_LOGERROR, "%s: bogus clientIndx %d > nPlayersT %d", __func__, clientIndx, nPlayersT ); + } else { + result = 1 + clientIndx; // postgres arrays are 1-based } } - // logf( XW_LOGINFO, "%s() => %d", __func__, result ); return result; } From 825577a7628e437e5de947ed46de8931a105ca91 Mon Sep 17 00:00:00 2001 From: Eric House Date: Sat, 21 Feb 2015 17:37:10 -0800 Subject: [PATCH 2/4] manually bring in db71c4e4e2868c81e5939828e5beb8194722179a: force resend_all() when opening game --- .../eehouse/android/xw4/BoardDelegate.java | 42 +++++++++++++------ 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardDelegate.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardDelegate.java index aa8436adc..01b0963b1 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardDelegate.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardDelegate.java @@ -556,20 +556,20 @@ public class BoardDelegate extends DelegateBase super.onPause(); } + @Override + protected void onStart() + { + super.onStart(); + doResume( true ); + } + @Override protected void onResume() { super.onResume(); - m_handler = new Handler(); - m_blockingDlgID = DlgID.NONE; - - setKeepScreenOn(); - - loadGame(); - - ConnStatusHandler.setHandler( this ); + doResume( false ); } - + @Override protected void onDestroy() { @@ -1806,7 +1806,23 @@ public class BoardDelegate extends DelegateBase } ); } - private void loadGame() + private void doResume( boolean isStart ) + { + boolean firstStart = null == m_handler; + if ( firstStart ) { + m_handler = new Handler(); + m_blockingDlgID = DlgID.NONE; + } + + loadGame( isStart ); + + if ( !isStart ) { + setKeepScreenOn(); + ConnStatusHandler.setHandler( this ); + } + } + + private void loadGame( boolean isStart ) { if ( 0 == m_jniGamePtr ) { try { @@ -1940,7 +1956,7 @@ public class BoardDelegate extends DelegateBase if ( null != m_xport ) { warnIfNoTransport(); trySendChats(); - tickle(); + tickle( isStart ); tryInvites(); } } @@ -1952,7 +1968,7 @@ public class BoardDelegate extends DelegateBase } // loadGame @SuppressWarnings("fallthrough") - private void tickle() + private void tickle( boolean force ) { switch( m_connType ) { case COMMS_CONN_BT: @@ -1964,7 +1980,7 @@ public class BoardDelegate extends DelegateBase case COMMS_CONN_SMS: // Let other know I'm here // DbgUtils.logf( "tickle calling comms_resendAll" ); - m_jniThread.handle( JNIThread.JNICmd.CMD_RESEND, false, true ); + m_jniThread.handle( JNIThread.JNICmd.CMD_RESEND, force, true ); break; default: DbgUtils.logf( "tickle: unexpected type %s", From f9ddca8316f2e9768e7ebe9f3c05474467955829 Mon Sep 17 00:00:00 2001 From: Eric House Date: Mon, 23 Feb 2015 07:03:25 -0800 Subject: [PATCH 3/4] tweak explanation --- xwords4/android/XWords4/assets/changes.html | 22 ++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/xwords4/android/XWords4/assets/changes.html b/xwords4/android/XWords4/assets/changes.html index 0b0a05f56..06ea35658 100644 --- a/xwords4/android/XWords4/assets/changes.html +++ b/xwords4/android/XWords4/assets/changes.html @@ -15,10 +15,10 @@

Crosswords 4.4 beta 93 release

-

This is an interim release mostly to set up a larger release - that's nearly done and with which everything before would otherwise - be incompatible. Once this version's been adopted I can release the - next.

+

This is an interim release making low-level network changes that + need to be out there before the next, more ambitious set of changes + can go out. Once this version's been adopted I can release the + next without breaking networked games that are in progress.

Please take @@ -28,11 +28,10 @@

New with this release

    +
  • Change "protocol" of messages passed between games + to include more information.
  • Replace "Do not show again" button in new-player hint dialogs with a checkbox
  • - -
  • Change some networking details that are incompatible with - new stuff in a way that doesn't break the old.

(The full changelog @@ -40,10 +39,11 @@

Next up

    -
  • Fix things so you don't have to specify how two devices - will communicate: Bluetooth, Relay, SMS - shouldn't be - something you have to pick. I should just use what works at - the time. (This is coming along, but still weeks out.)
  • +
  • Finish fixing things so you don't have to specify how + two devices will communicate: Bluetooth, Relay, SMS - + shouldn't be something you have to pick. I should just + use what works at the time. (This is coming along, but + still weeks out.)
  • Offer "Rematch" when game's over (easy if I get the above right)
  • From 0cb549abcca1fb5e9ff647c8fa7a720e4f056f83 Mon Sep 17 00:00:00 2001 From: Eric House Date: Mon, 23 Feb 2015 07:11:43 -0800 Subject: [PATCH 4/4] add another change summary item --- xwords4/android/XWords4/assets/changes.html | 1 + 1 file changed, 1 insertion(+) diff --git a/xwords4/android/XWords4/assets/changes.html b/xwords4/android/XWords4/assets/changes.html index 06ea35658..ed5624ec6 100644 --- a/xwords4/android/XWords4/assets/changes.html +++ b/xwords4/android/XWords4/assets/changes.html @@ -32,6 +32,7 @@ to include more information.
  • Replace "Do not show again" button in new-player hint dialogs with a checkbox
  • +
  • Resend pending messages every time game is opened

(The full changelog