mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-15 15:41:24 +01:00
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.
This commit is contained in:
parent
08789c4097
commit
8e6812780d
2 changed files with 11 additions and 8 deletions
|
@ -863,8 +863,13 @@ public class GameUtils {
|
|||
if ( lock.tryLock() ) {
|
||||
loadMakeGame( context, gamePtr, gi, feedImpl, sink, lock );
|
||||
|
||||
for ( byte[] msg : msgs ) {
|
||||
draw = XwJNI.game_receiveMessage( gamePtr, msg ) || draw;
|
||||
XwJNI.comms_resendAll( gamePtr );
|
||||
|
||||
if ( null != msgs ) {
|
||||
for ( byte[] msg : msgs ) {
|
||||
draw = XwJNI.game_receiveMessage( gamePtr, msg )
|
||||
|| draw;
|
||||
}
|
||||
}
|
||||
|
||||
// update gi to reflect changes due to messages
|
||||
|
@ -891,7 +896,7 @@ public class GameUtils {
|
|||
}
|
||||
Utils.logf( "feedMessages=>%b", draw );
|
||||
return draw;
|
||||
}
|
||||
} // feedMessages
|
||||
|
||||
// This *must* involve a reset if the language is changing!!!
|
||||
// Which isn't possible right now, so make sure the old and new
|
||||
|
|
|
@ -121,11 +121,9 @@ public class RelayService extends Service {
|
|||
for ( int ii = 0; ii < nameCount; ++ii ) {
|
||||
// if game has messages, open it and feed 'em
|
||||
// to it.
|
||||
if ( null != msgs[ii] ) {
|
||||
if ( GameUtils.feedMessages( this, ids[ii],
|
||||
msgs[ii], sink ) ) {
|
||||
idsWMsgs.add( ids[ii] );
|
||||
}
|
||||
if ( GameUtils.feedMessages( this, ids[ii],
|
||||
msgs[ii], sink ) ) {
|
||||
idsWMsgs.add( ids[ii] );
|
||||
}
|
||||
}
|
||||
if ( 0 < idsWMsgs.size() ) {
|
||||
|
|
Loading…
Reference in a new issue