Skip to content

Commit

Permalink
Rename cluster_id -> replay_group_id
Browse files Browse the repository at this point in the history
  • Loading branch information
raimannma committed Feb 26, 2025
1 parent 49b8925 commit 43e98f5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
8 changes: 3 additions & 5 deletions deadlock_data_api/routers/v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,13 +521,11 @@ def get_match_salts(
[RateLimit(limit=60, period=3600)] if not account_groups else [],
)
salts = get_match_salts_from_steam(match_id, True, account_groups)
metadata_url = f"http://replay{salts.cluster_id}.valve.net/1422450/{match_id}_{salts.metadata_salt}.meta.bz2"
demo_url = (
f"http://replay{salts.cluster_id}.valve.net/1422450/{match_id}_{salts.replay_salt}.dem.bz2"
)
metadata_url = f"http://replay{salts.replay_group_id}.valve.net/1422450/{match_id}_{salts.metadata_salt}.meta.bz2"
demo_url = f"http://replay{salts.replay_group_id}.valve.net/1422450/{match_id}_{salts.replay_salt}.dem.bz2"
return DataUrlsResponse(
match_id=match_id,
cluster_id=salts.cluster_id,
cluster_id=salts.replay_group_id,
metadata_salt=salts.metadata_salt,
replay_salt=salts.replay_salt,
metadata_url=metadata_url,
Expand Down
6 changes: 3 additions & 3 deletions deadlock_data_api/routers/v1_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def get_match_salts_from_db(
result = result[0]
if not need_demo or result[1] != 0:
return CMsgClientToGCGetMatchMetaDataResponse(
metadata_salt=result[0], replay_salt=result[1], cluster_id=result[2]
metadata_salt=result[0], replay_salt=result[1], replay_group_id=result[2]
)
return None

Expand Down Expand Up @@ -133,14 +133,14 @@ def get_match_salts_from_steam(
"match_id": match_id,
"metadata_salt": msg.metadata_salt,
"replay_salt": msg.replay_salt,
"cluster_id": msg.cluster_id,
"cluster_id": msg.replay_group_id,
},
)
return msg


def fetch_metadata(match_id: int, salts: CMsgClientToGCGetMatchMetaDataResponse) -> bytes:
meta_url = f"http://replay{salts.cluster_id}.valve.net/1422450/{match_id}_{salts.metadata_salt}.meta.bz2"
meta_url = f"http://replay{salts.replay_group_id}.valve.net/1422450/{match_id}_{salts.metadata_salt}.meta.bz2"
metafile = requests.get(meta_url)
metafile.raise_for_status()
metafile = metafile.content
Expand Down

0 comments on commit 43e98f5

Please sign in to comment.