mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-15 04:54:05 +09:00
faster import process
This commit is contained in:
@@ -202,7 +202,22 @@ class UIImportAvatar(val remoCon: UIRemoCon) : Advanceable() {
|
|||||||
VDUtil.dumpToRealMachine(dom, newFile)
|
VDUtil.dumpToRealMachine(dom, newFile)
|
||||||
|
|
||||||
|
|
||||||
AppUpdateListOfSavegames()
|
// add imported character to the list of savegames
|
||||||
|
// AppUpdateListOfSavegames()
|
||||||
|
try {
|
||||||
|
val it = DiskSkimmer(newFile, true)
|
||||||
|
|
||||||
|
val collection = SavegameCollection.collectFromBaseFilename(File(App.playersDir), it.diskFile.name)
|
||||||
|
val playerUUID = collection.getUUID()
|
||||||
|
|
||||||
|
// if multiple valid savegames with same UUID exist, only the most recent one is retained
|
||||||
|
if (!App.savegamePlayers.contains(playerUUID)) {
|
||||||
|
App.savegamePlayers[playerUUID] = collection
|
||||||
|
App.sortedPlayers.add(0, playerUUID)
|
||||||
|
App.savegamePlayersName[playerUUID] = it.getDiskName(Common.CHARSET)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (_: Throwable) {}
|
||||||
}
|
}
|
||||||
catch (e: Throwable) {
|
catch (e: Throwable) {
|
||||||
// format error
|
// format error
|
||||||
|
|||||||
Reference in New Issue
Block a user