diff --git a/modules/events-server/src/main/kotlin/dev/adamko/kafkatorio/processor/topology/FactorioServerState.kt b/modules/events-server/src/main/kotlin/dev/adamko/kafkatorio/processor/topology/FactorioServerState.kt deleted file mode 100644 index a2f6045..0000000 --- a/modules/events-server/src/main/kotlin/dev/adamko/kafkatorio/processor/topology/FactorioServerState.kt +++ /dev/null @@ -1,74 +0,0 @@ -package dev.adamko.kafkatorio.processor.topology - -//import dev.adamko.kafkatorio.events.schema.KafkatorioPacket -//import dev.adamko.kafkatorio.events.schema.MapChunkPosition -//import dev.adamko.kafkatorio.events.schema.MapTilePosition -//import dev.adamko.kafkatorio.events.schema.MapTilePrototype -//import dev.adamko.kafkatorio.processor.serdes.jsonMapper -import kotlinx.serialization.Serializable -//import kotlinx.serialization.decodeFromString -//import org.apache.kafka.common.serialization.Serdes -//import org.apache.kafka.streams.StreamsBuilder -//import org.apache.kafka.streams.kstream.Consumed -//import org.apache.kafka.streams.kstream.KGroupedStream - -private const val sourceTopic = "factorio-server-log" - -@JvmInline -@Serializable -value class FactorioServerId(val id: String) { - override fun toString() = id -} - -//@Serializable -//data class FactorioServerState( -// val serverId: FactorioServerId, -// val mapTilePrototypes: Set, -// val surfaceIndexes: Set, -//) -// -// -//private fun gatherGameState(builder: StreamsBuilder = StreamsBuilder()) { -// -// val serverPackets: KGroupedStream = -// builder.stream( -// sourceTopic, -// Consumed.with(Serdes.String(), Serdes.String()) -// ) -// .mapValues { readOnlyKey, value -> -// println("Mapping $readOnlyKey:$value") -// jsonMapper.decodeFromString(value) -// } -// .groupByKey() -// -// @Serializable -// data class TileSurfaceData( -// val surfaceIndex: Int, -// val position: MapTilePosition, -// val prototype: MapTilePrototype, -// ) -// -// @Serializable -// data class MapChunkData( -// val position: MapChunkPosition, -// val tiles: List, -// ) -// -// @Serializable -// data class FactorioSurfaceData( -// val surfaceIndex: Int, -// val chunks: List, -// ) -// -// @Serializable -// data class FactorioServerState( -// val surfaces: Map, -// val tilePrototypes: List, -// ) -// -// -//// serverPackets -//// .aggregate( -//// Initializer { FactorioServerState("", emptyMap(), emptyList()) } -//// ) -//} diff --git a/modules/events-server/src/main/kotlin/dev/adamko/kafkatorio/processor/topology/model.kt b/modules/events-server/src/main/kotlin/dev/adamko/kafkatorio/processor/topology/model.kt index 58a3a8f..0aa1fe7 100644 --- a/modules/events-server/src/main/kotlin/dev/adamko/kafkatorio/processor/topology/model.kt +++ b/modules/events-server/src/main/kotlin/dev/adamko/kafkatorio/processor/topology/model.kt @@ -9,3 +9,9 @@ value class SurfaceIndex( ) { override fun toString() = "$index" } + +@JvmInline +@Serializable +value class FactorioServerId(val id: String) { + override fun toString() = id +}