From 27aa9ac9941253e8670d1536a0f1fcb5bc1cd4f5 Mon Sep 17 00:00:00 2001 From: "Christopher F." Date: Fri, 14 Aug 2026 16:27:59 +0200 Subject: [PATCH] feat(launcher): Add delta patching to downgrade to supported revisions automatically (#169) --- .env.example | 5 ++++- gradle/libs.versions.toml | 2 ++ .../de/fiereu/openmmo/launcher/client/ArchiveClient.kt | 3 +++ .../de/fiereu/openmmo/launcher/patch/ArchivePatcher.kt | 3 +++ .../kotlin/de/fiereu/openmmo/launcher/patch/CanonicalTar.kt | 3 +++ .../kotlin/de/fiereu/openmmo/launcher/patch/XDeltaApplier.kt | 3 +++ .../de/fiereu/openmmo/launcher/client/ArchiveClientTest.kt | 3 +++ .../fiereu/openmmo/launcher/launch/LauncherPipelineTest.kt | 3 +++ .../de/fiereu/openmmo/launcher/patch/ArchivePatcherTest.kt | 3 +++ .../de/fiereu/openmmo/launcher/patch/CanonicalTarTest.kt | 3 +++ 10 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 launcher/src/main/kotlin/de/fiereu/openmmo/launcher/client/ArchiveClient.kt create mode 100644 launcher/src/main/kotlin/de/fiereu/openmmo/launcher/patch/ArchivePatcher.kt create mode 100644 launcher/src/main/kotlin/de/fiereu/openmmo/launcher/patch/CanonicalTar.kt create mode 100644 launcher/src/main/kotlin/de/fiereu/openmmo/launcher/patch/XDeltaApplier.kt create mode 100644 launcher/src/test/kotlin/de/fiereu/openmmo/launcher/client/ArchiveClientTest.kt create mode 100644 launcher/src/test/kotlin/de/fiereu/openmmo/launcher/launch/LauncherPipelineTest.kt create mode 100644 launcher/src/test/kotlin/de/fiereu/openmmo/launcher/patch/ArchivePatcherTest.kt create mode 100644 launcher/src/test/kotlin/de/fiereu/openmmo/launcher/patch/CanonicalTarTest.kt diff --git a/.env.example b/.env.example index 0fb460e..b5e87be 100644 --- a/.env.example +++ b/.env.example @@ -34,4 +34,7 @@ OPENMMO_SESSION_SECRET= # Private key for both servers. Leave empty for development, set one in production. OPENMMO_GAME_PRIVATE_KEY= -OPENMMO_GAME_PRIVATE_KEY_FILE= \ No newline at end of file +OPENMMO_GAME_PRIVATE_KEY_FILE= + +# Base URL where xdelta patches and delta manifests are served when the client needs to be downgraded. +# OPENMMO_ARCHIVE_ORIGIN=https://github.com/openmmo-org/archive \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 79e5e88..9e93d08 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -25,6 +25,7 @@ ineter = "0.3.1" compose = "1.11.1" tomlkt = "0.5.0" dotenv = "4.0.0" +vcdiff = "0.2.0" [libraries] kotlinGradlePlugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" } @@ -65,6 +66,7 @@ dagger-compiler = { module = "com.google.dagger:dagger-compiler", version.ref = mockk = { module = "io.mockk:mockk", version.ref = "mockk" } ineter = { module = "com.github.maltalex:ineter", version.ref = "ineter" } tomlkt = { module = "net.peanuuutz.tomlkt:tomlkt-jvm", version.ref = "tomlkt" } +vcdiff-core = { module = "com.davidehrmann.vcdiff:vcdiff-core", version.ref = "vcdiff" } [bundles] crypto = ["bouncycastle-pkix", "bouncycastle-provider"] diff --git a/launcher/src/main/kotlin/de/fiereu/openmmo/launcher/client/ArchiveClient.kt b/launcher/src/main/kotlin/de/fiereu/openmmo/launcher/client/ArchiveClient.kt new file mode 100644 index 0000000..99af019 --- /dev/null +++ b/launcher/src/main/kotlin/de/fiereu/openmmo/launcher/client/ArchiveClient.kt @@ -0,0 +1,3 @@ +Removed on request of pokemmo.eu. +Date: 2026-08-17 +Nonce: 42e713f070e64c1da766e32ddf5a440f diff --git a/launcher/src/main/kotlin/de/fiereu/openmmo/launcher/patch/ArchivePatcher.kt b/launcher/src/main/kotlin/de/fiereu/openmmo/launcher/patch/ArchivePatcher.kt new file mode 100644 index 0000000..100aa10 --- /dev/null +++ b/launcher/src/main/kotlin/de/fiereu/openmmo/launcher/patch/ArchivePatcher.kt @@ -0,0 +1,3 @@ +Removed on request of pokemmo.eu. +Date: 2026-08-17 +Nonce: c2495372c90743b8b73635f7aa3f3749 diff --git a/launcher/src/main/kotlin/de/fiereu/openmmo/launcher/patch/CanonicalTar.kt b/launcher/src/main/kotlin/de/fiereu/openmmo/launcher/patch/CanonicalTar.kt new file mode 100644 index 0000000..49b32c4 --- /dev/null +++ b/launcher/src/main/kotlin/de/fiereu/openmmo/launcher/patch/CanonicalTar.kt @@ -0,0 +1,3 @@ +Removed on request of pokemmo.eu. +Date: 2026-08-17 +Nonce: 8a9eeff586e944f291abac8c8b192fd4 diff --git a/launcher/src/main/kotlin/de/fiereu/openmmo/launcher/patch/XDeltaApplier.kt b/launcher/src/main/kotlin/de/fiereu/openmmo/launcher/patch/XDeltaApplier.kt new file mode 100644 index 0000000..4e32e88 --- /dev/null +++ b/launcher/src/main/kotlin/de/fiereu/openmmo/launcher/patch/XDeltaApplier.kt @@ -0,0 +1,3 @@ +Removed on request of pokemmo.eu. +Date: 2026-08-17 +Nonce: 28878918c26449e1896ac3cbd0f1e1c6 diff --git a/launcher/src/test/kotlin/de/fiereu/openmmo/launcher/client/ArchiveClientTest.kt b/launcher/src/test/kotlin/de/fiereu/openmmo/launcher/client/ArchiveClientTest.kt new file mode 100644 index 0000000..3001b7b --- /dev/null +++ b/launcher/src/test/kotlin/de/fiereu/openmmo/launcher/client/ArchiveClientTest.kt @@ -0,0 +1,3 @@ +Removed on request of pokemmo.eu. +Date: 2026-08-17 +Nonce: c41f40fae0b743be969b569acc71cab6 diff --git a/launcher/src/test/kotlin/de/fiereu/openmmo/launcher/launch/LauncherPipelineTest.kt b/launcher/src/test/kotlin/de/fiereu/openmmo/launcher/launch/LauncherPipelineTest.kt new file mode 100644 index 0000000..4c8cbfd --- /dev/null +++ b/launcher/src/test/kotlin/de/fiereu/openmmo/launcher/launch/LauncherPipelineTest.kt @@ -0,0 +1,3 @@ +Removed on request of pokemmo.eu. +Date: 2026-08-17 +Nonce: cda206dca1c04dcc9a1f1d2ef8200245 diff --git a/launcher/src/test/kotlin/de/fiereu/openmmo/launcher/patch/ArchivePatcherTest.kt b/launcher/src/test/kotlin/de/fiereu/openmmo/launcher/patch/ArchivePatcherTest.kt new file mode 100644 index 0000000..85dee8f --- /dev/null +++ b/launcher/src/test/kotlin/de/fiereu/openmmo/launcher/patch/ArchivePatcherTest.kt @@ -0,0 +1,3 @@ +Removed on request of pokemmo.eu. +Date: 2026-08-17 +Nonce: 7c75370114c24edfad65fd4773bf6f4b diff --git a/launcher/src/test/kotlin/de/fiereu/openmmo/launcher/patch/CanonicalTarTest.kt b/launcher/src/test/kotlin/de/fiereu/openmmo/launcher/patch/CanonicalTarTest.kt new file mode 100644 index 0000000..9d214d8 --- /dev/null +++ b/launcher/src/test/kotlin/de/fiereu/openmmo/launcher/patch/CanonicalTarTest.kt @@ -0,0 +1,3 @@ +Removed on request of pokemmo.eu. +Date: 2026-08-17 +Nonce: a14131761de549e4a10cc880e5e9946e