Skip to content

Commit 3d3b292

Browse files
committed
store account id in gcdata
1 parent 7ca4f74 commit 3d3b292

File tree

5 files changed

+16
-8
lines changed

5 files changed

+16
-8
lines changed

json/1781962623_gcdata.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,60 +2,70 @@
22
"match_id": 1781962623,
33
"players": [
44
{
5+
"account_id": 120269134,
56
"player_slot": 0,
67
"party_id": 0,
78
"permanent_buffs": [],
89
"party_size": 10
910
},
1011
{
12+
"account_id": 109378329,
1113
"player_slot": 1,
1214
"party_id": 0,
1315
"permanent_buffs": [],
1416
"party_size": 10
1517
},
1618
{
19+
"account_id": 122866507,
1720
"player_slot": 2,
1821
"party_id": 0,
1922
"permanent_buffs": [],
2023
"party_size": 10
2124
},
2225
{
26+
"account_id": 195471601,
2327
"player_slot": 3,
2428
"party_id": 0,
2529
"permanent_buffs": [],
2630
"party_size": 10
2731
},
2832
{
33+
"account_id": 17120336,
2934
"player_slot": 4,
3035
"party_id": 0,
3136
"permanent_buffs": [],
3237
"party_size": 10
3338
},
3439
{
40+
"account_id": 44152866,
3541
"player_slot": 128,
3642
"party_id": 0,
3743
"permanent_buffs": [],
3844
"party_size": 10
3945
},
4046
{
47+
"account_id": 80319669,
4148
"player_slot": 129,
4249
"party_id": 0,
4350
"permanent_buffs": [],
4451
"party_size": 10
4552
},
4653
{
54+
"account_id": 235274000,
4755
"player_slot": 130,
4856
"party_id": 0,
4957
"permanent_buffs": [],
5058
"party_size": 10
5159
},
5260
{
61+
"account_id": 106823512,
5362
"player_slot": 131,
5463
"party_id": 0,
5564
"permanent_buffs": [],
5665
"party_size": 10
5766
},
5867
{
68+
"account_id": 86751979,
5969
"player_slot": 132,
6070
"party_id": 0,
6171
"permanent_buffs": [],

json/1781962623_playercache_api_0.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"cluster": 132,
2828
"lobby_type": 7,
2929
"game_mode": 22,
30+
"average_rank": 81,
3031
"heroes": {
3132
"0": {
3233
"account_id": 120269134,
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2+
"account_id": 120269134,
23
"player_slot": 0,
34
"party_size": 10,
45
"match_id": 1781962623,
5-
"cluster": 132,
6-
"account_id": 120269134
6+
"cluster": 132
77
}

store/getGcData.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,9 @@ async function saveGcData(
9595
);
9696
const players = data.match.players.map(
9797
(p: any, i: number): GcPlayer => ({
98-
// NOTE: account ids are not anonymous in this call so we don't include it in the data to insert
99-
// TODO We could start storing this data but then the API also needs to respect the user's match history setting
100-
// If we just enable this alone we'll write partial rows with only gcdata to the player_caches table
101-
// Fix: in upsertPlayerCaches force only reading account_id from pgroup, not the match object itself
98+
// NOTE: account ids are not anonymous in this call
10299
// Also, we probably want to queue a job post-parse that reads back the match data and updates all player_caches now that we have identity and parsed data
103-
// account_id: p.account_id,
100+
account_id: p.account_id,
104101
player_slot: p.player_slot,
105102
party_id: Number(p.party_id),
106103
permanent_buffs: p.permanent_buffs ?? [],

store/insert.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ export async function insertMatch(
343343
await Promise.all(
344344
copy.players.map(async (p) => {
345345
// add account id to each player so we know what caches to update
346-
const account_id = pgroup[p.player_slot]?.account_id ?? p.account_id;
346+
const account_id = pgroup[p.player_slot]?.account_id;
347347
// join player with match to form player_match
348348
const playerMatch: Partial<ParsedPlayerMatch> = {
349349
...p,

0 commit comments

Comments
 (0)