-
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
Changes from all commits
6765025
a91be41
7aeb472
98bef79
15bc0ad
bdca059
c760010
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe 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 commentThe 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 |
||
description: 'Dota Plus hero xp', | ||
type: 'integer', | ||
}, | ||
item_0: { | ||
description: 'Item in the player\'s first slot', | ||
type: 'integer', | ||
|
@@ -1441,7 +1445,13 @@ You can find data that can be used to convert hero and ability IDs and other inf | |
summary: 'GET /players/{account_id}/heroes', | ||
description: 'Heroes played', | ||
tags: ['players'], | ||
parameters: playerParams, | ||
parameters: [...playerParams, { | ||
name: 'hero_dotaplus_xp', | ||
in: 'query', | ||
description: 'Hero dotaplus level progress', | ||
required: false, | ||
type: 'boolean', | ||
}], | ||
responses: { | ||
200: { | ||
description: 'Success', | ||
|
@@ -1483,6 +1493,10 @@ You can find data that can be used to convert hero and ability IDs and other inf | |
description: 'against_win', | ||
type: 'integer', | ||
}, | ||
hero_dotaplus_xp: { | ||
builder-247 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
description: 'Appears if the parameter is set', | ||
type: 'integer', | ||
}, | ||
}, | ||
}, | ||
}, | ||
|
@@ -1505,7 +1519,7 @@ You can find data that can be used to convert hero and ability IDs and other inf | |
}; | ||
heroes[heroId] = hero; | ||
}); | ||
req.queryObj.project = req.queryObj.project.concat('heroes', 'account_id', 'start_time', 'player_slot', 'radiant_win'); | ||
req.queryObj.project = req.queryObj.project.concat('heroes', 'account_id', 'start_time', 'player_slot', 'radiant_win', 'hero_dotaplus_xp'); | ||
builder-247 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
queries.getPlayerMatches(req.params.account_id, req.queryObj, (err, cache) => { | ||
if (err) { | ||
return cb(err); | ||
|
@@ -1534,6 +1548,10 @@ 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; | ||
} | ||
if (req.query.hero_dotaplus_xp) { | ||
// Use the highest xp value | ||
heroes[tmHero].hero_dotaplus_xp = Math.max(m.hero_dotaplus_xp, heroes[tmHero].hero_dotaplus_xp || 0); | ||
} | ||
} | ||
}); | ||
}); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,7 @@ CREATE TABLE IF NOT EXISTS matches ( | |
teamfights text, | ||
version int, | ||
cosmetics text, | ||
dotaplus text, | ||
skill int, | ||
radiant_team_id int, | ||
dire_team_id int, | ||
|
@@ -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 commentThe 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 |
||
leaver_status text, | ||
version text, | ||
courier_kills text, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
ALTER TABLE player_matches ADD damage_targets text; | ||
ALTER TABLE player_matches ADD connection_log text; | ||
ALTER TABLE player_caches ADD hero_dotaplus_xp text; | ||
ALTER TABLE matches ADD dotaplus 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.
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