Skip to content

Commit

Permalink
fixes broken places logic
Browse files Browse the repository at this point in the history
Opening PR for #770
  • Loading branch information
Mx772 authored May 6, 2024
1 parent 6d3301f commit 81b0ba8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/exporter/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,8 @@ func (e *Exporter) getPlayerList(ch chan<- prometheus.Metric) (retErr error) {
players := e.playerOnlineRegexp.FindStringSubmatch(*resp)
if len(players) > 1 {
playersList := players[1]
for _, player := range strings.Fields(strings.ReplaceAll(playersList, ",", " ")) {
list := strings.Split(playersList, ",")
for _, player := range list {
player = removeColorCodesFromWord(player)
ch <- prometheus.MustNewConstMetric(e.playerOnline, prometheus.CounterValue, 1, strings.TrimSpace(player))
}
Expand Down

0 comments on commit 81b0ba8

Please sign in to comment.