diff --git a/src/main/kotlin/ru/dbotthepony/kstarbound/server/StarboundServer.kt b/src/main/kotlin/ru/dbotthepony/kstarbound/server/StarboundServer.kt index 023097fa..1812ba2d 100644 --- a/src/main/kotlin/ru/dbotthepony/kstarbound/server/StarboundServer.kt +++ b/src/main/kotlin/ru/dbotthepony/kstarbound/server/StarboundServer.kt @@ -224,7 +224,7 @@ sealed class StarboundServer(val root: File) : BlockableEventLoop("Server thread LOGGER.fatal("Exception loading celestial world at $location, recreating!") var i = 0 - while (!file.renameTo(File(universeFolder, "$fileName-fail$i")) && ++i < 1000) {} + while (!file.renameTo(File(universeFolder, "$fileName-fail$i")) && ++i < 10000) {} ServerWorld.create(this, WorldTemplate.create(location.pos, universe), NativeLocalWorldStorage(file), location) } @@ -270,7 +270,7 @@ sealed class StarboundServer(val root: File) : BlockableEventLoop("Server thread visitable.disableDeathDrops = config.disableDeathDrops val template = WorldTemplate(visitable, config.skyParameters, random) - val world = ServerWorld.create(this, template, LegacyWorldStorage.memory(), location) + val world = ServerWorld.create(this, template, NativeLocalWorldStorage(null), location) try { world.setProperty("ephemeral", JsonPrimitive(!config.persistent)) diff --git a/src/main/kotlin/ru/dbotthepony/kstarbound/server/world/ServerChunk.kt b/src/main/kotlin/ru/dbotthepony/kstarbound/server/world/ServerChunk.kt index a0552085..91b4be8f 100644 --- a/src/main/kotlin/ru/dbotthepony/kstarbound/server/world/ServerChunk.kt +++ b/src/main/kotlin/ru/dbotthepony/kstarbound/server/world/ServerChunk.kt @@ -501,7 +501,7 @@ class ServerChunk(world: ServerWorld, pos: ChunkPos) : Chunk<ServerWorld, Server } } - var shouldUnload = !isBusy && temporary.isEmpty() && permanent.isEmpty() && world.template.worldParameters !is FloatingDungeonWorldParameters + var shouldUnload = !isBusy && temporary.isEmpty() && permanent.isEmpty() //&& world.template.worldParameters !is FloatingDungeonWorldParameters if (shouldUnload) { idleTicks++ diff --git a/src/main/kotlin/ru/dbotthepony/kstarbound/util/CarriedExecutor.kt b/src/main/kotlin/ru/dbotthepony/kstarbound/util/CarriedExecutor.kt index 66ae611c..0ced266f 100644 --- a/src/main/kotlin/ru/dbotthepony/kstarbound/util/CarriedExecutor.kt +++ b/src/main/kotlin/ru/dbotthepony/kstarbound/util/CarriedExecutor.kt @@ -70,7 +70,7 @@ class CarriedExecutor(private val parent: Executor, private val allowExecutionIn if (queue.isNotEmpty() && isCarried.compareAndSet(false, true)) { // bugger! queue updated while we have finished - // and no other thread has picked up + // and no other thread has picked it up } else { break } diff --git a/src/main/kotlin/ru/dbotthepony/kstarbound/world/entities/tile/WorldObject.kt b/src/main/kotlin/ru/dbotthepony/kstarbound/world/entities/tile/WorldObject.kt index c97779e6..325b688a 100644 --- a/src/main/kotlin/ru/dbotthepony/kstarbound/world/entities/tile/WorldObject.kt +++ b/src/main/kotlin/ru/dbotthepony/kstarbound/world/entities/tile/WorldObject.kt @@ -248,9 +248,9 @@ open class WorldObject(val config: Registry.Entry<ObjectDefinition>) : TileEntit var soundEffectEnabled by networkedBoolean(true).also { networkGroup.upstream.add(it) } var lightSourceColor by networkedData(RGBAColor.TRANSPARENT_BLACK, RGBACodec).also { networkGroup.upstream.add(it) } val newChatMessageEvent = networkedEventCounter().also { networkGroup.upstream.add(it) } - val chatMessage by networkedString().also { networkGroup.upstream.add(it) } - val chatPortrait by networkedString().also { networkGroup.upstream.add(it) } - val chatConfig by networkedJsonElement().also { networkGroup.upstream.add(it) } + var chatMessage by networkedString().also { networkGroup.upstream.add(it) } + var chatPortrait by networkedString().also { networkGroup.upstream.add(it) } + var chatConfig by networkedJsonElement().also { networkGroup.upstream.add(it) } @Suppress("deprecation") inner class WireNode(val position: Vector2i, val isInput: Boolean) { @@ -556,7 +556,10 @@ open class WorldObject(val config: Registry.Entry<ObjectDefinition>) : TileEntit } fun addChatMessage(message: String, config: JsonElement, portrait: String? = null) { - + chatMessage = message + chatPortrait = portrait ?: "" + chatConfig = config + newChatMessageEvent.trigger() } override fun tick(delta: Double) {