Skip to content
Merged
Changes from 2 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
9 changes: 9 additions & 0 deletions sc2reader/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,15 @@ def __init__(self, uid, init_data):
#: This is deprecated because it doesn't actually work.
self.recorder = None

#: The user's mmr at the time of the game
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is mmr and why does the reader need to guess?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MMR stands for Matchmaking Rating, indicating the skill level on SC2 ladder. I assume this is a common abbreviation like APM under sc2 context, but now I dont know whether we should explain it in comment or not.

#: Currently, there are three cases observed for a user that does not have a current mmr:
#: 1. The user has no 'scaled_rating' key in their init_data,
#: 2. The user has a None value for their 'scaled_rating' key, or
#: 3. The user has a negative rating, often -36400.
#: For ease of use, this property will return None in both cases.
mmr = int(init_data.get("scaled_rating") or 0)
self.mmr = mmr if mmr > 0 else None

@property
def url(self):
"""
Expand Down