mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-15 08:47:56 +01:00
log creation of new games (in search of ghost games bug)
This commit is contained in:
parent
e43a774800
commit
4e50024359
2 changed files with 7 additions and 10 deletions
|
@ -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(
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue