diff --git a/control.lua b/control.lua index 7474716..9bf7fbd 100644 --- a/control.lua +++ b/control.lua @@ -221,6 +221,8 @@ script.on_event(defines.events.on_player_died, function(event) end --Log player death count storage.playerDeathCount[event.player_index] = (storage.playerDeathCount[event.player_index] or 0) + 1 + + onPlayerDeath(event) end) diff --git a/game-stats.lua b/game-stats.lua index 77490c5..7631007 100644 --- a/game-stats.lua +++ b/game-stats.lua @@ -82,6 +82,10 @@ function GetPlayerDeaths() return table.concat(deathParts, "\n") end +function onPlayerDeath(event) + helpers.send_udp(udpAddress,("---player-died---\n%s:%s:%d"):format(event.player_index,game.players[event.player_index].name,event.tick),serverIndex) +end + function GetPlayerDeathCauses() local deathParts = {} deathParts[#deathParts + 1] = "---player-death-cause---\n" diff --git a/info.json b/info.json index a01bd90..af2a536 100644 --- a/info.json +++ b/info.json @@ -1,6 +1,6 @@ { "name": "factorio-metrics-exporter", - "version": "0.3.0", + "version": "0.3.1", "title": "Prometheus Metrics Exporter", "author": "Jan Grießhaber", "contact": "jan@griesshaber.systems", diff --git a/locale/en/locale.cfg b/locale/en/locale.cfg index 48e32ce..42ac74a 100644 --- a/locale/en/locale.cfg +++ b/locale/en/locale.cfg @@ -31,4 +31,8 @@ factorio-metrics-exporter-export_train_stats=Enable sending of train statistics. factorio-metrics-exporter-enable_denkmalschutz=Enable the fun option of Denkmalschutz. In multiplayer, the player who deconstructs the starter spaceship entity will get banned factorio-metrics-exporter-autotrain_group_name=Set the name of the traingroup you want to use for the autotrain metric factorio-metrics-exporter-autotrain_depot_name=Set the name of the depot you want to use for the autotrain metric -factorio-metrics-exporter-export_train_trips=Enable sending of train trup statistics. \ No newline at end of file +factorio-metrics-exporter-export_train_trips=Enable sending of train trup statistics. +[item-name] +metrics-combinator=Metrics combinator +[item-description] +metrics-combinator=Connect this item to a circuit network, set a name and check the enable checkbox to export the values of this circuit network \ No newline at end of file