fixed bug with recording matches on older versions, added colour scheme models
This commit is contained in:
@@ -47,18 +47,30 @@ struct AppDataController: RouteCollection {
|
||||
}
|
||||
}
|
||||
|
||||
return (gameModeConfigs.and(gameModeGroupConfigs).and(games).and(maps).and(playerConfigs).and(lossReasonConfigs)).map { arg -> (Configuration) in
|
||||
let colourSchemeConfigs = ColourScheme.query(on: req.db).all().map { colourScheme in
|
||||
return colourScheme.map { cs in
|
||||
return cs.colorSchemeConfig
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return (gameModeConfigs.and(gameModeGroupConfigs).and(games).and(maps).and(playerConfigs).and(lossReasonConfigs).and(colourSchemeConfigs)).map { arg -> (Configuration) in
|
||||
|
||||
let (((((( gameModeConfigs), gameModeGroupConfigs),games),maps),playerConfigs), lossReasonConfigs) = arg
|
||||
let ((((((( gameModeConfigs), gameModeGroupConfigs),games),maps),playerConfigs), lossReasonConfigs),colourSchemeConfigs) = arg
|
||||
|
||||
var gameConfigs:[GameConfig] = []
|
||||
|
||||
|
||||
gameConfigs = games.map({ game in
|
||||
let mapConfigs = game.mapIds.compactMap { mapId in
|
||||
return maps.first { m in
|
||||
m.mapId == mapId
|
||||
}?.mapConfig
|
||||
}
|
||||
return GameConfig(gameId: game.gameId, name: game.name, maps: mapConfigs, enabled: game.enabled)
|
||||
|
||||
|
||||
|
||||
return GameConfig(gameId: game.gameId, name: game.name, maps: mapConfigs, enabled: game.enabled, colours: colourSchemeConfigs.first{game.gameId == "\($0.gameId)"})
|
||||
})
|
||||
return Configuration(games:gameConfigs, gameModes: gameModeConfigs, gameModeGroups: gameModeGroupConfigs, players: playerConfigs, lossReasons: lossReasonConfigs)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user