- factorio version bump
- mod: add a couple of commands for emitting chunks - mod: decrease on_tick event rate - mod: version bump typed-factorio, tstl - kafka admin: decrease replication - kafka admin: filter out existing-topics when creating - events server: add more serdes, hopefully more performant than json - events server: lots of work trying to improve performance... - events server: increase tile size to 256 - events server: fix web-map-tile-image x/y location - kafka: version bump - kafka: increase default partition size - kafka ui: version bump -
This commit is contained in:
parent
8c107b7b84
commit
f2ccbbd456
27 changed files with 476 additions and 207 deletions
|
|
@ -1,4 +1,6 @@
|
|||
import {emitPrototypes} from "../config-update/prototypes";
|
||||
import {handleChunkUpdate} from "../events/handlers";
|
||||
import floor = math.floor;
|
||||
|
||||
commands.add_command(
|
||||
"kafkatorio",
|
||||
|
|
@ -6,7 +8,59 @@ commands.add_command(
|
|||
(e: CustomCommandData) => {
|
||||
if (e.parameter == undefined) {
|
||||
// do nothing
|
||||
} else if ("PROTOTYPES" == e.parameter.toUpperCase()) {
|
||||
} else if ("PROTOTYPES" == e.parameter.toUpperCase()) {
|
||||
emitPrototypes()
|
||||
} else if ("CURRENT_CHUNK" == e.parameter.toUpperCase()) {
|
||||
|
||||
if (e.player_index != undefined) {
|
||||
|
||||
let player = game.players[e.player_index]
|
||||
|
||||
let chunkPosition: ChunkPosition = {
|
||||
x: floor(player.position.x / 32),
|
||||
y: floor(player.position.y / 32),
|
||||
}
|
||||
|
||||
let chunkLeftTop: Position = {
|
||||
x: chunkPosition.x * 32,
|
||||
y: chunkPosition.y * 32,
|
||||
}
|
||||
let chunkBottomRight: Position = {
|
||||
x: chunkLeftTop.x + 32 - 1,
|
||||
y: chunkLeftTop.y + 32 - 1,
|
||||
}
|
||||
let chunkArea: BoundingBoxRead = {
|
||||
left_top: chunkLeftTop,
|
||||
right_bottom: chunkBottomRight
|
||||
}
|
||||
|
||||
handleChunkUpdate(
|
||||
e.tick,
|
||||
"player-command",
|
||||
player.surface.index,
|
||||
chunkPosition,
|
||||
chunkArea,
|
||||
)
|
||||
}
|
||||
} else if ("CHUNKS" == e.parameter.toUpperCase()) {
|
||||
|
||||
for (let [, surface] of game.surfaces) {
|
||||
for (let chunk of surface.get_chunks()) {
|
||||
if (
|
||||
(chunk.x >= -16 || chunk.x <= 16)
|
||||
&&
|
||||
(chunk.y >= -16 || chunk.y <= 16)
|
||||
) {
|
||||
handleChunkUpdate(
|
||||
e.tick,
|
||||
"player-command",
|
||||
surface.index,
|
||||
chunk,
|
||||
chunk.area,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
)
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ script.on_event(
|
|||
script.on_event(
|
||||
defines.events.on_tick,
|
||||
(e: OnTickEvent) => {
|
||||
if (e.tick % 60 == 0) {
|
||||
if (e.tick % 1000 == 0) {
|
||||
for (const [, surface] of pairs(game.surfaces)) {
|
||||
handleSurfaceUpdate(e.tick, mapEventIdToName.get(e.name), surface)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "kafkatorio-events-mod",
|
||||
"version": "0.2.4",
|
||||
"version": "0.2.6",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
|
@ -24,9 +24,9 @@
|
|||
"integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
|
||||
},
|
||||
"graceful-fs": {
|
||||
"version": "4.2.8",
|
||||
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.8.tgz",
|
||||
"integrity": "sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg=="
|
||||
"version": "4.2.9",
|
||||
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.9.tgz",
|
||||
"integrity": "sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ=="
|
||||
},
|
||||
"has": {
|
||||
"version": "1.0.3",
|
||||
|
|
@ -37,9 +37,9 @@
|
|||
}
|
||||
},
|
||||
"is-core-module": {
|
||||
"version": "2.8.0",
|
||||
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.0.tgz",
|
||||
"integrity": "sha512-vd15qHsaqrRL7dtH6QNuy0ndJmRDrS9HAM1CAiSifNUFv4x1a0CCVsj18hJ1mShxIG6T2i1sO78MkP56r0nYRw==",
|
||||
"version": "2.8.1",
|
||||
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.1.tgz",
|
||||
"integrity": "sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA==",
|
||||
"requires": {
|
||||
"has": "^1.0.3"
|
||||
}
|
||||
|
|
@ -55,12 +55,13 @@
|
|||
"integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw=="
|
||||
},
|
||||
"resolve": {
|
||||
"version": "1.20.0",
|
||||
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz",
|
||||
"integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==",
|
||||
"version": "1.21.1",
|
||||
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.21.1.tgz",
|
||||
"integrity": "sha512-lfEImVbnolPuaSZuLQ52cAxPBHeI77sPwCOWRdy12UG/CNa8an7oBHH1R+Fp1/mUqSJi4c8TIP6FOIPSZAUrEQ==",
|
||||
"requires": {
|
||||
"is-core-module": "^2.2.0",
|
||||
"path-parse": "^1.0.6"
|
||||
"is-core-module": "^2.8.0",
|
||||
"path-parse": "^1.0.7",
|
||||
"supports-preserve-symlinks-flag": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"source-map": {
|
||||
|
|
@ -68,15 +69,20 @@
|
|||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz",
|
||||
"integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ=="
|
||||
},
|
||||
"supports-preserve-symlinks-flag": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz",
|
||||
"integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w=="
|
||||
},
|
||||
"tapable": {
|
||||
"version": "2.2.1",
|
||||
"resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz",
|
||||
"integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ=="
|
||||
},
|
||||
"typed-factorio": {
|
||||
"version": "0.16.0",
|
||||
"resolved": "https://registry.npmjs.org/typed-factorio/-/typed-factorio-0.16.0.tgz",
|
||||
"integrity": "sha512-I6W1lhRkeE+mHzLBKBVIDZdquwBjBYaS7jkV0CKiWWkA9ptGqT+MblOkNUdYZ0ykR2Rvn1eF/6pzh8WwQ+mYVQ=="
|
||||
"version": "0.17.0",
|
||||
"resolved": "https://registry.npmjs.org/typed-factorio/-/typed-factorio-0.17.0.tgz",
|
||||
"integrity": "sha512-sFLQn+G/X0IROUBnlPwuIKQlvU561dckdI59WnRaClDRK1o8zyUEJRuJ4R+IJovKUd+I75xuoSdYVIWEwZoeHA=="
|
||||
},
|
||||
"typescript": {
|
||||
"version": "4.5.4",
|
||||
|
|
@ -84,9 +90,9 @@
|
|||
"integrity": "sha512-VgYs2A2QIRuGphtzFV7aQJduJ2gyfTljngLzjpfW9FoYZF6xuw1W0vW9ghCKLfcWrCFxK81CSGRAvS1pn4fIUg=="
|
||||
},
|
||||
"typescript-to-lua": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/typescript-to-lua/-/typescript-to-lua-1.3.0.tgz",
|
||||
"integrity": "sha512-hFjZ7+Cv08WUql2VJChOEb1JH2nqYspyjw+9Og0cDLkP0QaEmM+Eh/slO2exdngDyQye/rrQysLy3zVzJe+PVg==",
|
||||
"version": "1.3.3",
|
||||
"resolved": "https://registry.npmjs.org/typescript-to-lua/-/typescript-to-lua-1.3.3.tgz",
|
||||
"integrity": "sha512-Fkt0+dLufN5CK0G/qpINY7Sb0+SNmWpov+PHhO/dq0HFoNBzR47M1SJd+hQbG92vTVFLBO4f+Np29LuVvoemMA==",
|
||||
"requires": {
|
||||
"enhanced-resolve": "^5.8.2",
|
||||
"resolve": "^1.15.1",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "kafkatorio-events-mod",
|
||||
"version": "0.2.4",
|
||||
"version": "0.2.6",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build": "tstl",
|
||||
|
|
@ -13,8 +13,8 @@
|
|||
"dependencies": {
|
||||
"lua-types": "^2.11.0",
|
||||
"@types/node": "^12.0.8",
|
||||
"typescript-to-lua": "1.3.0",
|
||||
"typed-factorio": "0.16.0",
|
||||
"typescript-to-lua": "1.3.3",
|
||||
"typed-factorio": "0.17.0",
|
||||
"typescript": "4.5.4"
|
||||
},
|
||||
"license": "UNLICENSED",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue