From 9866c1b0fb78b40ae0109499b9b20b25df6c7fc1 Mon Sep 17 00:00:00 2001 From: Fiereu Date: Fri, 7 Aug 2026 10:47:27 +0200 Subject: [PATCH] refactor(test): add a common.test module and move the captured payloads into fixtures (#97) --- bytecodec/build.gradle.kts | 5 ++- .../kotlin/de/fiereu/bytecodec/AtomsTest.kt | 8 ++--- .../de/fiereu/bytecodec/CombinatorsTest.kt | 8 ++--- .../de/fiereu/bytecodec/PacketCodecTest.kt | 6 ++-- common.test/build.gradle.kts | 13 +++++++ .../openmmo/common/test}/DockerAvailable.kt | 2 +- .../de/fiereu/openmmo/common/test/Fixtures.kt | 16 +++++++++ .../openmmo/common}/test/TestHelpers.kt | 5 ++- network/build.gradle.kts | 1 + .../network/handshake/HandshakeCodecsTest.kt | 6 ++-- protocols.game/build.gradle.kts | 1 + .../net/game/BattleActionSelectPacketTest.kt | 27 ++++---------- .../game/BattleEntityMoveEventPacketTest.kt | 4 +-- .../net/game/BattleFieldStatePacketTest.kt | 14 +++----- .../net/game/BattleSwitchInPacketTest.kt | 7 ++-- .../net/game/CharactersListPacketTest.kt | 34 +++--------------- .../net/game/CreateCharacterPacketTest.kt | 16 ++++----- .../net/game/DialogActionPacketTest.kt | 29 ++++++++------- .../game/DialogActionResponsePacketTest.kt | 10 +++--- .../de/fiereu/openmmo/net/game/Fixtures.kt | 15 -------- .../openmmo/net/game/FriendListPacketTest.kt | 4 +-- .../net/game/GameCodecRoundtripTest.kt | 4 +-- .../net/game/GtlListingsPagePacketTest.kt | 7 ++-- .../net/game/GtlMarketListingsPacketTest.kt | 3 +- .../net/game/GtlOpenSessionPacketTest.kt | 11 +++--- .../net/game/GtlSearchPagePacketTest.kt | 7 ++-- .../game/GtlSearchPageRequestPacketTest.kt | 9 ++--- .../net/game/GtlTradeLogRequestPacketTest.kt | 3 +- .../net/game/GuildMembershipPacketTest.kt | 4 +-- .../GuildRankPermissionUpdatePacketTest.kt | 4 +-- .../openmmo/net/game/MoveLearnPacketsTest.kt | 34 ++++-------------- .../net/game/PokemonContainerPacketTest.kt | 13 +++---- .../net/game/codecs/CharacterInfoCodecTest.kt | 4 +-- .../src/test/resources/fixtures/README.md | 11 ++++-- .../fixtures/game/c2s/03/female_hoenn.bin | Bin 0 -> 43 bytes .../game/c2s/03/female_kanto_32710.bin | Bin 0 -> 35 bytes .../fixtures/game/c2s/03/male_hoenn_32710.bin | Bin 0 -> 35 bytes .../game/c2s/0a/reply_declined_32710.bin | Bin 0 -> 20 bytes .../game/c2s/0a/reply_swapped_32710.bin | Bin 0 -> 20 bytes .../fixtures/game/c2s/21/dialog_reply.bin | Bin 0 -> 2 bytes .../fixtures/game/c2s/32/item_throw.bin | Bin 0 -> 13 bytes .../fixtures/game/c2s/32/move_selection.bin | Bin 0 -> 5 bytes .../resources/fixtures/game/c2s/32/run.bin | Bin 0 -> 2 bytes .../resources/fixtures/game/c2s/32/switch.bin | Bin 0 -> 4 bytes .../game/s2c/02/character_list_32710.bin | Bin 0 -> 538 bytes .../fixtures/game/s2c/13/party_scrubbed.bin | Bin 0 -> 138 bytes .../game/s2c/14/monster_record_32710.bin | Bin 0 -> 139 bytes .../game/s2c/17/prompt_one_move_32710.bin | Bin 0 -> 11 bytes .../game/s2c/17/prompt_two_moves_32710.bin | Bin 0 -> 13 bytes .../fixtures/game/s2c/21/creature_arg.bin | Bin 0 -> 25 bytes .../fixtures/game/s2c/21/flags_00_type_64.bin | Bin 0 -> 19 bytes .../fixtures/game/s2c/21/flags_0c_type_2e.bin | Bin 0 -> 19 bytes .../fixtures/game/s2c/21/flags_0e_type_04.bin | Bin 0 -> 19 bytes .../fixtures/game/s2c/21/species_arg.bin | Bin 0 -> 25 bytes .../game/s2c/30/wild_two_party_scrubbed.bin | Bin 0 -> 236 bytes .../fixtures/game/s2c/35/return_switch_in.bin | Bin 0 -> 25 bytes .../game/s2c/dc/category_flags_31914.bin | Bin 0 -> 833 bytes protocols.login/build.gradle.kts | 1 + .../net/login/LoginCodecRoundtripTest.kt | 4 +-- server.game/build.gradle.kts | 1 + .../game/storage/CharacterRepositoryIT.kt | 2 +- server.login/build.gradle.kts | 1 + .../server/login/auth/JooqUserStoreIT.kt | 2 +- .../login/testsupport/DockerAvailable.kt | 12 ------- settings.gradle.kts | 1 + 65 files changed, 158 insertions(+), 211 deletions(-) create mode 100644 common.test/build.gradle.kts rename {server.game/src/test/kotlin/de/fiereu/openmmo/server/game/testsupport => common.test/src/main/kotlin/de/fiereu/openmmo/common/test}/DockerAvailable.kt (89%) create mode 100644 common.test/src/main/kotlin/de/fiereu/openmmo/common/test/Fixtures.kt rename {bytecodec/src/main/kotlin/de/fiereu/bytecodec => common.test/src/main/kotlin/de/fiereu/openmmo/common}/test/TestHelpers.kt (90%) delete mode 100644 protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/Fixtures.kt create mode 100644 protocols.game/src/test/resources/fixtures/game/c2s/03/female_hoenn.bin create mode 100644 protocols.game/src/test/resources/fixtures/game/c2s/03/female_kanto_32710.bin create mode 100644 protocols.game/src/test/resources/fixtures/game/c2s/03/male_hoenn_32710.bin create mode 100644 protocols.game/src/test/resources/fixtures/game/c2s/0a/reply_declined_32710.bin create mode 100644 protocols.game/src/test/resources/fixtures/game/c2s/0a/reply_swapped_32710.bin create mode 100644 protocols.game/src/test/resources/fixtures/game/c2s/21/dialog_reply.bin create mode 100644 protocols.game/src/test/resources/fixtures/game/c2s/32/item_throw.bin create mode 100644 protocols.game/src/test/resources/fixtures/game/c2s/32/move_selection.bin create mode 100644 protocols.game/src/test/resources/fixtures/game/c2s/32/run.bin create mode 100644 protocols.game/src/test/resources/fixtures/game/c2s/32/switch.bin create mode 100644 protocols.game/src/test/resources/fixtures/game/s2c/02/character_list_32710.bin create mode 100644 protocols.game/src/test/resources/fixtures/game/s2c/13/party_scrubbed.bin create mode 100644 protocols.game/src/test/resources/fixtures/game/s2c/14/monster_record_32710.bin create mode 100644 protocols.game/src/test/resources/fixtures/game/s2c/17/prompt_one_move_32710.bin create mode 100644 protocols.game/src/test/resources/fixtures/game/s2c/17/prompt_two_moves_32710.bin create mode 100644 protocols.game/src/test/resources/fixtures/game/s2c/21/creature_arg.bin create mode 100644 protocols.game/src/test/resources/fixtures/game/s2c/21/flags_00_type_64.bin create mode 100644 protocols.game/src/test/resources/fixtures/game/s2c/21/flags_0c_type_2e.bin create mode 100644 protocols.game/src/test/resources/fixtures/game/s2c/21/flags_0e_type_04.bin create mode 100644 protocols.game/src/test/resources/fixtures/game/s2c/21/species_arg.bin create mode 100644 protocols.game/src/test/resources/fixtures/game/s2c/30/wild_two_party_scrubbed.bin create mode 100644 protocols.game/src/test/resources/fixtures/game/s2c/35/return_switch_in.bin create mode 100644 protocols.game/src/test/resources/fixtures/game/s2c/dc/category_flags_31914.bin delete mode 100644 server.login/src/test/kotlin/de/fiereu/openmmo/server/login/testsupport/DockerAvailable.kt diff --git a/bytecodec/build.gradle.kts b/bytecodec/build.gradle.kts index 762b81e..7531756 100644 --- a/bytecodec/build.gradle.kts +++ b/bytecodec/build.gradle.kts @@ -4,4 +4,7 @@ plugins { id("buildsrc.convention.sonarlint") } -dependencies { testImplementation(libs.bundles.kotest) } +dependencies { + testImplementation(project(":common.test")) + testImplementation(libs.bundles.kotest) +} diff --git a/bytecodec/src/test/kotlin/de/fiereu/bytecodec/AtomsTest.kt b/bytecodec/src/test/kotlin/de/fiereu/bytecodec/AtomsTest.kt index 912a627..cdb5841 100644 --- a/bytecodec/src/test/kotlin/de/fiereu/bytecodec/AtomsTest.kt +++ b/bytecodec/src/test/kotlin/de/fiereu/bytecodec/AtomsTest.kt @@ -1,9 +1,9 @@ package de.fiereu.bytecodec -import de.fiereu.bytecodec.test.assertBytesRoundtrip -import de.fiereu.bytecodec.test.assertValueRoundtrip -import de.fiereu.bytecodec.test.decodeBytes -import de.fiereu.bytecodec.test.encodeToBytes +import de.fiereu.openmmo.common.test.assertBytesRoundtrip +import de.fiereu.openmmo.common.test.assertValueRoundtrip +import de.fiereu.openmmo.common.test.decodeBytes +import de.fiereu.openmmo.common.test.encodeToBytes import io.kotest.assertions.throwables.shouldThrow import io.kotest.core.spec.style.FunSpec import io.kotest.matchers.shouldBe diff --git a/bytecodec/src/test/kotlin/de/fiereu/bytecodec/CombinatorsTest.kt b/bytecodec/src/test/kotlin/de/fiereu/bytecodec/CombinatorsTest.kt index d2d44c8..a7e85fa 100644 --- a/bytecodec/src/test/kotlin/de/fiereu/bytecodec/CombinatorsTest.kt +++ b/bytecodec/src/test/kotlin/de/fiereu/bytecodec/CombinatorsTest.kt @@ -1,9 +1,9 @@ package de.fiereu.bytecodec -import de.fiereu.bytecodec.test.assertBytesRoundtrip -import de.fiereu.bytecodec.test.assertValueRoundtrip -import de.fiereu.bytecodec.test.decodeBytes -import de.fiereu.bytecodec.test.encodeToBytes +import de.fiereu.openmmo.common.test.assertBytesRoundtrip +import de.fiereu.openmmo.common.test.assertValueRoundtrip +import de.fiereu.openmmo.common.test.decodeBytes +import de.fiereu.openmmo.common.test.encodeToBytes import io.kotest.assertions.throwables.shouldThrow import io.kotest.core.spec.style.FunSpec import io.kotest.matchers.shouldBe diff --git a/bytecodec/src/test/kotlin/de/fiereu/bytecodec/PacketCodecTest.kt b/bytecodec/src/test/kotlin/de/fiereu/bytecodec/PacketCodecTest.kt index 67dae60..0fd08ff 100644 --- a/bytecodec/src/test/kotlin/de/fiereu/bytecodec/PacketCodecTest.kt +++ b/bytecodec/src/test/kotlin/de/fiereu/bytecodec/PacketCodecTest.kt @@ -1,8 +1,8 @@ package de.fiereu.bytecodec -import de.fiereu.bytecodec.test.assertBytesRoundtrip -import de.fiereu.bytecodec.test.assertValueRoundtrip -import de.fiereu.bytecodec.test.encodeToBytes +import de.fiereu.openmmo.common.test.assertBytesRoundtrip +import de.fiereu.openmmo.common.test.assertValueRoundtrip +import de.fiereu.openmmo.common.test.encodeToBytes import io.kotest.core.spec.style.FunSpec import io.kotest.matchers.shouldBe diff --git a/common.test/build.gradle.kts b/common.test/build.gradle.kts new file mode 100644 index 0000000..6527389 --- /dev/null +++ b/common.test/build.gradle.kts @@ -0,0 +1,13 @@ +plugins { + id("buildsrc.convention.kotlin-jvm") + id("buildsrc.convention.spotless") + id("buildsrc.convention.sonarlint") +} + +dependencies { + api(project(":bytecodec")) + api(project(":common")) + api(libs.bundles.kotest) + // Only DockerAvailable needs this, so consumers that never touch it stay clear of testcontainers. + compileOnly(libs.testcontainers.postgresql) +} diff --git a/server.game/src/test/kotlin/de/fiereu/openmmo/server/game/testsupport/DockerAvailable.kt b/common.test/src/main/kotlin/de/fiereu/openmmo/common/test/DockerAvailable.kt similarity index 89% rename from server.game/src/test/kotlin/de/fiereu/openmmo/server/game/testsupport/DockerAvailable.kt rename to common.test/src/main/kotlin/de/fiereu/openmmo/common/test/DockerAvailable.kt index 75e8caf..4b959fb 100644 --- a/server.game/src/test/kotlin/de/fiereu/openmmo/server/game/testsupport/DockerAvailable.kt +++ b/common.test/src/main/kotlin/de/fiereu/openmmo/common/test/DockerAvailable.kt @@ -1,4 +1,4 @@ -package de.fiereu.openmmo.server.game.testsupport +package de.fiereu.openmmo.common.test import io.kotest.core.annotation.Condition import io.kotest.core.spec.Spec diff --git a/common.test/src/main/kotlin/de/fiereu/openmmo/common/test/Fixtures.kt b/common.test/src/main/kotlin/de/fiereu/openmmo/common/test/Fixtures.kt new file mode 100644 index 0000000..02ae262 --- /dev/null +++ b/common.test/src/main/kotlin/de/fiereu/openmmo/common/test/Fixtures.kt @@ -0,0 +1,16 @@ +package de.fiereu.openmmo.common.test + +import de.fiereu.bytecodec.ByteArrayReadBuffer + +private object Fixtures + +/** + * Reads a captured payload from a module's `src/test/resources/fixtures`. The path is + * `///.bin` and the name ends in the client version the capture + * came from, when that is known. + */ +fun fixture(path: String): ByteArray = + Fixtures.javaClass.getResourceAsStream("/fixtures/$path")?.readBytes() + ?: error("no fixture at /fixtures/$path") + +fun fixtureBuffer(path: String): ByteArrayReadBuffer = ByteArrayReadBuffer(fixture(path)) diff --git a/bytecodec/src/main/kotlin/de/fiereu/bytecodec/test/TestHelpers.kt b/common.test/src/main/kotlin/de/fiereu/openmmo/common/test/TestHelpers.kt similarity index 90% rename from bytecodec/src/main/kotlin/de/fiereu/bytecodec/test/TestHelpers.kt rename to common.test/src/main/kotlin/de/fiereu/openmmo/common/test/TestHelpers.kt index c4b9d84..16be363 100644 --- a/bytecodec/src/main/kotlin/de/fiereu/bytecodec/test/TestHelpers.kt +++ b/common.test/src/main/kotlin/de/fiereu/openmmo/common/test/TestHelpers.kt @@ -1,8 +1,9 @@ -package de.fiereu.bytecodec.test +package de.fiereu.openmmo.common.test import de.fiereu.bytecodec.ByteArrayReadBuffer import de.fiereu.bytecodec.Codec import de.fiereu.bytecodec.GrowableWriteBuffer +import de.fiereu.openmmo.common.utils.toHex private fun contentEqual(a: Any?, b: Any?): Boolean = when { @@ -43,5 +44,3 @@ fun Codec.assertBytesRoundtrip(bytes: ByteArray) { ) } } - -private fun ByteArray.toHex(): String = joinToString("") { "%02x".format(it.toInt() and 0xFF) } diff --git a/network/build.gradle.kts b/network/build.gradle.kts index 2e5b43a..07a1920 100644 --- a/network/build.gradle.kts +++ b/network/build.gradle.kts @@ -9,6 +9,7 @@ dependencies { api(libs.netty) api(libs.kotlinx.coroutines) implementation(libs.kotlin.logging) + testImplementation(project(":common.test")) testImplementation(libs.bundles.kotest) testImplementation(libs.kotlinx.coroutines.test) testRuntimeOnly(libs.logback) diff --git a/network/src/test/kotlin/de/fiereu/network/handshake/HandshakeCodecsTest.kt b/network/src/test/kotlin/de/fiereu/network/handshake/HandshakeCodecsTest.kt index 645568a..7403100 100644 --- a/network/src/test/kotlin/de/fiereu/network/handshake/HandshakeCodecsTest.kt +++ b/network/src/test/kotlin/de/fiereu/network/handshake/HandshakeCodecsTest.kt @@ -1,8 +1,8 @@ package de.fiereu.network.handshake -import de.fiereu.bytecodec.test.assertValueRoundtrip -import de.fiereu.bytecodec.test.decodeBytes -import de.fiereu.bytecodec.test.encodeToBytes +import de.fiereu.openmmo.common.test.assertValueRoundtrip +import de.fiereu.openmmo.common.test.decodeBytes +import de.fiereu.openmmo.common.test.encodeToBytes import io.kotest.core.spec.style.FunSpec import io.kotest.matchers.shouldBe import java.security.interfaces.ECPublicKey diff --git a/protocols.game/build.gradle.kts b/protocols.game/build.gradle.kts index 34fd19f..3cabd62 100644 --- a/protocols.game/build.gradle.kts +++ b/protocols.game/build.gradle.kts @@ -7,5 +7,6 @@ plugins { dependencies { api(project(":network")) api(project(":common")) + testImplementation(project(":common.test")) testImplementation(libs.bundles.kotest) } diff --git a/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/BattleActionSelectPacketTest.kt b/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/BattleActionSelectPacketTest.kt index da44b07..0992fd1 100644 --- a/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/BattleActionSelectPacketTest.kt +++ b/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/BattleActionSelectPacketTest.kt @@ -1,8 +1,9 @@ package de.fiereu.openmmo.net.game -import de.fiereu.bytecodec.test.decodeBytes -import de.fiereu.bytecodec.test.encodeToBytes import de.fiereu.openmmo.common.enums.BattleAction +import de.fiereu.openmmo.common.test.decodeBytes +import de.fiereu.openmmo.common.test.encodeToBytes +import de.fiereu.openmmo.common.test.fixture import de.fiereu.openmmo.net.game.packets.battle.BattleActionSelectPacket import de.fiereu.openmmo.net.game.packets.battle.BattleActionSelectPacketCodec import io.kotest.core.spec.style.FunSpec @@ -11,7 +12,7 @@ import io.kotest.matchers.shouldBe class BattleActionSelectPacketTest : FunSpec({ test("decodes a captured move selection") { - val bytes = byteArrayOf(0x00, 0x00, 0x2B, 0x00, 0x00) + val bytes = fixture("game/c2s/32/move_selection.bin") val decoded = BattleActionSelectPacketCodec.decodeBytes(bytes) decoded shouldBe BattleActionSelectPacket( @@ -25,21 +26,7 @@ class BattleActionSelectPacketTest : } test("decodes a captured item throw") { - val bytes = - byteArrayOf( - 0x00, - 0x01, - 0x8C.toByte(), - 0x13, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0xFF.toByte()) + val bytes = fixture("game/c2s/32/item_throw.bin") val decoded = BattleActionSelectPacketCodec.decodeBytes(bytes) decoded shouldBe BattleActionSelectPacket( @@ -53,7 +40,7 @@ class BattleActionSelectPacketTest : } test("decodes a run selection with no tail") { - val bytes = byteArrayOf(0x00, 0x03) + val bytes = fixture("game/c2s/32/run.bin") val decoded = BattleActionSelectPacketCodec.decodeBytes(bytes) decoded shouldBe BattleActionSelectPacket( @@ -67,7 +54,7 @@ class BattleActionSelectPacketTest : } test("decodes a captured switch to a party index") { - val bytes = byteArrayOf(0x00, 0x02, 0x01, 0x00) + val bytes = fixture("game/c2s/32/switch.bin") val decoded = BattleActionSelectPacketCodec.decodeBytes(bytes) decoded shouldBe BattleActionSelectPacket( diff --git a/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/BattleEntityMoveEventPacketTest.kt b/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/BattleEntityMoveEventPacketTest.kt index 8aacc30..e0ecaf9 100644 --- a/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/BattleEntityMoveEventPacketTest.kt +++ b/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/BattleEntityMoveEventPacketTest.kt @@ -1,7 +1,7 @@ package de.fiereu.openmmo.net.game -import de.fiereu.bytecodec.test.decodeBytes -import de.fiereu.bytecodec.test.encodeToBytes +import de.fiereu.openmmo.common.test.decodeBytes +import de.fiereu.openmmo.common.test.encodeToBytes import de.fiereu.openmmo.net.game.packets.battle.BattleActionEvent import de.fiereu.openmmo.net.game.packets.battle.BattleEffectTarget import de.fiereu.openmmo.net.game.packets.battle.BattleEntityMoveEventPacket diff --git a/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/BattleFieldStatePacketTest.kt b/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/BattleFieldStatePacketTest.kt index 3aa8ed2..25d9f36 100644 --- a/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/BattleFieldStatePacketTest.kt +++ b/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/BattleFieldStatePacketTest.kt @@ -1,22 +1,18 @@ package de.fiereu.openmmo.net.game -import de.fiereu.bytecodec.test.decodeBytes -import de.fiereu.bytecodec.test.encodeToBytes +import de.fiereu.openmmo.common.test.decodeBytes +import de.fiereu.openmmo.common.test.encodeToBytes +import de.fiereu.openmmo.common.test.fixture import de.fiereu.openmmo.net.game.packets.battle.BattleFieldStatePacket import de.fiereu.openmmo.net.game.packets.battle.BattleFieldStatePacketCodec import de.fiereu.openmmo.net.game.packets.battle.BattleMonBlock import io.kotest.core.spec.style.FunSpec import io.kotest.matchers.shouldBe -import java.util.Base64 - -// A two-monster party wild encounter (Snivy active, Patrat benched), scrubbed of capture data. -private const val CAPTURED_TWO_PARTY = - "AgAAAAAAAAAAAAAAAP8AAAAAABYAAAD/ACAABlQAZQBzAHQAAAAAAJABAAAAAAD/AAJMAxqsDwADgAGkAAQAAAAAAAECAAABAMABAAAAAADvAQYAAAAAAAAWABYAAAAA/wMBQQAhACsAAAAAAAABAQDAAgAAAAAA+AECAAABAAAADgAOAAAAAP8DATIAIQAAAAAAAAABAADvAQYAAAAAAAAD/wAAAABmZmZmAQYAAAAAAAEBAAABAMADAAAAAAD4AQIAAAEAAAAOAA4AAAAA/wMAAQAA+AECAAAAAAEAA/8AAAAAZmZmZgAAAAA=" class BattleFieldStatePacketTest : FunSpec({ test("round-trips a two-party wild field state byte for byte") { - val bytes = Base64.getDecoder().decode(CAPTURED_TWO_PARTY) + val bytes = fixture("game/s2c/30/wild_two_party_scrubbed.bin") val decoded = BattleFieldStatePacketCodec.decodeBytes(bytes) decoded.playerName shouldBe "Test" decoded.playerParty.size shouldBe 2 @@ -25,7 +21,7 @@ class BattleFieldStatePacketTest : } test("decodes the structured mon fields from the capture") { - val bytes = Base64.getDecoder().decode(CAPTURED_TWO_PARTY) + val bytes = fixture("game/s2c/30/wild_two_party_scrubbed.bin") val decoded = BattleFieldStatePacketCodec.decodeBytes(bytes) val snivy = decoded.playerParty[0] diff --git a/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/BattleSwitchInPacketTest.kt b/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/BattleSwitchInPacketTest.kt index 00cc2ac..9398765 100644 --- a/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/BattleSwitchInPacketTest.kt +++ b/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/BattleSwitchInPacketTest.kt @@ -1,7 +1,8 @@ package de.fiereu.openmmo.net.game -import de.fiereu.bytecodec.test.decodeBytes -import de.fiereu.bytecodec.test.encodeToBytes +import de.fiereu.openmmo.common.test.decodeBytes +import de.fiereu.openmmo.common.test.encodeToBytes +import de.fiereu.openmmo.common.test.fixture import de.fiereu.openmmo.common.utils.toHex import de.fiereu.openmmo.net.game.packets.battle.BattleMonBlock import de.fiereu.openmmo.net.game.packets.battle.BattleSwitchInPacket @@ -48,7 +49,7 @@ class BattleSwitchInPacketTest : fullBlock = false, ) val bytes = BattleSwitchInPacketCodec.encodeToBytes(packet) - bytes.toHex() shouldBe "000000010000ef010600000000000003ff0000000066666666" + bytes.toHex() shouldBe fixture("game/s2c/35/return_switch_in.bin").toHex() } // A benched monster coming out carries its full block then its active detail. The block diff --git a/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/CharactersListPacketTest.kt b/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/CharactersListPacketTest.kt index 91a0a62..0625a04 100644 --- a/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/CharactersListPacketTest.kt +++ b/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/CharactersListPacketTest.kt @@ -1,8 +1,7 @@ package de.fiereu.openmmo.net.game -import de.fiereu.bytecodec.ByteArrayReadBuffer import de.fiereu.bytecodec.U8 -import de.fiereu.openmmo.common.utils.hexToBytes +import de.fiereu.openmmo.common.test.fixtureBuffer import de.fiereu.openmmo.net.game.codecs.CharacterInfoCodecShort import de.fiereu.openmmo.net.game.codecs.DefaultSkinSetCodec import de.fiereu.openmmo.net.game.codecs.PokemonCodec @@ -10,28 +9,10 @@ import de.fiereu.openmmo.net.game.codecs.SkinSetCodecNoLeading import io.kotest.core.spec.style.FunSpec import io.kotest.matchers.shouldBe -/** A captured character list. Only the second character has a party, and the third one after it. */ -private const val CAPTURED_LIST_32710 = - "03009008849CEFC41A4D0061006300680065007200520069006E0000000000DA02220101280A696A0C0A696A00000000" + - "001900000000000000000000000000200001000000000000000000FFFFFFFF0000000000000000000000000200040100" + - "06000600020000000000FF0000000000004C030BB80E0003180030029C00000000009088C41C56091861007300740072" + - "0069006400650066006F007500720000000000DA02220100EFCD646A36A69C670000000000B05303007C010000000000" + - "00000020005C005C030000028D0100028D01000000000000000000000002FF02028E010009000D00000100000000FF00" + - "00000000024C031AAC0F00038001A400040000000100C008522BEDAF1A0000009088C41C560918009088C41C56091801" + - "0000EF01BA707DDB009088C41C560918610073007400720069006400650066006F007500720000000000000007180000" + - "002801000000430021002B0016000000231E19000000000000000000000500000100000000000000040502FFFFFFFF03" + - "00EFBDF71E00000020000000000000008686536A0000FFFF00000090882BE6F6C01A4D00610063006800650072004400" + - "6500720000000000DA022201002CF9646AEFF8646A00000000003B0000000000000000000000000020003D0002000000" + - "0133000201330002000000000000000000000100020133010003000200020100000000FF0000000000034C031E280A00" + - "02540070002000000000" - class CharactersListPacketTest : FunSpec({ test("a captured client 32710 character list is consumed to the last byte") { - val bytes = CAPTURED_LIST_32710.hexToBytes() - bytes.size shouldBe 538 - - val buf = ByteArrayReadBuffer(bytes) + val buf = fixtureBuffer("game/s2c/02/character_list_32710.bin") val names = mutableListOf() val parties = mutableListOf() repeat(U8.read(buf)) { @@ -51,15 +32,8 @@ class CharactersListPacketTest : } test("a captured client 32710 monster record is consumed to the last byte") { - // One SocialListEntryAdd payload, which is a bare monster record. - val bytes = - ("00C0885FCC11CB1A00000090484E2A11CB1A0090484E2A11CB1A0100000400184204670090484E2A11CB1A4D00610063" + - "006800520052000000000000000513000000870000000032000A002D0021003400232823190000000000000000000000" + - "000000000000000000580500FFFFFFFF0300EFBDF71E0000002000000000000000EB516F6A0000FFFF0000") - .hexToBytes() - bytes.size shouldBe 139 - - val buf = ByteArrayReadBuffer(bytes) + // A SocialListEntryAdd payload, which is a bare monster record. + val buf = fixtureBuffer("game/s2c/14/monster_record_32710.bin") val mon = PokemonCodec.read(buf) mon.dexId shouldBe 4 diff --git a/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/CreateCharacterPacketTest.kt b/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/CreateCharacterPacketTest.kt index 61b55da..bd288a7 100644 --- a/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/CreateCharacterPacketTest.kt +++ b/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/CreateCharacterPacketTest.kt @@ -1,9 +1,9 @@ package de.fiereu.openmmo.net.game -import de.fiereu.bytecodec.test.decodeBytes -import de.fiereu.bytecodec.test.encodeToBytes import de.fiereu.openmmo.common.enums.SkinSlot -import de.fiereu.openmmo.common.utils.hexToBytes +import de.fiereu.openmmo.common.test.decodeBytes +import de.fiereu.openmmo.common.test.encodeToBytes +import de.fiereu.openmmo.common.test.fixture import de.fiereu.openmmo.common.utils.toHex import de.fiereu.openmmo.net.game.packets.CreateCharacterPacketCodec import io.kotest.core.spec.style.FunSpec @@ -12,9 +12,7 @@ import io.kotest.matchers.shouldBe class CreateCharacterPacketTest : FunSpec({ test("decodes the captured female Hoenn character creation") { - val bytes = - "4c0061006e0061006e0061005400650073007400540077006f0000000101014c0304600f00030800680084" - .hexToBytes() + val bytes = fixture("game/c2s/03/female_hoenn.bin") val packet = CreateCharacterPacketCodec.decodeBytes(bytes) @@ -33,8 +31,7 @@ class CreateCharacterPacketTest : } test("roundtrips the new male Hoenn character creation capture") { - val bytes = - "4d006100630068006500720044006500720000000001034c031e280a00025400700020".hexToBytes() + val bytes = fixture("game/c2s/03/male_hoenn_32710.bin") val packet = CreateCharacterPacketCodec.decodeBytes(bytes) @@ -46,8 +43,7 @@ class CreateCharacterPacketTest : } test("roundtrips the independent female Kanto character creation capture") { - val bytes = - "4d0061006300680065007200520069006e0000000100004c030bb80e0003180030029c".hexToBytes() + val bytes = fixture("game/c2s/03/female_kanto_32710.bin") val packet = CreateCharacterPacketCodec.decodeBytes(bytes) diff --git a/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/DialogActionPacketTest.kt b/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/DialogActionPacketTest.kt index 731226f..8dd07aa 100644 --- a/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/DialogActionPacketTest.kt +++ b/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/DialogActionPacketTest.kt @@ -1,8 +1,8 @@ package de.fiereu.openmmo.net.game -import de.fiereu.bytecodec.test.decodeBytes -import de.fiereu.bytecodec.test.encodeToBytes -import de.fiereu.openmmo.common.utils.hexToBytes +import de.fiereu.openmmo.common.test.decodeBytes +import de.fiereu.openmmo.common.test.encodeToBytes +import de.fiereu.openmmo.common.test.fixture import de.fiereu.openmmo.common.utils.toHex import de.fiereu.openmmo.net.game.packets.dialog.CreatureDataArg import de.fiereu.openmmo.net.game.packets.dialog.DialogActionPacketCodec @@ -12,26 +12,25 @@ import io.kotest.matchers.shouldBe class DialogActionPacketTest : FunSpec({ - // Every case is a real 0x21 dialog action from the NPC interaction capture. val captures = listOf( - "0c2e0d00b52903e008bf86c4c01ab004000000", - "006400000000ffffffffffffffff0000000000", - "0e04f90600010ae008bf86c4c01ab004000000", - "0d04f80600010ae008bf86c4c01ab004000001000992d00300", + "flags_0c_type_2e", + "flags_00_type_64", + "flags_0e_type_04", + "creature_arg", + "species_arg", ) test("round-trips every captured dialog action byte for byte") { - captures.forEach { hex -> - val packet = DialogActionPacketCodec.decodeBytes(hex.hexToBytes()) - DialogActionPacketCodec.encodeToBytes(packet).toHex() shouldBe hex + captures.forEach { name -> + val bytes = fixture("game/s2c/21/$name.bin") + val packet = DialogActionPacketCodec.decodeBytes(bytes) + DialogActionPacketCodec.encodeToBytes(packet).toHex() shouldBe bytes.toHex() } } test("decodes the fields of a dialog action carrying a creature arg") { - val packet = - DialogActionPacketCodec.decodeBytes( - "0d04f80600010ae008bf86c4c01ab004000001000992d00300".hexToBytes()) + val packet = DialogActionPacketCodec.decodeBytes(fixture("game/s2c/21/creature_arg.bin")) packet.flags shouldBe 0x0d.toByte() packet.actionType shouldBe 0x04.toByte() packet.textId shouldBe 0x010006f8 @@ -41,7 +40,7 @@ class DialogActionPacketTest : } test("species-name argument uses the captured party slot variable and species order") { - val bytes = "000400000000ffffffffffffffff0000000001020101ff0000".hexToBytes() + val bytes = fixture("game/s2c/21/species_arg.bin") val packet = DialogActionPacketCodec.decodeBytes(bytes) packet.messageArgs shouldBe listOf(TextPokemonSpeciesArg(1, 1, 255)) diff --git a/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/DialogActionResponsePacketTest.kt b/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/DialogActionResponsePacketTest.kt index 972f494..32f0511 100644 --- a/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/DialogActionResponsePacketTest.kt +++ b/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/DialogActionResponsePacketTest.kt @@ -1,7 +1,8 @@ package de.fiereu.openmmo.net.game -import de.fiereu.bytecodec.test.decodeBytes -import de.fiereu.bytecodec.test.encodeToBytes +import de.fiereu.openmmo.common.test.decodeBytes +import de.fiereu.openmmo.common.test.encodeToBytes +import de.fiereu.openmmo.common.test.fixture import de.fiereu.openmmo.net.game.packets.dialog.DialogActionResponsePacket import de.fiereu.openmmo.net.game.packets.dialog.DialogActionResponsePacketCodec import io.kotest.core.spec.style.FunSpec @@ -9,10 +10,9 @@ import io.kotest.matchers.shouldBe class DialogActionResponsePacketTest : FunSpec({ - // The client replies to a 0x21 dialog action with the action id and a response byte. This is - // the "0c 00" the capture sends back after the "0c" dialog action. + // The client replies to a 0x21 dialog action with the action id and a response byte. test("round-trips the captured dialog reply") { - val bytes = byteArrayOf(0x0c, 0x00) + val bytes = fixture("game/c2s/21/dialog_reply.bin") val packet = DialogActionResponsePacketCodec.decodeBytes(bytes) packet shouldBe DialogActionResponsePacket(id = 0x0c, unk = 0) DialogActionResponsePacketCodec.encodeToBytes(packet) shouldBe bytes diff --git a/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/Fixtures.kt b/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/Fixtures.kt deleted file mode 100644 index 4049d11..0000000 --- a/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/Fixtures.kt +++ /dev/null @@ -1,15 +0,0 @@ -package de.fiereu.openmmo.net.game - -import de.fiereu.bytecodec.ByteArrayReadBuffer - -private object Fixtures - -/** - * Reads a captured payload from `src/test/resources/fixtures`. The path is - * `///.bin` and the name ends in the client version the capture - * came from. - */ -fun fixture(path: String): ByteArrayReadBuffer = - ByteArrayReadBuffer( - Fixtures.javaClass.getResourceAsStream("/fixtures/$path")?.readBytes() - ?: error("no fixture at /fixtures/$path")) diff --git a/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/FriendListPacketTest.kt b/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/FriendListPacketTest.kt index b46ab45..edd72e2 100644 --- a/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/FriendListPacketTest.kt +++ b/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/FriendListPacketTest.kt @@ -1,7 +1,7 @@ package de.fiereu.openmmo.net.game -import de.fiereu.bytecodec.test.decodeBytes -import de.fiereu.bytecodec.test.encodeToBytes +import de.fiereu.openmmo.common.test.decodeBytes +import de.fiereu.openmmo.common.test.encodeToBytes import de.fiereu.openmmo.net.game.packets.FriendListEntry import de.fiereu.openmmo.net.game.packets.FriendListPacket import de.fiereu.openmmo.net.game.packets.FriendListPacketCodec diff --git a/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/GameCodecRoundtripTest.kt b/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/GameCodecRoundtripTest.kt index b457880..0c6adc4 100644 --- a/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/GameCodecRoundtripTest.kt +++ b/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/GameCodecRoundtripTest.kt @@ -1,8 +1,8 @@ package de.fiereu.openmmo.net.game -import de.fiereu.bytecodec.test.decodeBytes -import de.fiereu.bytecodec.test.encodeToBytes import de.fiereu.openmmo.common.enums.Direction +import de.fiereu.openmmo.common.test.decodeBytes +import de.fiereu.openmmo.common.test.encodeToBytes import de.fiereu.openmmo.net.game.packets.DialogStatePacket import de.fiereu.openmmo.net.game.packets.DialogStatePacketCodec import de.fiereu.openmmo.net.game.packets.EntityLeavePacket diff --git a/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/GtlListingsPagePacketTest.kt b/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/GtlListingsPagePacketTest.kt index 34eb1de..b44b4cc 100644 --- a/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/GtlListingsPagePacketTest.kt +++ b/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/GtlListingsPagePacketTest.kt @@ -1,5 +1,6 @@ package de.fiereu.openmmo.net.game +import de.fiereu.openmmo.common.test.fixtureBuffer import de.fiereu.openmmo.net.game.packets.gtl.GtlListKind import de.fiereu.openmmo.net.game.packets.gtl.GtlListingsPagePacketCodec import de.fiereu.openmmo.net.game.packets.gtl.GtlListingsPageRequestPacketCodec @@ -9,7 +10,7 @@ import io.kotest.matchers.shouldBe class GtlListingsPagePacketTest : FunSpec({ test("a captured price list request round trips") { - val buf = fixture("game/c2s/e4/price_list_request_31914.bin") + val buf = fixtureBuffer("game/c2s/e4/price_list_request_31914.bin") val request = GtlListingsPageRequestPacketCodec.read(buf) request.requestId shouldBe 3.toByte() @@ -20,7 +21,7 @@ class GtlListingsPagePacketTest : } test("a captured price list page is consumed to the last byte") { - val buf = fixture("game/s2c/fe/price_history_32710.bin") + val buf = fixtureBuffer("game/s2c/fe/price_history_32710.bin") val page = GtlListingsPagePacketCodec.read(buf) page.requestId shouldBe 1.toByte() @@ -35,7 +36,7 @@ class GtlListingsPagePacketTest : } test("a later price list page reports which page it answers") { - val buf = fixture("game/s2c/fe/price_history_page2_31914.bin") + val buf = fixtureBuffer("game/s2c/fe/price_history_page2_31914.bin") val page = GtlListingsPagePacketCodec.read(buf) page.requestId shouldBe 3.toByte() diff --git a/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/GtlMarketListingsPacketTest.kt b/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/GtlMarketListingsPacketTest.kt index 77be79f..2df5968 100644 --- a/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/GtlMarketListingsPacketTest.kt +++ b/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/GtlMarketListingsPacketTest.kt @@ -1,6 +1,7 @@ package de.fiereu.openmmo.net.game import de.fiereu.bytecodec.ByteArrayReadBuffer +import de.fiereu.openmmo.common.test.fixtureBuffer import de.fiereu.openmmo.net.game.packets.gtl.GtlMarketListingsPacketCodec import de.fiereu.openmmo.net.game.packets.gtl.GtlMarketListingsRequestPacketCodec import io.kotest.core.spec.style.FunSpec @@ -15,7 +16,7 @@ class GtlMarketListingsPacketTest : } test("a captured board page is consumed to the last byte") { - val buf = fixture("game/s2c/70/board_page_31914.bin") + val buf = fixtureBuffer("game/s2c/70/board_page_31914.bin") val board = GtlMarketListingsPacketCodec.read(buf) board.fullReset shouldBe false diff --git a/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/GtlOpenSessionPacketTest.kt b/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/GtlOpenSessionPacketTest.kt index 584630e..581a243 100644 --- a/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/GtlOpenSessionPacketTest.kt +++ b/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/GtlOpenSessionPacketTest.kt @@ -1,7 +1,6 @@ package de.fiereu.openmmo.net.game -import de.fiereu.bytecodec.ByteArrayReadBuffer -import de.fiereu.openmmo.common.utils.hexToBytes +import de.fiereu.openmmo.common.test.fixtureBuffer import de.fiereu.openmmo.net.game.packets.CategoryFlagsPacketCodec import de.fiereu.openmmo.net.game.packets.gtl.GtlOpenSessionPacketCodec import io.kotest.core.spec.style.FunSpec @@ -10,21 +9,19 @@ import io.kotest.matchers.shouldBe class GtlOpenSessionPacketTest : FunSpec({ test("the first open carries no timestamp") { - val buf = fixture("game/c2s/a5/open_session_first_31914.bin") + val buf = fixtureBuffer("game/c2s/a5/open_session_first_31914.bin") GtlOpenSessionPacketCodec.read(buf).sessionTimestamp shouldBe 0L buf.remaining() shouldBe 0 } test("the next open echoes the timestamp the server just sent") { - // The flag bytes are opaque, so only the header comes from the capture. - val flagBytes = ("01" + "85C2F6559E010000" + "3603" + "00".repeat(822)).hexToBytes() - val flagBuf = ByteArrayReadBuffer(flagBytes) + val flagBuf = fixtureBuffer("game/s2c/dc/category_flags_31914.bin") val flags = CategoryFlagsPacketCodec.read(flagBuf) flags.entryKind shouldBe 1 flags.flagBits.size shouldBe 822 flagBuf.remaining() shouldBe 0 - val reopen = fixture("game/c2s/a5/open_session_reopen_31914.bin") + val reopen = fixtureBuffer("game/c2s/a5/open_session_reopen_31914.bin") GtlOpenSessionPacketCodec.read(reopen).sessionTimestamp shouldBe flags.timestampMillis reopen.remaining() shouldBe 0 } diff --git a/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/GtlSearchPagePacketTest.kt b/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/GtlSearchPagePacketTest.kt index 115a919..cef9afc 100644 --- a/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/GtlSearchPagePacketTest.kt +++ b/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/GtlSearchPagePacketTest.kt @@ -1,5 +1,6 @@ package de.fiereu.openmmo.net.game +import de.fiereu.openmmo.common.test.fixtureBuffer import de.fiereu.openmmo.net.game.packets.gtl.GtlItemListing import de.fiereu.openmmo.net.game.packets.gtl.GtlListKind import de.fiereu.openmmo.net.game.packets.gtl.GtlPokemonListing @@ -10,7 +11,7 @@ import io.kotest.matchers.shouldBe class GtlSearchPagePacketTest : FunSpec({ test("a captured item page is consumed to the last byte") { - val buf = fixture("game/s2c/9b/item_page_32710.bin") + val buf = fixtureBuffer("game/s2c/9b/item_page_32710.bin") val page = GtlSearchPagePacketCodec.read(buf) page.requestId shouldBe 7.toByte() @@ -30,7 +31,7 @@ class GtlSearchPagePacketTest : } test("a captured monster page is consumed to the last byte") { - val buf = fixture("game/s2c/9b/monster_page_32710.bin") + val buf = fixtureBuffer("game/s2c/9b/monster_page_32710.bin") val page = GtlSearchPagePacketCodec.read(buf) page.requestId shouldBe 1.toByte() @@ -53,7 +54,7 @@ class GtlSearchPagePacketTest : } test("a page that is not an item board carries no quote strip") { - val buf = fixture("game/s2c/9b/own_listings_page_31914.bin") + val buf = fixtureBuffer("game/s2c/9b/own_listings_page_31914.bin") val page = GtlSearchPagePacketCodec.read(buf) page.listKind shouldBe GtlListKind.OWN_LISTINGS diff --git a/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/GtlSearchPageRequestPacketTest.kt b/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/GtlSearchPageRequestPacketTest.kt index 25031a6..802336f 100644 --- a/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/GtlSearchPageRequestPacketTest.kt +++ b/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/GtlSearchPageRequestPacketTest.kt @@ -1,5 +1,6 @@ package de.fiereu.openmmo.net.game +import de.fiereu.openmmo.common.test.fixtureBuffer import de.fiereu.openmmo.net.game.packets.gtl.GtlFilterKind import de.fiereu.openmmo.net.game.packets.gtl.GtlListKind import de.fiereu.openmmo.net.game.packets.gtl.GtlSearchPageRequestPacketCodec @@ -10,7 +11,7 @@ import io.kotest.matchers.shouldBe class GtlSearchPageRequestPacketTest : FunSpec({ test("an unfiltered search carries no filters") { - val buf = fixture("game/c2s/9b/own_listings_request_31914.bin") + val buf = fixtureBuffer("game/c2s/9b/own_listings_request_31914.bin") val request = GtlSearchPageRequestPacketCodec.read(buf) request.requestId shouldBe 3.toByte() @@ -22,7 +23,7 @@ class GtlSearchPageRequestPacketTest : } test("a search filtered to one species carries its dex id") { - val buf = fixture("game/c2s/9b/one_species_filter_32710.bin") + val buf = fixtureBuffer("game/c2s/9b/one_species_filter_32710.bin") val request = GtlSearchPageRequestPacketCodec.read(buf) request.requestId shouldBe 4.toByte() @@ -31,7 +32,7 @@ class GtlSearchPageRequestPacketTest : } test("a search filtered to thirteen species carries all of them") { - val buf = fixture("game/c2s/9b/thirteen_species_filter_32710.bin") + val buf = fixtureBuffer("game/c2s/9b/thirteen_species_filter_32710.bin") val request = GtlSearchPageRequestPacketCodec.read(buf) request.listKind shouldBe GtlListKind.ITEM @@ -42,7 +43,7 @@ class GtlSearchPageRequestPacketTest : } test("a filtered search carries one entry per filter") { - val buf = fixture("game/c2s/9b/eleven_filters_32710.bin") + val buf = fixtureBuffer("game/c2s/9b/eleven_filters_32710.bin") val request = GtlSearchPageRequestPacketCodec.read(buf) request.filters.size shouldBe 11 diff --git a/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/GtlTradeLogRequestPacketTest.kt b/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/GtlTradeLogRequestPacketTest.kt index 3228a3b..6a4b757 100644 --- a/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/GtlTradeLogRequestPacketTest.kt +++ b/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/GtlTradeLogRequestPacketTest.kt @@ -1,6 +1,7 @@ package de.fiereu.openmmo.net.game import de.fiereu.bytecodec.ByteArrayReadBuffer +import de.fiereu.openmmo.common.test.fixtureBuffer import de.fiereu.openmmo.net.game.packets.SceneObjectStatesPacketCodec import de.fiereu.openmmo.net.game.packets.gtl.GtlTradeLogRequestPacketCodec import io.kotest.core.spec.style.FunSpec @@ -13,7 +14,7 @@ class GtlTradeLogRequestPacketTest : GtlTradeLogRequestPacketCodec.read(request) request.remaining() shouldBe 0 - val reply = fixture("game/s2c/5e/empty_trade_log_31914.bin") + val reply = fixtureBuffer("game/s2c/5e/empty_trade_log_31914.bin") SceneObjectStatesPacketCodec.read(reply).objects shouldBe emptyList() reply.remaining() shouldBe 0 } diff --git a/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/GuildMembershipPacketTest.kt b/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/GuildMembershipPacketTest.kt index a9509bd..2ef4732 100644 --- a/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/GuildMembershipPacketTest.kt +++ b/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/GuildMembershipPacketTest.kt @@ -1,7 +1,7 @@ package de.fiereu.openmmo.net.game -import de.fiereu.bytecodec.test.decodeBytes -import de.fiereu.bytecodec.test.encodeToBytes +import de.fiereu.openmmo.common.test.decodeBytes +import de.fiereu.openmmo.common.test.encodeToBytes import de.fiereu.openmmo.net.game.packets.guild.GuildMembershipPacket import de.fiereu.openmmo.net.game.packets.guild.GuildMembershipPacketCodec import de.fiereu.openmmo.net.game.packets.guild.GuildProfileData diff --git a/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/GuildRankPermissionUpdatePacketTest.kt b/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/GuildRankPermissionUpdatePacketTest.kt index 8ac364f..6a0db14 100644 --- a/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/GuildRankPermissionUpdatePacketTest.kt +++ b/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/GuildRankPermissionUpdatePacketTest.kt @@ -1,9 +1,9 @@ package de.fiereu.openmmo.net.game -import de.fiereu.bytecodec.test.decodeBytes -import de.fiereu.bytecodec.test.encodeToBytes import de.fiereu.openmmo.common.enums.GuildPermission import de.fiereu.openmmo.common.enums.GuildRank +import de.fiereu.openmmo.common.test.decodeBytes +import de.fiereu.openmmo.common.test.encodeToBytes import de.fiereu.openmmo.net.game.packets.guild.GuildRankPermissionUpdatePacket import de.fiereu.openmmo.net.game.packets.guild.GuildRankPermissionUpdatePacketCodec import io.kotest.core.spec.style.FunSpec diff --git a/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/MoveLearnPacketsTest.kt b/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/MoveLearnPacketsTest.kt index d20718b..6a98c29 100644 --- a/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/MoveLearnPacketsTest.kt +++ b/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/MoveLearnPacketsTest.kt @@ -1,7 +1,8 @@ package de.fiereu.openmmo.net.game -import de.fiereu.bytecodec.test.decodeBytes -import de.fiereu.bytecodec.test.encodeToBytes +import de.fiereu.openmmo.common.test.decodeBytes +import de.fiereu.openmmo.common.test.encodeToBytes +import de.fiereu.openmmo.common.test.fixture import de.fiereu.openmmo.net.game.packets.battle.moves.MoveLearnPromptPacket import de.fiereu.openmmo.net.game.packets.battle.moves.MoveLearnPromptPacketCodec import de.fiereu.openmmo.net.game.packets.battle.moves.MoveLearnReplyPacket @@ -16,21 +17,17 @@ private const val WATER_GUN: Short = 55 private const val LEER: Short = 43 private const val UNOVA_MOVE: Short = 526 -private fun entityIdBytes() = - byteArrayOf( - 0x00, 0xC0.toByte(), 0xC8.toByte(), 0x2A, 0xEF.toByte(), 0xAD.toByte(), 0xCE.toByte(), 0x1A) - class MoveLearnPacketsTest : FunSpec({ test("decodes a captured prompt for one move") { - val bytes = entityIdBytes() + byteArrayOf(0x01, 0x9A.toByte(), 0x00) + val bytes = fixture("game/s2c/17/prompt_one_move_32710.bin") val decoded = MoveLearnPromptPacketCodec.decodeBytes(bytes) decoded shouldBe MoveLearnPromptPacket(ENTITY_ID, listOf(FURY_SWIPES)) MoveLearnPromptPacketCodec.encodeToBytes(decoded) shouldBe bytes } test("decodes a captured prompt for two moves") { - val bytes = entityIdBytes() + byteArrayOf(0x02, 0x18, 0x02, 0x59, 0x01) + val bytes = fixture("game/s2c/17/prompt_two_moves_32710.bin") val decoded = MoveLearnPromptPacketCodec.decodeBytes(bytes) decoded shouldBe MoveLearnPromptPacket(ENTITY_ID, listOf(536, 345)) MoveLearnPromptPacketCodec.encodeToBytes(decoded) shouldBe bytes @@ -38,21 +35,7 @@ class MoveLearnPacketsTest : // Fury Swipes took the slot Leer held. test("decodes a captured reply that swapped a move in") { - val bytes = - entityIdBytes() + - byteArrayOf( - 0x04, - 0x0E, - 0x02, - 0x9A.toByte(), - 0x00, - 0x7A, - 0x00, - 0x37, - 0x00, - 0x01, - 0x9A.toByte(), - 0x00) + val bytes = fixture("game/c2s/0a/reply_swapped_32710.bin") val decoded = MoveLearnReplyPacketCodec.decodeBytes(bytes) decoded shouldBe MoveLearnReplyPacket( @@ -65,10 +48,7 @@ class MoveLearnPacketsTest : // The moveset comes back as it was, so the player kept Leer. test("decodes a captured reply that declined") { - val bytes = - entityIdBytes() + - byteArrayOf( - 0x04, 0x0E, 0x02, 0x2B, 0x00, 0x7A, 0x00, 0x37, 0x00, 0x01, 0x9A.toByte(), 0x00) + val bytes = fixture("game/c2s/0a/reply_declined_32710.bin") val decoded = MoveLearnReplyPacketCodec.decodeBytes(bytes) decoded shouldBe MoveLearnReplyPacket( diff --git a/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/PokemonContainerPacketTest.kt b/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/PokemonContainerPacketTest.kt index 6e5faf4..04fe700 100644 --- a/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/PokemonContainerPacketTest.kt +++ b/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/PokemonContainerPacketTest.kt @@ -1,19 +1,19 @@ package de.fiereu.openmmo.net.game -import de.fiereu.bytecodec.test.decodeBytes -import de.fiereu.bytecodec.test.encodeToBytes import de.fiereu.openmmo.common.Pokemon import de.fiereu.openmmo.common.PokemonMove import de.fiereu.openmmo.common.enums.EVs import de.fiereu.openmmo.common.enums.IVs import de.fiereu.openmmo.common.enums.PokemonContainer +import de.fiereu.openmmo.common.test.decodeBytes +import de.fiereu.openmmo.common.test.encodeToBytes +import de.fiereu.openmmo.common.test.fixture import de.fiereu.openmmo.net.game.codecs.PokemonCodec import de.fiereu.openmmo.net.game.packets.PokemonContainerPacket import de.fiereu.openmmo.net.game.packets.PokemonContainerPacketCodec import io.kotest.core.spec.style.FunSpec import io.kotest.matchers.shouldBe import java.time.LocalDateTime -import java.util.Base64 private fun testMon(id: Long, dex: Int, slot: Short) = Pokemon( @@ -40,13 +40,10 @@ private fun testMon(id: Long, dex: Int, slot: Short) = caughtAt = LocalDateTime.of(2026, 1, 1, 0, 0, 0), ) -private const val CAPTURED_PARTY = - "AQEBAMABAAAAAAAAAACQAQAAAAAAAJABAAAAAAABAADvAbpwfdsAkAEAAAAAAFQAZQBzAHQAAAAAAAAABRQAAAClAAAAADIAIQArAAAAAAAjHgAAAAAAAAAAAAAAAAAAAQAAAAAAAAAEBQL/////AwDvvfceAAAAIAAAAAAAAACGhlNqAAD//wAA" - class PokemonContainerPacketTest : FunSpec({ test("round-trips a captured party container and exposes the monster fields") { - val bytes = Base64.getDecoder().decode(CAPTURED_PARTY) + val bytes = bytes() val decoded = PokemonContainerPacketCodec.decodeBytes(bytes) val mon = decoded.pokemon.single() mon.dexId shouldBe 495 @@ -125,4 +122,4 @@ class PokemonContainerPacketTest : } }) -private fun bytes(): ByteArray = Base64.getDecoder().decode(CAPTURED_PARTY) +private fun bytes(): ByteArray = fixture("game/s2c/13/party_scrubbed.bin") diff --git a/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/codecs/CharacterInfoCodecTest.kt b/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/codecs/CharacterInfoCodecTest.kt index d5ab2a9..9cf17cf 100644 --- a/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/codecs/CharacterInfoCodecTest.kt +++ b/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/codecs/CharacterInfoCodecTest.kt @@ -1,8 +1,8 @@ package de.fiereu.openmmo.net.game.codecs -import de.fiereu.bytecodec.test.decodeBytes -import de.fiereu.bytecodec.test.encodeToBytes import de.fiereu.openmmo.common.CharacterInfo +import de.fiereu.openmmo.common.test.decodeBytes +import de.fiereu.openmmo.common.test.encodeToBytes import io.kotest.core.spec.style.FunSpec import io.kotest.matchers.shouldBe import java.time.LocalDateTime diff --git a/protocols.game/src/test/resources/fixtures/README.md b/protocols.game/src/test/resources/fixtures/README.md index cf40392..49d7fc9 100644 --- a/protocols.game/src/test/resources/fixtures/README.md +++ b/protocols.game/src/test/resources/fixtures/README.md @@ -4,11 +4,16 @@ Raw packet payloads from real captures, one file per packet. ///_.bin -Packet id is lowercase hex without a prefix. The version matters: the wire format changes between -clients. +Packet id is lowercase hex without a prefix. The version matters, the wire format changes between +clients, so carry it whenever the capture can be traced back to a session. A few older payloads +predate that rule and have no suffix. `_scrubbed` means player data was replaced before the payload +was committed, so it no longer matches anything in the archive. + +`fixture` gives you the bytes, `fixtureBuffer` wraps them for a codec that reads from a buffer. Both +live in the `common.test` module. ```kotlin -val buf = fixture("game/s2c/9b/monster_page_32710.bin") +val buf = fixtureBuffer("game/s2c/9b/monster_page_32710.bin") GtlSearchPagePacketCodec.read(buf) buf.remaining() shouldBe 0 ``` diff --git a/protocols.game/src/test/resources/fixtures/game/c2s/03/female_hoenn.bin b/protocols.game/src/test/resources/fixtures/game/c2s/03/female_hoenn.bin new file mode 100644 index 0000000000000000000000000000000000000000..8fe20f091088909542580749eec8c623beff97d7 GIT binary patch literal 43 scmeZaNMy)^;t+;ZhGK>ih7g8whI|GF21Z6kA7+*Weg~cegyRZ literal 0 HcmV?d00001 diff --git a/protocols.game/src/test/resources/fixtures/game/c2s/0a/reply_declined_32710.bin b/protocols.game/src/test/resources/fixtures/game/c2s/0a/reply_declined_32710.bin new file mode 100644 index 0000000000000000000000000000000000000000..5c8157a545b2c7d29df169482978d361015ffeda GIT binary patch literal 20 bcmZQLa6;?-+H+DYd`#L5RSf0~jI$U3OxOj& literal 0 HcmV?d00001 diff --git a/protocols.game/src/test/resources/fixtures/game/c2s/0a/reply_swapped_32710.bin b/protocols.game/src/test/resources/fixtures/game/c2s/0a/reply_swapped_32710.bin new file mode 100644 index 0000000000000000000000000000000000000000..44ca18147996b11b334421b9b53f862bf4dff376 GIT binary patch literal 20 ccmZQLa6;?-+H+DYd`z<#su;`}7-um608qaMF#rGn literal 0 HcmV?d00001 diff --git a/protocols.game/src/test/resources/fixtures/game/c2s/21/dialog_reply.bin b/protocols.game/src/test/resources/fixtures/game/c2s/21/dialog_reply.bin new file mode 100644 index 0000000000000000000000000000000000000000..e0868ebc990a775da20101e0d95c9c3cea942acc GIT binary patch literal 2 Jcmd;K0000Q01W^D literal 0 HcmV?d00001 diff --git a/protocols.game/src/test/resources/fixtures/game/c2s/32/item_throw.bin b/protocols.game/src/test/resources/fixtures/game/c2s/32/item_throw.bin new file mode 100644 index 0000000000000000000000000000000000000000..28de4d35b080cbb602801002c95c89b0f139e7c9 GIT binary patch literal 13 OcmZQz>=9;wg8u*q+5w;d literal 0 HcmV?d00001 diff --git a/protocols.game/src/test/resources/fixtures/game/c2s/32/move_selection.bin b/protocols.game/src/test/resources/fixtures/game/c2s/32/move_selection.bin new file mode 100644 index 0000000000000000000000000000000000000000..ab2e9846ae0e3eae0cbdc4e2606d5ab6b058c497 GIT binary patch literal 5 McmZQz&}Lu&004#nEC2ui literal 0 HcmV?d00001 diff --git a/protocols.game/src/test/resources/fixtures/game/c2s/32/run.bin b/protocols.game/src/test/resources/fixtures/game/c2s/32/run.bin new file mode 100644 index 0000000000000000000000000000000000000000..a903574af00b573ad9bdb2bccf8d93ed00c675de GIT binary patch literal 2 JcmZQz1^@sB00aO4 literal 0 HcmV?d00001 diff --git a/protocols.game/src/test/resources/fixtures/game/c2s/32/switch.bin b/protocols.game/src/test/resources/fixtures/game/c2s/32/switch.bin new file mode 100644 index 0000000000000000000000000000000000000000..4f81a0dfb435c25f32dc25d023d63e18a066970a GIT binary patch literal 4 LcmZQzVq^dS01N;G literal 0 HcmV?d00001 diff --git a/protocols.game/src/test/resources/fixtures/game/s2c/02/character_list_32710.bin b/protocols.game/src/test/resources/fixtures/game/s2c/02/character_list_32710.bin new file mode 100644 index 0000000000000000000000000000000000000000..cca080410381c9a96007126347bdae48d86ec217 GIT binary patch literal 538 zcmZ`$J4?hs5dL=ePVdfFCoxEf+5}=D2sUD+Wo+)m>YBs&ND4iCbP5)7T%+U%q!cSb zOA&-CuJsRSZzt(|ROjsEffmj(lbLUa%(vetM3sv;>6`0lVGDcM#v$qmun%o7a#jeZ z7KEeZj7)LNgAI|V7?2eOB@!ipAv%)L?9Njo593e<7G%tL)a_4iR*e>pa7?oU_{3oc z2RNZho92Mz*$i*|70tU8?A*dZ4y3#isA3E$&y<7olzBS=buO+^ zqDFyUrS87pnUrU2@-GcZ#AEyHH3$Bu2@D(b14r{(#SC0bQZ{G(60DrjAiPwTS}%p< z>C>XxCfC;KG)QL_GU~c-AH6?|S>yHSJ{D#E+Ygg3KV8hSh6}T?!n%t^NbSW1y_Nt0 UMVMp_Q&E(sET;y!fp$vf2Lb(6cK`qY literal 0 HcmV?d00001 diff --git a/protocols.game/src/test/resources/fixtures/game/s2c/13/party_scrubbed.bin b/protocols.game/src/test/resources/fixtures/game/s2c/13/party_scrubbed.bin new file mode 100644 index 0000000000000000000000000000000000000000..31fdf005076e01ef93b49f0272f86b8c5be03547 GIT binary patch literal 138 zcmZQ%WMnwN$N&Wspe!g2I1H%LlKP?aoN;5JrurNqCv82NUd>IlMk{L1>f`AYLScQRfJBV$> uz{Q};pvYjtpsb-R36Vu5BUl;!0|7I``@P@gfKm!j>DPhzSqwla1_l601sYcX literal 0 HcmV?d00001 diff --git a/protocols.game/src/test/resources/fixtures/game/s2c/17/prompt_one_move_32710.bin b/protocols.game/src/test/resources/fixtures/game/s2c/17/prompt_one_move_32710.bin new file mode 100644 index 0000000000000000000000000000000000000000..366b6b8b9ecbea3a13c5800521dc364116672644 GIT binary patch literal 11 ScmZQLa6;?-+H+Ejvlsv%9|Y0> literal 0 HcmV?d00001 diff --git a/protocols.game/src/test/resources/fixtures/game/s2c/17/prompt_two_moves_32710.bin b/protocols.game/src/test/resources/fixtures/game/s2c/17/prompt_two_moves_32710.bin new file mode 100644 index 0000000000000000000000000000000000000000..fcd8c2098a07f5506afbd49eecdbeda92dae715b GIT binary patch literal 13 UcmZQLa6;?-+H+D&5=@bd04R9`tpET3 literal 0 HcmV?d00001 diff --git a/protocols.game/src/test/resources/fixtures/game/s2c/21/creature_arg.bin b/protocols.game/src/test/resources/fixtures/game/s2c/21/creature_arg.bin new file mode 100644 index 0000000000000000000000000000000000000000..9538bf4c86b042574c88b22a29763c07207bf3ed GIT binary patch literal 25 hcmd;O`N77($n}6@f7_7*QX5zp7#JBiCtYA>003Xe2MGWG literal 0 HcmV?d00001 diff --git a/protocols.game/src/test/resources/fixtures/game/s2c/21/flags_00_type_64.bin b/protocols.game/src/test/resources/fixtures/game/s2c/21/flags_00_type_64.bin new file mode 100644 index 0000000000000000000000000000000000000000..183eab2bc9238c7c1841f1be96dd5dd08a265cff GIT binary patch literal 19 RcmZQbVE}^vPyk{x002_Y2weaG literal 0 HcmV?d00001 diff --git a/protocols.game/src/test/resources/fixtures/game/s2c/21/flags_0c_type_2e.bin b/protocols.game/src/test/resources/fixtures/game/s2c/21/flags_0c_type_2e.bin new file mode 100644 index 0000000000000000000000000000000000000000..94e0808cb6c4fcb93529728651481ddbac012e52 GIT binary patch literal 19 acmdY$^3w0f7_7*QX5zp7#ILJkOim! literal 0 HcmV?d00001 diff --git a/protocols.game/src/test/resources/fixtures/game/s2c/21/flags_0e_type_04.bin b/protocols.game/src/test/resources/fixtures/game/s2c/21/flags_0e_type_04.bin new file mode 100644 index 0000000000000000000000000000000000000000..706222891c711c807e17f85bb095d83260eb4506 GIT binary patch literal 19 acmd;M`N_t>$n}6@f7_7*QX5zp7#ILKUIm;0 literal 0 HcmV?d00001 diff --git a/protocols.game/src/test/resources/fixtures/game/s2c/21/species_arg.bin b/protocols.game/src/test/resources/fixtures/game/s2c/21/species_arg.bin new file mode 100644 index 0000000000000000000000000000000000000000..98ba3df17a9fbc96d4af37470dfab297f51bf5b9 GIT binary patch literal 25 XcmZQzVE}^vPyk{xGBGm#XJ7yTe-;S= literal 0 HcmV?d00001 diff --git a/protocols.game/src/test/resources/fixtures/game/s2c/30/wild_two_party_scrubbed.bin b/protocols.game/src/test/resources/fixtures/game/s2c/30/wild_two_party_scrubbed.bin new file mode 100644 index 0000000000000000000000000000000000000000..ca00d6a2e2563da5515d0d412fc075eb60e40bd7 GIT binary patch literal 236 zcmZQ#Kmz~4Y%w7DpFx3vErcPJp_rirEI5G?O#NqI@?n-*!_UCnz_^5g1uVwM#K6GF zZ~&s*MwxH-&V eN2LJ))MTI;AnTaHN->QA%0UbVsX}N5sRjTPv>0~) literal 0 HcmV?d00001 diff --git a/protocols.game/src/test/resources/fixtures/game/s2c/35/return_switch_in.bin b/protocols.game/src/test/resources/fixtures/game/s2c/35/return_switch_in.bin new file mode 100644 index 0000000000000000000000000000000000000000..233e89e72bc528069a5e02038516e31eecd9c195 GIT binary patch literal 25 ZcmZQzU|?imc+bej00zweK~x$L0019#1Cjs$ literal 0 HcmV?d00001 diff --git a/protocols.game/src/test/resources/fixtures/game/s2c/dc/category_flags_31914.bin b/protocols.game/src/test/resources/fixtures/game/s2c/dc/category_flags_31914.bin new file mode 100644 index 0000000000000000000000000000000000000000..c5a64a314047c1d6bc45e7d78c29d7c3eafc7a19 GIT binary patch literal 833 zcmZQ}9$QrBe?aBp=V|BPp1yPHsXuqjzN)w1zWnvQwWBXcN5Z?k&I|`QHYhnX zFfcTv;xxoU2d+TUu|pTR|A0aS4KO|X|9>iH$D!5b|GQYXoo5qo zKY8TW|NrJNWy_xP!1(N*V-tPzUg8%>D{rms_ i-@pIge_s#w2++L`{): Boolean = - runCatching { DockerClientFactory.instance().isDockerAvailable() }.getOrDefault(false) -} diff --git a/settings.gradle.kts b/settings.gradle.kts index b83a132..c4d33df 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -15,6 +15,7 @@ include(":keys") include(":patcher") include(":common") include(":bytecodec") +include(":common.test") include(":network") include(":protocols.login") include(":protocols.game")