Skip to content

Commit

Permalink
Use displayed rating for map pool selection (#850)
Browse files Browse the repository at this point in the history
  • Loading branch information
Askaholic authored Oct 21, 2021
1 parent 7be92f1 commit 19bf582
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
10 changes: 1 addition & 9 deletions server/ladder_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ async def start_game(
limit=config.LADDER_ANTI_REPETITION_LIMIT
)
rating = min(
newbie_adjusted_mean(player, queue.rating_type)
player.get_displayed_rating(queue.rating_type)
for player in all_players
)
pool = queue.get_map_pool_for_rating(rating)
Expand Down Expand Up @@ -583,11 +583,3 @@ def _team_name(team: List[Player]) -> str:
name = player_1_name

return f"Team {name}"


def newbie_adjusted_mean(player: Player, rating_type: str) -> float:
"""Get rating mean with new player's always returning a mean of 0"""
if player.game_count[rating_type] > config.NEWBIE_MIN_GAMES:
return player.ratings[rating_type][0]
else:
return 0
2 changes: 1 addition & 1 deletion server/matchmaker/matchmaker_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def add_map_pool(
) -> None:
self.map_pools[map_pool.id] = (map_pool, min_rating, max_rating)

def get_map_pool_for_rating(self, rating: int) -> Optional[MapPool]:
def get_map_pool_for_rating(self, rating: float) -> Optional[MapPool]:
for map_pool, min_rating, max_rating in self.map_pools.values():
if min_rating is not None and rating < min_rating:
continue
Expand Down
1 change: 1 addition & 0 deletions tests/integration_tests/test_matchmaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ async def test_game_launch_message(lobby_server):
assert msg2["expected_players"] == msg1["expected_players"]
assert msg2["map_position"] == 2

assert "scmp_015" in msg1["mapname"]
del msg1["mapname"]
assert msg1 == {
"command": "game_launch",
Expand Down

0 comments on commit 19bf582

Please sign in to comment.