diff --git a/Sources/App/Controllers/StatsController.swift b/Sources/App/Controllers/StatsController.swift index dd4080a..0c36e94 100644 --- a/Sources/App/Controllers/StatsController.swift +++ b/Sources/App/Controllers/StatsController.swift @@ -511,7 +511,6 @@ struct StatsController: RouteCollection { //print ("cw done \(Date().timeIntervalSince(startTime))") group.leave() - } group.enter() @@ -554,8 +553,7 @@ struct StatsController: RouteCollection { mwFivePlayers = self.getStatsByPlayerCount(matches: matches, playerCount: 5) group.leave() } - - + group.enter() queue.async { @@ -612,27 +610,18 @@ struct StatsController: RouteCollection { } let ratio = wins / loss - return records - } - - } - func mapsSortedByBest (records :[ Int:Stats] ) -> [ Int ] - { + func mapsSortedByBest (records :[ Int:Stats] ) -> [ Int ] { return records.keys.sorted { (map1, map2) -> Bool in return records[map1]?.getRatioDouble() ?? 0.0 < records[map2]?.getRatioDouble() ?? 0.0 }.reversed() } func getStatsByPlayerCount(matches:[Match], playerCount:Int) -> Stats { - return getStats(matches: matches.filter{$0.playerList.count == playerCount}) - - - } func getBestMap (records :[ Int:Stats] ) -> Int { diff --git a/Sources/App/Data/MapData.swift b/Sources/App/Data/MapData.swift index fed19e9..87cadac 100644 --- a/Sources/App/Data/MapData.swift +++ b/Sources/App/Data/MapData.swift @@ -44,12 +44,14 @@ class MapData { 29: Map(id: 29, name: "Nuketown Holiday", imageName: "bocw_nuketown_holiday"), 30: Map(id: 30, name: "Raid", imageName: "bocw_raid"), 32: Map(id: 32, name: "Piccadilly", imageName: "mw_piccadilly"), - 33: Map(id: 33, name: "Grazna Raid", imageName: "mw_grazna") + 33: Map(id: 33, name: "Grazna Raid", imageName: "mw_grazna"), + 34: Map(id: 34, name: "Express", imageName: "bocw_express") + ] static let bocwMaps = { - return [1,3,8,7,4,2,29,31,5,6,30,0].compactMap { + return [1,3,8,7,4,2,29,31,5,6,30,0,34].compactMap { return allMaps[$0]; } .sorted { (m1, m2) -> Bool in