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

Util: Potentially fragile fix for key errors in make_timeline #1541

Merged
merged 3 commits into from
Jul 10, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
29 changes: 28 additions & 1 deletion util/make_timeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,33 @@
},
We map from the type property here to ACT network log line numbers.
Technically there are both 21 and 22 log lines,
but for the purposes of this script it doesn't matter which one we map to."""
but for the purposes of this script it doesn't matter which one we map to.

Sometimes there's an environmental actor that doesn't have the same layout.
These are assigned a GUID of 9020. They will have a "source" property:
{
"timestamp": 5308320,
"type": "cast",
"source": {
"name": "Leviathan",
"id": 31,
"guid": 9020,
"type": "NPC",
"icon": "NPC"
},
"sourceInstance": 1,
"sourceIsFriendly": false,
"targetID": 1,
"targetIsFriendly": true,
"ability": {
"name": "Rip Current",
"guid": 16353,
"type": 1024,
"abilityIcon": "000000-000405.png"
},
"pin": "0"
}
"""

log_event_types = {
"cast": "21",
Expand Down Expand Up @@ -99,6 +125,7 @@ def parse_report(args):
for event in event_data["events"]:
if "sourceID" not in event:
event["sourceID"] = event["source"]["id"]
enemies[event["sourceID"]] = event["source"]["name"]

entry = make_entry(
{
Expand Down