log rather than assert when game opened twice

This commit is contained in:
Eric House 2021-12-16 13:20:03 -08:00
parent 0fa43a7394
commit b5e484baa5

View file

@ -492,7 +492,7 @@ public class BoardDelegate extends DelegateBase
m_rowid = args.getLong( GameUtils.INTENT_KEY_ROWID, -1 ); m_rowid = args.getLong( GameUtils.INTENT_KEY_ROWID, -1 );
Log.i( TAG, "opening rowid %d", m_rowid ); Log.i( TAG, "opening rowid %d", m_rowid );
m_overNotShown = true; m_overNotShown = true;
noteOpened( m_rowid ); noteOpened( m_activity, m_rowid );
} // init } // init
private void getLock() private void getLock()
@ -3043,12 +3043,17 @@ public class BoardDelegate extends DelegateBase
// This might need to map rowid->openCount so opens can stack // This might need to map rowid->openCount so opens can stack
static Set<Long> sOpenRows = new HashSet<>(); static Set<Long> sOpenRows = new HashSet<>();
private static void noteOpened( long rowid ) private static void noteOpened( Context context, long rowid )
{ {
Log.d( TAG, "noteOpened(%d)", rowid ); Log.d( TAG, "noteOpened(%d)", rowid );
Assert.assertTrueNR( !sOpenRows.contains(rowid) ); if ( BuildConfig.NON_RELEASE && sOpenRows.contains(rowid) ) {
String msg = String.format( "noteOpened(%d): already open", rowid );
Utils.showToast( context, msg );
DbgUtils.printStack( TAG );
} else {
sOpenRows.add( rowid ); sOpenRows.add( rowid );
} }
}
private static void noteClosed( long rowid ) private static void noteClosed( long rowid )
{ {