From 2a4570eafce07d07e23fdc80ddfd499e8e660745 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Mon, 5 Dec 2022 21:52:36 +0600 Subject: [PATCH] Update ServerLauncher.kt --- .../launcher/src/jvmMain/kotlin/ServerLauncher.kt | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/startup/launcher/src/jvmMain/kotlin/ServerLauncher.kt b/startup/launcher/src/jvmMain/kotlin/ServerLauncher.kt index b412f331e92..690e1813227 100644 --- a/startup/launcher/src/jvmMain/kotlin/ServerLauncher.kt +++ b/startup/launcher/src/jvmMain/kotlin/ServerLauncher.kt @@ -10,15 +10,23 @@ import org.koin.core.module.Module import org.koin.dsl.module import java.io.File +package dev.inmo.micro_utils.startup.launcher + +import dev.inmo. + +class ServerLauncher : ServerPlugin { + val defaultJson = Json { + ignoreUnknownKeys = true + } + suspend fun main(args: Array) { KSLog.default = KSLog("PlaguBot") val (configPath) = args val file = File(configPath) KSLog.i("Start read config from ${file.absolutePath}") - val json = defaultJsonFormat.parseToJsonElement(file.readText()).jsonObject - val config = defaultJsonFormat.decodeFromJsonElement(Config.serializer(), json) + val json = defaultJson.parseToJsonElement(file.readText()).jsonObject KSLog.i("Config has been read") - PlaguBot(json, config).start().join() + ServerLauncher.start().join() }