- tidy up groupMapChunks.kt

- add ticks to all Kafkatorio Packets
- add Kafka Streams test for groupMapChunks.kt
This commit is contained in:
Adam 2022-03-12 16:42:24 +01:00
parent bfdee32d61
commit b8ba8b7c9e
22 changed files with 271 additions and 98 deletions

View file

@ -16,4 +16,5 @@ interface FactorioConfigurationUpdate extends KafkatorioPacket {
factorioData: FactorioGameDataUpdate;
modVersion: string;
packetType: PacketType;
tick: uint;
}

View file

@ -10,6 +10,7 @@ interface FactorioPrototypes extends KafkatorioPacket {
modVersion: string;
packetType: PacketType;
prototypes: FactorioPrototype[];
tick: uint;
}
interface MapTilePrototype extends FactorioPrototype {

View file

@ -5,6 +5,7 @@ type PacketType = "EVENT" | "CONFIG" | "PROTOTYPES" | "UPDATE";
interface KafkatorioPacket {
modVersion: string;
packetType: PacketType;
tick: uint;
}
interface FactorioEvent extends KafkatorioPacket {

View file

@ -6,7 +6,8 @@ export function emitConfigurationUpdate(changeData: ConfigurationChangedData) {
modVersion: global.MOD_VERSION,
packetType: "CONFIG",
allMods: allMods(changeData),
factorioData: factorioData(changeData)
factorioData: factorioData(changeData),
tick: game.tick,
})
}

View file

@ -6,7 +6,8 @@ export function emitPrototypes() {
emitPacket<FactorioPrototypes>({
modVersion: global.MOD_VERSION,
packetType: "PROTOTYPES",
prototypes: prototypes()
prototypes: prototypes(),
tick: game.tick,
})
}

View file

@ -7,6 +7,6 @@ export function emitEvent<T extends FactorioObjectData>(eventData: T, tick: uint
packetType: "EVENT",
eventType: eventType,
modVersion: global.MOD_VERSION,
tick: tick
tick: tick,
})
}