mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-29 10:26:36 +01:00
force resend_all() when opening game. This unsticks some new games
that for some reason connected to having several ways of sending some of which aren't working wind up running a backoff timer by the time they want to connect. This fixes the cases I'm seeing. I don't know if it's at the price of generating too much traffic, but at least it's limited to when the user actually opens the game.
This commit is contained in:
parent
1a87812f2b
commit
db71c4e4e2
1 changed files with 29 additions and 13 deletions
|
@ -549,20 +549,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()
|
||||
{
|
||||
|
@ -1803,7 +1803,23 @@ public class BoardDelegate extends DelegateBase
|
|||
}
|
||||
} // class BoardUtilCtxt
|
||||
|
||||
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 {
|
||||
|
@ -1942,7 +1958,7 @@ public class BoardDelegate extends DelegateBase
|
|||
if ( null != m_xport ) {
|
||||
warnIfNoTransport();
|
||||
trySendChats();
|
||||
tickle();
|
||||
tickle( isStart );
|
||||
tryInvites();
|
||||
}
|
||||
}
|
||||
|
@ -1953,7 +1969,7 @@ public class BoardDelegate extends DelegateBase
|
|||
}
|
||||
} // loadGame
|
||||
|
||||
private void tickle()
|
||||
private void tickle( boolean force )
|
||||
{
|
||||
for ( Iterator<CommsConnType> iter = m_connTypes.iterator();
|
||||
iter.hasNext(); ) {
|
||||
|
@ -1973,7 +1989,7 @@ public class BoardDelegate extends DelegateBase
|
|||
}
|
||||
|
||||
if ( 0 < m_connTypes.size() ) {
|
||||
m_jniThread.handle( JNIThread.JNICmd.CMD_RESEND, false, true );
|
||||
m_jniThread.handle( JNIThread.JNICmd.CMD_RESEND, force, true );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue