Skip to content

Commit

Permalink
Fix map translation.
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasmaurice committed Oct 13, 2024
1 parent b4c37c0 commit 48a479a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions satisfactory-exporter/exporter/factory_building_collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ func (c *FactoryBuildingCollector) Collect(ch chan<- prometheus.Metric) {
maxPowerInfo := map[float64]float64{}
for _, building := range details {
for _, prod := range building.Production {
x := building.Location.X*0.0002400052604 - 79.56302209
y := -building.Location.Y*0.0001673061871 + 43.71230201
x := building.Location.X*0.000239930467 - 79.70308527
y := -building.Location.Y*0.0001413589137 + 36.97720935
z := building.Location.Z
gh := geohash.EncodeAuto(y, x)

Expand Down
4 changes: 2 additions & 2 deletions satisfactory-exporter/exporter/player_collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ func (c *PlayerCollector) Collect(ch chan<- prometheus.Metric) {
}

for _, d := range details {
ch <- prometheus.MustNewConstMetric(PlayerPosition, prometheus.GaugeValue, d.Location.X*0.0002400052604-79.56302209, d.PlayerName, fmt.Sprintf("%f", d.ID), "X")
ch <- prometheus.MustNewConstMetric(PlayerPosition, prometheus.GaugeValue, -d.Location.Y*0.0001673061871+43.71230201, d.PlayerName, fmt.Sprintf("%f", d.ID), "Y")
ch <- prometheus.MustNewConstMetric(PlayerPosition, prometheus.GaugeValue, d.Location.X*0.000239930467-79.70308527, d.PlayerName, fmt.Sprintf("%f", d.ID), "X")
ch <- prometheus.MustNewConstMetric(PlayerPosition, prometheus.GaugeValue, -d.Location.Y*0.0001413589137+36.97720935, d.PlayerName, fmt.Sprintf("%f", d.ID), "Y")
ch <- prometheus.MustNewConstMetric(PlayerPosition, prometheus.GaugeValue, d.Location.Z, d.PlayerName, fmt.Sprintf("%f", d.ID), "Z")
ch <- prometheus.MustNewConstMetric(PlayerRotation, prometheus.GaugeValue, float64(d.Location.Rotation), d.PlayerName, fmt.Sprintf("%f", d.ID))
ch <- prometheus.MustNewConstMetric(PlayerHealth, prometheus.GaugeValue, d.PlayerHP, d.PlayerName, fmt.Sprintf("%f", d.ID))
Expand Down

0 comments on commit 48a479a

Please sign in to comment.