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

Neutral items history #2850

Merged
merged 2 commits into from
Feb 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading