From cf8994b230c9c2ad860d2878be2af42f62f3514c Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Tue, 20 Feb 2024 02:13:17 +0000 Subject: [PATCH] try fixing teamfights --- processors/processTeamfights.mjs | 6 +++++- scripts/test.sh | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/processors/processTeamfights.mjs b/processors/processTeamfights.mjs index db7e0026..91717cc4 100644 --- a/processors/processTeamfights.mjs +++ b/processors/processTeamfights.mjs @@ -127,7 +127,11 @@ function processTeamfights(entries, meta) { } } else if (e.type === 'ability_uses' || e.type === 'item_uses') { // count skills, items - populate(e, tf); + // console.log(e); + // Using slot directly as index appears to be incorrect for these fields as of 2024 (see processExpand) + // So just compute an index based on player_slot + const computedSlot = e.player_slot % (128 - 5); + tf.players[computedSlot][e.type][e.key] = (tf.players[computedSlot][e.type][e.key] ?? 0) + 1; } } } diff --git a/scripts/test.sh b/scripts/test.sh index 214e1c59..964bbc8c 100644 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -3,4 +3,4 @@ #curl localhost:5600 --data-binary "@/datadrive/odota-parser/7355186741_1742953546.dem" #curl localhost:5600 --data-binary "@/datadrive/odota-parser/7437280975_580771917.dem" -curl localhost:5600/blob?replay_url=http://replay152.valve.net/570/7503212404_1277518156.dem.bz2 \ No newline at end of file +curl localhost:5600/blob?replay_url=http://replay153.valve.net/570/7580803996_2070517572.dem.bz2 \ No newline at end of file