deferred savegame collection for faster startup

This commit is contained in:
minjaesong
2023-09-21 16:22:29 +09:00
parent 8508956ad6
commit e2a71467db
4 changed files with 25 additions and 8 deletions

View File

@@ -799,7 +799,7 @@ fun AppUpdateListOfSavegames() {
null
}
}.sortedByDescending { it.getLastModifiedTime() }
val filteringResults = arrayListOf<List<DiskSkimmer>>()
val filteringResults = arrayListOf<List<DiskSkimmer>>() // first element of the list is always file with no suffix
worldsDirLs.forEach {
val li = arrayListOf(it)
listOf(".1",".2",".3",".a",".b",".c").forEach { suffix ->
@@ -818,6 +818,8 @@ fun AppUpdateListOfSavegames() {
printdbg("ListSavegames", " collecting...")
val collection = SavegameCollection.collectFromBaseFilename(list, it.diskFile.name)
printdbg("ListSavegames", " disk rebuilding...")
collection.rebuildLoadable()
printdbg("ListSavegames", " get UUID...")
val worldUUID = collection.getUUID()
@@ -862,6 +864,8 @@ fun AppUpdateListOfSavegames() {
printdbg("ListSavegames", " collecting...")
val collection = SavegameCollection.collectFromBaseFilename(list, it.diskFile.name)
printdbg("ListSavegames", " disk rebuilding...")
collection.rebuildLoadable()
printdbg("ListSavegames", " get UUID...")
val playerUUID = collection.getUUID()