Private
Public Access
1
0

Update to 0.1.5

This commit is contained in:
Jan Grießhaber
2026-01-02 14:51:21 +01:00
parent 3840e5c41d
commit 265f74814d
3 changed files with 6 additions and 4 deletions

View File

@@ -10,6 +10,7 @@ udpAddress = 52555
isInitialized = false isInitialized = false
sendIndex = 0 sendIndex = 0
serverIndex = 0 serverIndex = 0
LabsScanned = false
options = { options = {
enableMod = false, enableMod = false,
@@ -141,10 +142,10 @@ function SendAll(event)
if game.is_multiplayer() then if game.is_multiplayer() then
serverIndex = 0 serverIndex = 0
log("Loaded game as mulitplayer") log("Loaded game as mulitplayer")
end else
else
log("Loaded game as singleplayer") log("Loaded game as singleplayer")
serverIndex = 1 serverIndex = 1
end
end end
isInitialized = true isInitialized = true
@@ -156,7 +157,7 @@ function SendAll(event)
if LabsScanned == false then if LabsScanned == false then
GenerateLabInfo() GenerateLabInfo()
end end
if options.enableMod==true then if options.enableMod==true then

View File

@@ -1,6 +1,6 @@
{ {
"name": "factorio-metrics-exporter", "name": "factorio-metrics-exporter",
"version": "0.1.4", "version": "0.1.5",
"title": "Prometheus Metrics Exporter", "title": "Prometheus Metrics Exporter",
"author": "Jan Grießhaber", "author": "Jan Grießhaber",
"contact": "jan@griesshaber.systems", "contact": "jan@griesshaber.systems",

View File

@@ -6,6 +6,7 @@ LabsScanned = false
function GenerateLabInfo() function GenerateLabInfo()
storage.labs = {}
for _, surface in pairs(game.surfaces) do for _, surface in pairs(game.surfaces) do
local labs = surface.find_entities_filtered({type="lab"}) local labs = surface.find_entities_filtered({type="lab"})
for index, lab in pairs(labs) do for index, lab in pairs(labs) do