diff --git a/CONTRIBUTORS.js b/CONTRIBUTORS.js index 9ec32c4ba..717629508 100644 --- a/CONTRIBUTORS.js +++ b/CONTRIBUTORS.js @@ -22,4 +22,5 @@ module.exports = { 81164255: {}, // jgalat 48990698: {}, // fcostantini 385676285: {}, // 102 + 89457522: {}, // 27bslash }; diff --git a/processors/createParsedDataBlob.js b/processors/createParsedDataBlob.js index 53e621c5e..dc6367718 100644 --- a/processors/createParsedDataBlob.js +++ b/processors/createParsedDataBlob.js @@ -47,6 +47,7 @@ function getParseSchema() { obs_left_log: [], sen_left_log: [], purchase_log: [], + starting_items: [], kills_log: [], buyback_log: [], runes_log: [], @@ -119,7 +120,6 @@ function createParsedDataBlob(entries, matchId, doLogParse) { parsedData.logs = processLogParse(entries, meta); } logConsole.timeEnd('doLogParse'); - return parsedData; } diff --git a/processors/populate.js b/processors/populate.js index 98a525e73..feaac3961 100644 --- a/processors/populate.js +++ b/processors/populate.js @@ -57,11 +57,18 @@ function populate(e, container) { let arrEntry; if (e.interval) { arrEntry = e.value; - } else if (e.type === 'purchase_log' || e.type === 'kills_log' || e.type === 'runes_log') { + } else if (e.type === 'starting_items' || e.type === 'purchase_log' || e.type === 'kills_log' || e.type === 'runes_log') { arrEntry = { time: e.time, key: e.key, }; + if (e.type === 'starting_items') { + arrEntry = { + key: e.key, + itemslot: e.itemslot, + charges: e.charges, + }; + } if (e.type === 'kills_log' && e.tracked_death) { arrEntry = Object.assign({}, { tracked_death: e.tracked_death, diff --git a/processors/processExpand.js b/processors/processExpand.js index 958ef182b..ab7e59047 100644 --- a/processors/processExpand.js +++ b/processors/processExpand.js @@ -254,6 +254,20 @@ function processExpand(entries, meta) { type: 'xp_reasons', }); }, + STARTING_ITEM(e) { + // starting items + const unit = e.targetname; + const key = translate(e.valuename); + expand({ + time: e.time, + value: 1, + unit, + key, + charges: e.charges, + itemslot: e.itemslot, + type: 'starting_items', + }); + }, DOTA_COMBATLOG_PURCHASE(e) { // purchase const unit = e.targetname; diff --git a/processors/processLogParse.js b/processors/processLogParse.js index 8676a648f..e97a4b926 100644 --- a/processors/processLogParse.js +++ b/processors/processLogParse.js @@ -6,7 +6,6 @@ const insignificantDeaths = [ function translate(s) { return s === 'dota_unknown' ? null : s; } - /** * A processor to reduce the event stream to only logs we want to persist * */ diff --git a/routes/spec.js b/routes/spec.js index 78aa57109..bb4e9b5ce 100644 --- a/routes/spec.js +++ b/routes/spec.js @@ -621,7 +621,7 @@ You can find data that can be used to convert hero and ability IDs and other inf type: 'integer', }, key: { - description: 'Integer item ID', + description: 'String item name', type: 'string', }, }, @@ -677,6 +677,27 @@ You can find data that can be used to convert hero and ability IDs and other inf description: 'How many sentries were placed by the player', type: 'integer', }, + starting_items: { + description: 'Object containing information on items at the start of the game', + type: 'array', + items: { + type: 'object', + properties: { + key: { + description: 'Item name', + type: 'string', + }, + itemslot: { + description: 'Inventory slot the item was in', + type: 'integer', + }, + charges: { + description: 'Amount of charges an item has', + type: 'integer', + }, + }, + }, + }, stuns: { description: 'Total stun duration of all stuns by the player', type: 'number', diff --git a/sql/create_tables.cql b/sql/create_tables.cql index c0afb51a7..813b26af6 100644 --- a/sql/create_tables.cql +++ b/sql/create_tables.cql @@ -76,6 +76,7 @@ CREATE TABLE IF NOT EXISTS player_matches ( sen_log text, obs_left_log text, sen_left_log text, + starting_items text, purchase_log text, kills_log text, buyback_log text, diff --git a/sql/create_tables.sql b/sql/create_tables.sql index ebec3f5f3..9c3dbf69e 100644 --- a/sql/create_tables.sql +++ b/sql/create_tables.sql @@ -90,6 +90,7 @@ CREATE TABLE IF NOT EXISTS player_matches ( sen_log json[], obs_left_log json[], sen_left_log json[], + starting_items json[], purchase_log json[], kills_log json[], buyback_log json[],