mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-14 20:44:05 +09:00
writing correct comp id for chosen compressor
This commit is contained in:
@@ -33,7 +33,7 @@ object WriteWorld {
|
|||||||
val world = ingame.world
|
val world = ingame.world
|
||||||
val currentPlayTime_t = time_t - ingame.loadedTime_t
|
val currentPlayTime_t = time_t - ingame.loadedTime_t
|
||||||
|
|
||||||
world.comp = Common.COMP_ZSTD
|
world.comp = Common.getCompIndex()
|
||||||
world.lastPlayTime = time_t
|
world.lastPlayTime = time_t
|
||||||
world.totalPlayTime += currentPlayTime_t
|
world.totalPlayTime += currentPlayTime_t
|
||||||
|
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ object Common {
|
|||||||
const val COMP_GZIP = 1
|
const val COMP_GZIP = 1
|
||||||
// const val COMP_LZMA = 2
|
// const val COMP_LZMA = 2
|
||||||
const val COMP_ZSTD = 3
|
const val COMP_ZSTD = 3
|
||||||
|
const val COMP_SNAPPY = 4
|
||||||
|
|
||||||
val CHARSET = Charsets.UTF_8
|
val CHARSET = Charsets.UTF_8
|
||||||
|
|
||||||
@@ -529,6 +530,10 @@ object Common {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun getCompIndex() = when (App.getConfigString("savegamecomp")) {
|
||||||
|
"snappy" -> COMP_SNAPPY
|
||||||
|
else -> COMP_ZSTD
|
||||||
|
}
|
||||||
|
|
||||||
fun enasciiToString(ba: ByteArray64): String = enasciiToString(ba.iterator())
|
fun enasciiToString(ba: ByteArray64): String = enasciiToString(ba.iterator())
|
||||||
fun enasciiToString(ba: Iterator<Byte>): String {
|
fun enasciiToString(ba: Iterator<Byte>): String {
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ object WriteSimpleWorld {
|
|||||||
private fun preWrite(ingame: IngameInstance, time_t: Long, world: SimpleGameWorld, actorsList: List<Actor>) {
|
private fun preWrite(ingame: IngameInstance, time_t: Long, world: SimpleGameWorld, actorsList: List<Actor>) {
|
||||||
val currentPlayTime_t = time_t - ingame.loadedTime_t
|
val currentPlayTime_t = time_t - ingame.loadedTime_t
|
||||||
|
|
||||||
world.comp = Common.COMP_ZSTD
|
world.comp = Common.getCompIndex()
|
||||||
world.lastPlayTime = time_t
|
world.lastPlayTime = time_t
|
||||||
world.totalPlayTime += currentPlayTime_t
|
world.totalPlayTime += currentPlayTime_t
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user