mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-20 22:26:54 +01:00
don't update db unless value's changed
This commit is contained in:
parent
593bb91ee6
commit
f6a91464ac
1 changed files with 9 additions and 5 deletions
|
@ -552,14 +552,18 @@ public class RelayService extends XWService
|
||||||
requestMessages();
|
requestMessages();
|
||||||
break;
|
break;
|
||||||
case XWPDEV_MSG:
|
case XWPDEV_MSG:
|
||||||
// game-related packets only count
|
|
||||||
m_lastGamePacketReceived = Utils.getCurSeconds();
|
|
||||||
XWPrefs.setPrefsLong( this, R.string.key_last_packet,
|
|
||||||
m_lastGamePacketReceived );
|
|
||||||
int token = dis.readInt();
|
int token = dis.readInt();
|
||||||
byte[] msg = new byte[dis.available()];
|
byte[] msg = new byte[dis.available()];
|
||||||
dis.read( msg );
|
dis.read( msg );
|
||||||
postData( RelayService.this, token, msg );
|
postData( this, token, msg );
|
||||||
|
|
||||||
|
// game-related packets only count
|
||||||
|
long lastGamePacketReceived = Utils.getCurSeconds();
|
||||||
|
if ( lastGamePacketReceived != m_lastGamePacketReceived ) {
|
||||||
|
XWPrefs.setPrefsLong( this, R.string.key_last_packet,
|
||||||
|
lastGamePacketReceived );
|
||||||
|
m_lastGamePacketReceived = lastGamePacketReceived;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case XWPDEV_ACK:
|
case XWPDEV_ACK:
|
||||||
noteAck( vli2un( dis ) );
|
noteAck( vli2un( dis ) );
|
||||||
|
|
Loading…
Reference in a new issue