The version catalog pointed kxs-ts-gen-core at a JitPack coordinate (com.github.adamko-dev.kotlinx-serialization-typescript-generator) that no longer serves real artifacts there, despite JitPack's build-status API still reporting it as built. The library is properly published to Maven Central under dev.adamko.kxstsgen - a commented-out line with that exact coordinate was already sitting in the catalog. Swapping to it fixes dependency resolution for every module depending on versions-platform (which previously blocked any Gradle task touching events-library, including all of its tests). That unblocked two more pre-existing, unrelated bugs that had never been caught because this module never previously compiled: - LuaJsonList<T> : List<T> by list triggered a longstanding Kotlin compiler bug (KT-3546, "accidental override" on generic toArray) specific to delegating java.util.List via `by`. Replaced with a hand-written Collection<T> implementation (no delegation codegen, no bug), which still satisfies Kotest's forOne/forAll inspectors - the only thing any code actually needs from it. - The kxs-ts-gen Kotlin->TypeScript generator (kt2ts2.kt) still emitted the pre-2.0 bare `uint`/`int` names and no import statement, since it predates typed-factorio's move to virtual modules. Updated its primitive-type mappings to uint32/int32 and added the "factorio:runtime" import to its generated header, so the regenerated schema matches what the rest of events-mod now expects. Verified via real Gradle tasks (not just manual tooling): events-library compiles and all tests pass; events-mod's full build - Kotlin schema generation, npm install, tstl compile, and info.json generation (with factorio_version "2.0" and the space-exploration/Krastorio2 optional dependencies) - succeeds end-to-end. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> |
||
|---|---|---|
| buildSrc | ||
| docs | ||
| gradle | ||
| gradle-plugins | ||
| modules | ||
| .gitignore | ||
| build.gradle.kts | ||
| gradle.properties | ||
| gradlew | ||
| gradlew.bat | ||
| kt52647.gradle.kts | ||
| LICENSE | ||
| README.md | ||
| settings.gradle.kts | ||
Kafkatorio
Kafkatorio is a platform used for creating Factorio mods that require communication with an external server.
Development is ongoing.
At present Kafkatorio is used to create a live-view web map, that shows the current status of a Factorio server, and any connected players.
However, Kafkatorio can be used for more than this. It has the potential to export metrics, and allow for inter-server communication.
Kafkatorio was created to explore the possibilities of using Apache Kafka to process updates from a Factorio server.
Running
Instructions for running a Kafkatorio instance are available in the docs.
Overview
This is a brief overview of how Kafkatorio gathers data, processes it, and uses it to create the live web-map.
Kafkatorio receives updates from a Factorio server, processes them, and exposes them over a REST and WebSocket APIs.
-
The Kafkatorio game mod,
events-mod, collects event data, de-bouncing and grouping events, and converts them to JSON packets -
events-modprints the packets to the Factorio game server logs -
The Factorio logs are forwarded to a Kafka cluster, either using
- syslog (using Docker logging plugin)
- or Kafka Pipe (a script that reads the server logs and forwards them to a Kafka topic)
-
The packets are consumed by
events-server, which processes the packets using Kafka Streams, creating and hosting map tiles.events-serverserves the map tiles via a REST API, and produces WebSocket messages regarding updates (for example, when a player's location has changed). -
The
web-mapuses Leaflet/JS to display the map, using the tiles and WebSocket messages fromevents-server
sequenceDiagram
Factorio multiplayer server->>events-mod: in-game events
Note over events-mod: converts events to packets
events-mod->>logs processor: packets logged to console
logs processor->>Kafka: publishes packets<br/>(Requires API key!)
Kafka->>events-server:
Note over events-server: Packets are processed
events-server->>web-map: Web map tiles (REST API)
events-server-)web-map: WebSocket updates<br/>(e.g. player movement)
License
Because I care about sharing improvements, Kafkatorio is licensed under the
GNU General Public License v3.0.