Skip to content

Commit

Permalink
fixes broken places logic
Browse files Browse the repository at this point in the history
Opening PR for #770

Signed-off-by: Mx772 <drewcarter0@gmail.com>
  • Loading branch information
Mx772 committed May 6, 2024
1 parent 6d3301f commit 4fb30bf
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 4fb30bf

Please sign in to comment.