display mates with more than 2 games
don't count unparsed map wins
This commit is contained in:
@@ -297,11 +297,13 @@ func GetMetaStats(dbPlayer *ent.Player, lock *sync.RWMutex, limit int) (*MetaSta
|
|||||||
tie := pm.MatchResult == 0
|
tie := pm.MatchResult == 0
|
||||||
|
|
||||||
if _, ok := matchSeen[pm.ID]; !ok {
|
if _, ok := matchSeen[pm.ID]; !ok {
|
||||||
mapMatchTotal[pm.Map]++
|
if pm.Map != "" {
|
||||||
if win {
|
mapMatchTotal[pm.Map]++
|
||||||
mapWins[pm.Map]++
|
if win {
|
||||||
} else if tie {
|
mapWins[pm.Map]++
|
||||||
mapTies[pm.Map]++
|
} else if tie {
|
||||||
|
mapTies[pm.Map]++
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
lock.RLock()
|
lock.RLock()
|
||||||
@@ -350,7 +352,7 @@ func GetMetaStats(dbPlayer *ent.Player, lock *sync.RWMutex, limit int) (*MetaSta
|
|||||||
mResponse.MostMates = append(mResponse.MostMates, mostRes)
|
mResponse.MostMates = append(mResponse.MostMates, mostRes)
|
||||||
}
|
}
|
||||||
|
|
||||||
if mostRes.Total > 0 && (wins > 0 || ties > 0) {
|
if mostRes.Total > 1 && (wins > 0 || ties > 0) {
|
||||||
mateRes.Player = playerRes
|
mateRes.Player = playerRes
|
||||||
mateRes.TieRate = float32(ties) / float32(mostRes.Total)
|
mateRes.TieRate = float32(ties) / float32(mostRes.Total)
|
||||||
mateRes.WinRate = float32(wins) / float32(mostRes.Total)
|
mateRes.WinRate = float32(wins) / float32(mostRes.Total)
|
||||||
|
Reference in New Issue
Block a user