added map played total
This commit is contained in:
@@ -166,6 +166,7 @@ type MetaStatsResponse struct {
|
||||
WeaponDmg []*WeaponDmg `json:"weapon_dmg,omitempty"`
|
||||
WinMaps map[string]float32 `json:"win_maps,omitempty"`
|
||||
TieMaps map[string]float32 `json:"tie_maps,omitempty"`
|
||||
TotalMaps map[string]int `json:"total_maps,omitempty"`
|
||||
}
|
||||
|
||||
type MatchResponse struct {
|
||||
@@ -355,6 +356,10 @@ func GetMetaStats(dbPlayer *ent.Player) (*MetaStatsResponse, error) {
|
||||
mResponse.TieMaps[tMap] = float32(ties) / float32(mapMatchTotal[tMap])
|
||||
}
|
||||
|
||||
for tMap, total := range mapMatchTotal {
|
||||
mResponse.TotalMaps[tMap] = total
|
||||
}
|
||||
|
||||
// sort all results
|
||||
sort.Slice(mResponse.BestMates, func(i, j int) bool {
|
||||
return mResponse.BestMates[i].WinRate > mResponse.BestMates[j].WinRate
|
||||
|
Reference in New Issue
Block a user