log creation of new games (in search of ghost games bug)

This commit is contained in:
Eric House 2024-09-18 07:50:45 -07:00
parent e43a774800
commit 4e50024359
2 changed files with 7 additions and 10 deletions

View file

@ -697,7 +697,7 @@ object DBUtils {
fun saveNewGame(
context: Context, bytes: ByteArray,
groupID: Long, name: String?
): GameLock? {
): GameLock {
Assert.assertTrue(GROUPID_UNSPEC.toLong() != groupID)
var lock: GameLock? = null
val timestamp = Date().time // milliseconds since epoch
@ -718,9 +718,11 @@ object DBUtils {
lock = GameLock.tryLock(rowid)
Assert.assertNotNull(lock)
notifyListeners(context, rowid, GameChangeType.GAME_CREATED)
Log.d(TAG, "saveNewGame() => %d", rowid)
DbgUtils.printStack(TAG)
}
invalGroupsCache() // then again after
return lock
return lock!!
} // saveNewGame
fun saveGame(

View file

@ -545,14 +545,9 @@ object GameUtils {
val stream = XwJNI.game_saveToStream(gamePtr, gi)
DBUtils.saveNewGame(context, stream, groupID, gameName).use { lock ->
if (null != lock) {
summarize(context, lock, gamePtr, gi)
rowid = lock.rowid
} else {
Assert.failDbg()
}
summarize(context, lock, gamePtr, gi)
rowid = lock.rowid
}
Log.d(TAG, "saveNewGame1() => %d", rowid)
return rowid
}
@ -650,7 +645,7 @@ object GameUtils {
val stream = XwJNI.game_saveToStream(gamePtr, gi)
var rowid: Long
DBUtils.saveNewGame(context, stream, groupID, null).use { lock ->
rowid = lock!!.rowid
rowid = lock.rowid
}
return rowid
}