diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2018-06-16 20:47:59 +0200 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2018-12-13 17:09:20 +0100 |
| commit | a8135ad40cbeb6c0c464d57010032dc033993439 (patch) | |
| tree | e9bf2c11e277b7b60bb58ab37818c0eb1c998574 /backend/config.js | |
| parent | 37fda8b8f9d7a6cf812478cdcfb46a32b8e9d259 (diff) | |
| download | brokentalents-a8135ad40cbeb6c0c464d57010032dc033993439.tar.gz brokentalents-a8135ad40cbeb6c0c464d57010032dc033993439.zip | |
Calculate and show level scaling
Diffstat (limited to 'backend/config.js')
| -rw-r--r-- | backend/config.js | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/backend/config.js b/backend/config.js index 172cf80..72952a2 100644 --- a/backend/config.js +++ b/backend/config.js @@ -1,4 +1,5 @@ #!/usr/bin/node +const maps = require('../src/maps/maps'); const crypto = require('crypto'); @@ -10,7 +11,9 @@ const hashSettings = (config) => sha256( config.api.modes + config.api.requestsPerInterval + config.api.interval + - config.api.intervalUnit + config.api.intervalUnit + + config.etl + + config.reduce ).substring(0, 8); module.exports = { @@ -53,14 +56,25 @@ module.exports = { match: [ ['Mode', ['attributes', 'gameMode']] ], }, reduce: { + /* attributes to be calculated from other attributes */ + derived: [ + (entry) => { + if(entry.LevelBucket == undefined) + entry.LevelBucket = Math.max(-1, Math.floor(maps.getScaledLevel(entry) * module.exports.self.levelBuckets)); + return entry; + }, + ], /* criteria or 'filters' */ - group: ['Actor', 'Talent', 'Mode'], + group: ['Actor', 'Talent', 'Mode', 'LevelBucket'], /* stats */ - sum: ['Level', 'Winner'], + sum: ['Winner'], }, file: { pattern: (moment) => `./data/${hashSettings(module.exports)}/${moment.toISOString()}.json`, reportPattern: () => `./data/${hashSettings(module.exports)}/report.json`, metadataPattern: () => `./data/${hashSettings(module.exports)}/metadata.json`, }, + self: { + levelBuckets: 5, + }, }; |
