|
|
|
@ -99,9 +99,9 @@ class PortalDataStore (val logger: Logger) { |
|
|
|
|
throw DeserializationException(cause = firstException ?: e) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
logger.info("Saving data to $saveDataTo and using $useBackup as backup") |
|
|
|
|
this.saveDataTo = mainFile |
|
|
|
|
this.useBackup = backupFile |
|
|
|
|
logger.info("Saving data to ${saveDataTo?.path} and using ${useBackup?.path} as backup") |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
fun validateWorldOnStartup(logger: Logger) { |
|
|
|
@ -157,8 +157,8 @@ class PortalDataStore (val logger: Logger) { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
fun onAfterChanged() { |
|
|
|
|
logger.info("Saving data to $saveDataTo and using $useBackup as backup...") |
|
|
|
|
val destination = saveDataTo ?: return |
|
|
|
|
logger.info("Saving updated data to $saveDataTo...") |
|
|
|
|
val tempDestination = File.createTempFile("PortalSaveData", ".tmp.binproto") |
|
|
|
|
val backupDestination = useBackup |
|
|
|
|
if (backupDestination != null && destination.exists()) { |
|
|
|
|