-
Notifications
You must be signed in to change notification settings - Fork 301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add dotaplus xp #2145
Add dotaplus xp #2145
Conversation
The |
@@ -472,6 +472,10 @@ You can find data that can be used to convert hero and ability IDs and other inf | |||
description: 'The ID value of the hero played', | |||
type: 'integer', | |||
}, | |||
hero_dotaplus_xp: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this make more sense stored as a separate table from each player_hero combination? Seems like this would be a properly that's independent of each match, unless we care about their dota plus level at the time of the match.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is how the game client displays it, also not sure if gets set to 0 on the replays if the player doesn't have a valid subscription anymore
I'm going to add the data to more endpoints that requires more research on the codebase. |
@@ -150,6 +151,7 @@ CREATE TABLE IF NOT EXISTS player_caches ( | |||
gold_per_min text, | |||
xp_per_min text, | |||
hero_id text, | |||
hero_dotaplus_xp text, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we only need it in the table if we are going to aggregate this across matches for a player
routes/spec.js
Outdated
@@ -1534,6 +1543,8 @@ You can find data that can be used to convert hero and ability IDs and other inf | |||
heroes[tmHero].against_games += 1; | |||
heroes[tmHero].against_win += playerWin ? 1 : 0; | |||
} | |||
// Use the highest xp value | |||
heroes[tmHero].hero_dotaplus_xp = Math.max(m.hero_dotaplus_xp, heroes[tmHero].hero_dotaplus_xp); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't think this is necessary, isn't heroes just the object that tracks the heroes played with?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh i see, looks like you're adding it here to display the hero level for all of a player's heroes
@@ -21,6 +21,7 @@ function getParseSchema() { | |||
radiant_gold_adv: [], | |||
radiant_xp_adv: [], | |||
cosmetics: {}, | |||
dotaplus: {}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should store this as a field per player instead of per match? since we need to store it per player in the player_caches table anyway
Closes #1864
Changes
This PR adds
hero_dotaplus_xp
field to both/player/matches/{match}
and/player/heroes
endpoints