Skip to content

Commit

Permalink
Merge pull request #2850 from beermonsterdota/neutral_items_history
Browse files Browse the repository at this point in the history
Neutral items history
  • Loading branch information
howardchung authored Feb 22, 2025
2 parents 2bd097c + 6a7db28 commit 1ea3ba5
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
7 changes: 7 additions & 0 deletions global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ interface ParsedPlayer extends Player {
sen: any;
lane_role: number | null;
neutral_tokens_log: any[];
neutral_item_history: NeutralItemHistory[];

party_size?: number;

Expand Down Expand Up @@ -198,6 +199,12 @@ interface ParsedPlayer extends Player {
rank_tier?: number;
}

interface NeutralItemHistory {
time: number;
item_neutral: string;
item_neutral_enhancement: string;
}

// Data to pass to insertMatch from GC
interface GcMatch {
match_id: number;
Expand Down
21 changes: 21 additions & 0 deletions routes/responses/MatchResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -933,6 +933,27 @@ export default {
},
},
},
neutral_item_history: {
description: 'Object containing information on neutral item history',
type: 'array',
items: {
type: 'object',
properties: {
time: {
description: 'Time in seconds at which the item was crafted',
type: 'integer'
},
item_neutral: {
description: 'Neutral item name',
type: 'string'
},
item_neutral_enhancement: {
description: 'Neutral enhancement name',
type: 'string'
}
}
}
}
},
},
},
Expand Down
3 changes: 2 additions & 1 deletion sql/create_tables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ CREATE TABLE IF NOT EXISTS player_matches (
observers_placed int,
party_size int,
net_worth int,
neutral_tokens_log json[]
neutral_tokens_log json[],
neutral_item_history json[]
);
CREATE INDEX IF NOT EXISTS player_matches_account_id_idx on player_matches(account_id) WHERE account_id IS NOT NULL;
CREATE INDEX IF NOT EXISTS player_matches_hero_id_idx on player_matches(hero_id);
Expand Down

0 comments on commit 1ea3ba5

Please sign in to comment.