Skip to content
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

Closed
wants to merge 7 commits into from
Closed

Add dotaplus xp #2145

wants to merge 7 commits into from

Conversation

builder-247
Copy link
Member

@builder-247 builder-247 commented Apr 26, 2020

Closes #1864

Changes

This PR adds hero_dotaplus_xp field to both /player/matches/{match} and /player/heroes endpoints

@builder-247
Copy link
Member Author

builder-247 commented Apr 26, 2020

The dotaplus object from the parsed replay doesn't seem to appear in buildMatch function, can anyone spot what I'm missing?

@@ -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: {
Copy link
Member

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.

Copy link
Member Author

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

sql/migrations.cql Outdated Show resolved Hide resolved
store/buildMatch.js Outdated Show resolved Hide resolved
@builder-247
Copy link
Member Author

I'm going to add the data to more endpoints that requires more research on the codebase.

@builder-247 builder-247 marked this pull request as ready for review November 20, 2020 17:55
@builder-247 builder-247 changed the title [WIP] Add dotaplus xp Add dotaplus xp Nov 20, 2020
@@ -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,
Copy link
Member

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);
Copy link
Member

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?

Copy link
Member

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

store/buildMatch.js Outdated Show resolved Hide resolved
@@ -21,6 +21,7 @@ function getParseSchema() {
radiant_gold_adv: [],
radiant_xp_adv: [],
cosmetics: {},
dotaplus: {},
Copy link
Member

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

@builder-247 builder-247 closed this Mar 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Dota Plus hero level tracking
2 participants