mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-15 15:41:24 +01:00
tweak haveGame fix and add to changelog
This commit is contained in:
parent
b003744645
commit
49e78f8666
5 changed files with 18 additions and 15 deletions
|
@ -15,7 +15,8 @@
|
|||
<body>
|
||||
<h2>CrossWords 4.4.194 release</h2>
|
||||
|
||||
<p>This release improves inviting/rematching and move transmission</p>
|
||||
<p>This release improves inviting/rematching and move transmission,
|
||||
and fixes false remote-game-deleted reports</p>
|
||||
|
||||
<div id="survey">
|
||||
<p>Please <a href="https://www.surveymonkey.com/s/GX3XLHR">take
|
||||
|
@ -28,6 +29,7 @@
|
|||
<li>Improve move transmission when devices aren't online at the
|
||||
same time</li>
|
||||
<li>Make invitations more reliable for Known Players and rematches</li>
|
||||
<li>Fix Bluetooth-connected devices lying about games being deleted</li>
|
||||
<li>Improve Game Configuration dialog</li>
|
||||
<li>Improve Game Over dialog</li>
|
||||
<li>Improve permissions for latest Android OS version</li>
|
||||
|
|
|
@ -1485,7 +1485,7 @@ public class BTUtils {
|
|||
{
|
||||
Log.d( TAG, "receivePing()" );
|
||||
boolean deleted = 0 != gameID
|
||||
&& !DBUtils.haveGame( getContext(), gameID );
|
||||
&& !GameUtils.haveGame( getContext(), gameID );
|
||||
|
||||
DataOutputStream os = new DataOutputStream( socket.getOutputStream() );
|
||||
os.writeByte( BTCmd.PONG.ordinal() );
|
||||
|
|
|
@ -163,8 +163,8 @@ public class DBUtils {
|
|||
summary.turn =
|
||||
cursor.getInt(cursor.
|
||||
getColumnIndex(DBHelper.TURN));
|
||||
summary.turnIsLocal = 0 != cursor.getInt(cursor.
|
||||
getColumnIndex(DBHelper.TURN_LOCAL));
|
||||
summary.turnIsLocal =
|
||||
0 != cursor.getInt(cursor. getColumnIndex(DBHelper.TURN_LOCAL));
|
||||
summary.
|
||||
setGiFlags( cursor.getInt(cursor.
|
||||
getColumnIndex(DBHelper.GIFLAGS))
|
||||
|
@ -869,7 +869,7 @@ public class DBUtils {
|
|||
|
||||
public static long[] getRowIDsFor( Context context, int gameID )
|
||||
{
|
||||
long[] result = {};
|
||||
long[] result;
|
||||
String[] columns = { ROW_ID };
|
||||
String selection = String.format( DBHelper.GAMEID + "=%d", gameID );
|
||||
initDB( context );
|
||||
|
@ -910,16 +910,10 @@ public class DBUtils {
|
|||
return result;
|
||||
}
|
||||
|
||||
public static boolean haveGame( Context context, int gameID )
|
||||
{
|
||||
long[] rows = getRowIDsFor( context, gameID );
|
||||
boolean result = 1 <= rows.length;
|
||||
// Log.d( TAG, "haveGame(%X) => %b", gameID, result );
|
||||
return result;
|
||||
}
|
||||
|
||||
public static boolean haveGame( Context context, long rowid )
|
||||
{
|
||||
// Let's catch any ints passed in
|
||||
Assert.assertTrue( rowid > Integer.MAX_VALUE );
|
||||
boolean result = false;
|
||||
String[] columns = { ROW_ID };
|
||||
String selection = String.format( ROW_ID + "=%d", rowid );
|
||||
|
|
|
@ -253,11 +253,18 @@ public class GameUtils {
|
|||
return getSummary( context, rowid, 0L );
|
||||
}
|
||||
|
||||
public static boolean haveGame( Context context, int gameID )
|
||||
{
|
||||
return haveGame( context, gameID, -1 );
|
||||
}
|
||||
|
||||
public static boolean haveGame( Context context, int gameID, int channel )
|
||||
{
|
||||
long[] rows = DBUtils.getRowIDsFor( context, gameID );
|
||||
boolean found = false;
|
||||
for ( long rowid : rows ) {
|
||||
if ( -1 == channel ) {
|
||||
found = 1 <= rows.length;
|
||||
} else for ( long rowid : rows ) {
|
||||
GameSummary summary = getSummary( context, rowid );
|
||||
// Most of the time if we can't open it we assume it matches. A
|
||||
// non-matching game is a same-device thing I'm probably the only
|
||||
|
|
|
@ -829,7 +829,7 @@ public class WiDirService extends XWService {
|
|||
if ( ! forwardedPacket( packet, bytes ) ) {
|
||||
int gameID = packet.getInt( KEY_GAMEID, 0 );
|
||||
if ( 0 != gameID ) {
|
||||
if ( DBUtils.haveGame( context, gameID ) ) {
|
||||
if ( GameUtils.haveGame( context, gameID ) ) {
|
||||
intent = getIntentTo( P2PAction.GOT_MSG );
|
||||
intent.putExtra( KEY_GAMEID, gameID );
|
||||
intent.putExtra( KEY_DATA, packet.getString( KEY_DATA ) );
|
||||
|
|
Loading…
Reference in a new issue