Remove dbus integration
[no changelog]
This commit is contained in:
@@ -151,9 +151,6 @@ dependencies {
|
|||||||
}
|
}
|
||||||
nonModImplentation(libs.repoparser)
|
nonModImplentation(libs.repoparser)
|
||||||
shadowMe(libs.repoparser)
|
shadowMe(libs.repoparser)
|
||||||
nonModImplentation(libs.bundles.dbus)
|
|
||||||
shadowMe(libs.bundles.dbus)
|
|
||||||
|
|
||||||
fun ktor(mod: String) = "io.ktor:ktor-$mod-jvm:${libs.versions.ktor.get()}"
|
fun ktor(mod: String) = "io.ktor:ktor-$mod-jvm:${libs.versions.ktor.get()}"
|
||||||
|
|
||||||
transInclude(nonModImplentation(ktor("client-core"))!!)
|
transInclude(nonModImplentation(ktor("client-core"))!!)
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ notenoughanimations = "WaI2x21x"
|
|||||||
|
|
||||||
devauth = "1.2.0"
|
devauth = "1.2.0"
|
||||||
ktor = "2.3.0"
|
ktor = "2.3.0"
|
||||||
dbus_java = "4.2.1"
|
|
||||||
neurepoparser = "1.4.0"
|
neurepoparser = "1.4.0"
|
||||||
hotswap_agent = "1.4.2-SNAPSHOT"
|
hotswap_agent = "1.4.2-SNAPSHOT"
|
||||||
mixinextras = "0.3.5"
|
mixinextras = "0.3.5"
|
||||||
@@ -42,8 +41,6 @@ architectury = { module = "dev.architectury:architectury", version.ref = "archit
|
|||||||
rei_api = { module = "me.shedaniel:RoughlyEnoughItems-api", version.ref = "rei" }
|
rei_api = { module = "me.shedaniel:RoughlyEnoughItems-api", version.ref = "rei" }
|
||||||
moulconfig = { module = "org.notenoughupdates.moulconfig:modern", version.ref = "moulconfig" }
|
moulconfig = { module = "org.notenoughupdates.moulconfig:modern", version.ref = "moulconfig" }
|
||||||
repoparser = { module = "moe.nea:neurepoparser", version.ref = "neurepoparser" }
|
repoparser = { module = "moe.nea:neurepoparser", version.ref = "neurepoparser" }
|
||||||
dbus_java_core = { module = "com.github.hypfvieh:dbus-java-core", version.ref = "dbus_java" }
|
|
||||||
dbus_java_unixsocket = { module = "com.github.hypfvieh:dbus-java-transport-native-unixsocket", version.ref = "dbus_java" }
|
|
||||||
mixinextras = { module = "io.github.llamalad7:mixinextras-fabric", version.ref = "mixinextras" }
|
mixinextras = { module = "io.github.llamalad7:mixinextras-fabric", version.ref = "mixinextras" }
|
||||||
jarvis_api = { module = "moe.nea.jarvis:jarvis-api", version.ref = "jarvis" }
|
jarvis_api = { module = "moe.nea.jarvis:jarvis-api", version.ref = "jarvis" }
|
||||||
jarvis_fabric = { module = "moe.nea.jarvis:jarvis-fabric", version.ref = "jarvis" }
|
jarvis_fabric = { module = "moe.nea.jarvis:jarvis-fabric", version.ref = "jarvis" }
|
||||||
@@ -65,7 +62,6 @@ freecammod = { module = "maven.modrinth:freecam", version.ref = "freecammod" }
|
|||||||
femalegender = { module = "maven.modrinth:female-gender", version.ref = "femalegender" }
|
femalegender = { module = "maven.modrinth:female-gender", version.ref = "femalegender" }
|
||||||
|
|
||||||
[bundles]
|
[bundles]
|
||||||
dbus = ["dbus_java_core", "dbus_java_unixsocket"]
|
|
||||||
runtime_required = [
|
runtime_required = [
|
||||||
"architectury_fabric",
|
"architectury_fabric",
|
||||||
"rei_fabric",
|
"rei_fabric",
|
||||||
|
|||||||
@@ -30,8 +30,6 @@ import net.fabricmc.loader.api.Version
|
|||||||
import net.fabricmc.loader.api.metadata.ModMetadata
|
import net.fabricmc.loader.api.metadata.ModMetadata
|
||||||
import org.apache.logging.log4j.LogManager
|
import org.apache.logging.log4j.LogManager
|
||||||
import org.apache.logging.log4j.Logger
|
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.CoroutineName
|
||||||
import kotlinx.coroutines.CoroutineScope
|
import kotlinx.coroutines.CoroutineScope
|
||||||
import kotlinx.coroutines.Job
|
import kotlinx.coroutines.Job
|
||||||
@@ -43,7 +41,6 @@ import kotlin.coroutines.EmptyCoroutineContext
|
|||||||
import net.minecraft.command.CommandRegistryAccess
|
import net.minecraft.command.CommandRegistryAccess
|
||||||
import net.minecraft.util.Identifier
|
import net.minecraft.util.Identifier
|
||||||
import moe.nea.firmament.commands.registerFirmamentCommand
|
import moe.nea.firmament.commands.registerFirmamentCommand
|
||||||
import moe.nea.firmament.dbus.FirmamentDbusObject
|
|
||||||
import moe.nea.firmament.events.ClientStartedEvent
|
import moe.nea.firmament.events.ClientStartedEvent
|
||||||
import moe.nea.firmament.events.CommandEvent
|
import moe.nea.firmament.events.CommandEvent
|
||||||
import moe.nea.firmament.events.ItemTooltipEvent
|
import moe.nea.firmament.events.ItemTooltipEvent
|
||||||
@@ -97,12 +94,6 @@ object Firmament {
|
|||||||
}
|
}
|
||||||
|
|
||||||
val globalJob = Job()
|
val globalJob = Job()
|
||||||
val dbusConnection = try {
|
|
||||||
DBusConnectionBuilder.forSessionBus()
|
|
||||||
.build()
|
|
||||||
} catch (e: Exception) {
|
|
||||||
null
|
|
||||||
}
|
|
||||||
val coroutineScope =
|
val coroutineScope =
|
||||||
CoroutineScope(EmptyCoroutineContext + CoroutineName("Firmament")) + SupervisorJob(globalJob)
|
CoroutineScope(EmptyCoroutineContext + CoroutineName("Firmament")) + SupervisorJob(globalJob)
|
||||||
|
|
||||||
@@ -121,12 +112,6 @@ object Firmament {
|
|||||||
|
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun onClientInitialize() {
|
fun onClientInitialize() {
|
||||||
try {
|
|
||||||
dbusConnection?.exportObject(FirmamentDbusObject)
|
|
||||||
dbusConnection?.requestBusName("moe.nea.firmament")
|
|
||||||
} catch (e: DBusException) {
|
|
||||||
// :(
|
|
||||||
}
|
|
||||||
var tick = 0
|
var tick = 0
|
||||||
ClientTickEvents.END_CLIENT_TICK.register(ClientTickEvents.EndTick { instance ->
|
ClientTickEvents.END_CLIENT_TICK.register(ClientTickEvents.EndTick { instance ->
|
||||||
TickEvent.publish(TickEvent(tick++))
|
TickEvent.publish(TickEvent(tick++))
|
||||||
|
|||||||
@@ -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()
|
|
||||||
}
|
|
||||||
@@ -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"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user