don't update db unless value's changed

This commit is contained in:
Eric House 2013-08-31 07:50:30 -07:00
parent 593bb91ee6
commit f6a91464ac

View file

@ -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 ) );