Skip to content

Commit

Permalink
Simplify match_type handling
Browse files Browse the repository at this point in the history
The MatchType constructor will throw an error if the value is unknown;
so we don't need a separate ReplayParsingError.
  • Loading branch information
acarapetis committed Aug 3, 2024
1 parent 70b7c9d commit f8665f4
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions shroudstone/replay.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,17 +288,12 @@ def process(self, chunk: pb.ReplayChunk):
self.map_name = msg.map_name
self.match_type = MatchType(msg.match_type)

if (
self.match_type == MatchType.unknown
or self.match_type == MatchType.custom
):
slot_count = player_slot_count[msg.map_name] # Fall back to old sysyem
elif self.match_type == MatchType.ranked1v1:
if self.match_type == MatchType.ranked1v1:
slot_count = 2
elif self.match_type == MatchType.coop3ve:
slot_count = 3
else:
raise ReplayParsingError("Unknown Match Type")
slot_count = player_slot_count[msg.map_name] # Fall back to old sysyem

logger.debug(f"MatchType: {self.match_type}")

Expand Down

0 comments on commit f8665f4

Please sign in to comment.