Remove dbus integration

[no changelog]
This commit is contained in:
Linnea Gräf
2024-07-20 14:46:34 +02:00
parent 830f3db26a
commit 9b1b144681
5 changed files with 0 additions and 66 deletions

View File

@@ -30,8 +30,6 @@ import net.fabricmc.loader.api.Version
import net.fabricmc.loader.api.metadata.ModMetadata
import org.apache.logging.log4j.LogManager
import org.apache.logging.log4j.Logger
import org.freedesktop.dbus.connections.impl.DBusConnectionBuilder
import org.freedesktop.dbus.exceptions.DBusException
import kotlinx.coroutines.CoroutineName
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Job
@@ -43,7 +41,6 @@ import kotlin.coroutines.EmptyCoroutineContext
import net.minecraft.command.CommandRegistryAccess
import net.minecraft.util.Identifier
import moe.nea.firmament.commands.registerFirmamentCommand
import moe.nea.firmament.dbus.FirmamentDbusObject
import moe.nea.firmament.events.ClientStartedEvent
import moe.nea.firmament.events.CommandEvent
import moe.nea.firmament.events.ItemTooltipEvent
@@ -97,12 +94,6 @@ object Firmament {
}
val globalJob = Job()
val dbusConnection = try {
DBusConnectionBuilder.forSessionBus()
.build()
} catch (e: Exception) {
null
}
val coroutineScope =
CoroutineScope(EmptyCoroutineContext + CoroutineName("Firmament")) + SupervisorJob(globalJob)
@@ -121,12 +112,6 @@ object Firmament {
@JvmStatic
fun onClientInitialize() {
try {
dbusConnection?.exportObject(FirmamentDbusObject)
dbusConnection?.requestBusName("moe.nea.firmament")
} catch (e: DBusException) {
// :(
}
var tick = 0
ClientTickEvents.END_CLIENT_TICK.register(ClientTickEvents.EndTick { instance ->
TickEvent.publish(TickEvent(tick++))

View File

@@ -1,17 +0,0 @@
/*
* SPDX-FileCopyrightText: 2023 Linnea Gräf <nea@nea.moe>
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
package moe.nea.firmament.dbus
import org.freedesktop.dbus.annotations.DBusInterfaceName
import org.freedesktop.dbus.interfaces.DBusInterface
@DBusInterfaceName("moe.nea.Firmament")
interface FirmamentDbusInterface : DBusInterface {
fun sayHello(): String
fun getCurrentRepoCommit(): String
fun requestRepoReDownload()
}

View File

@@ -1,27 +0,0 @@
/*
* SPDX-FileCopyrightText: 2023 Linnea Gräf <nea@nea.moe>
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
package moe.nea.firmament.dbus
import moe.nea.firmament.repo.RepoManager
object FirmamentDbusObject : FirmamentDbusInterface {
override fun sayHello(): String {
return "Hello from Firmanet"
}
override fun getCurrentRepoCommit(): String {
return RepoManager.currentDownloadedSha ?: "none"
}
override fun requestRepoReDownload() {
RepoManager.launchAsyncUpdate()
}
override fun getObjectPath(): String {
return "/moe/nea/Firmament"
}
}