Skip to content

Commit

Permalink
Check for manual unrank game option
Browse files Browse the repository at this point in the history
  • Loading branch information
Askaholic committed Oct 24, 2021
1 parent 88778a3 commit 7df685e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions server/games/game.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ def __init__(
"NoRushOption": "Off",
"TeamLock": "locked",
"AIReplacement": "Off",
"RestrictedCategories": 0
"RestrictedCategories": 0,
"Unranked": "No"
}
self.mods = {}
self._hosted_event = asyncio.Event()
Expand Down Expand Up @@ -646,7 +647,8 @@ async def validate_game_settings(self):
"PrebuiltUnits": (FA.DISABLED, ValidityState.PREBUILT_ENABLED),
"NoRushOption": (FA.DISABLED, ValidityState.NORUSH_ENABLED),
"RestrictedCategories": (0, ValidityState.BAD_UNIT_RESTRICTIONS),
"TeamLock": ("locked", ValidityState.UNLOCKED_TEAMS)
"TeamLock": ("locked", ValidityState.UNLOCKED_TEAMS),
"Unranked": (FA.DISABLED, ValidityState.HOST_SET_UNRANKED)
}
if await self._validate_game_options(valid_options) is False:
return
Expand Down
1 change: 1 addition & 0 deletions server/games/typedefs.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ class ValidityState(Enum):
EXPANSION_DISABLED = 22
SPAWN_NOT_FIXED = 23
OTHER_UNRANK = 24
HOST_SET_UNRANKED = 25


class FeaturedModType():
Expand Down
3 changes: 2 additions & 1 deletion tests/unit_tests/test_game.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ async def test_validate_game_settings(game: Game, game_add_players):
("PrebuiltUnits", "On", ValidityState.PREBUILT_ENABLED),
("NoRushOption", 20, ValidityState.NORUSH_ENABLED),
("RestrictedCategories", 1, ValidityState.BAD_UNIT_RESTRICTIONS),
("TeamLock", "unlocked", ValidityState.UNLOCKED_TEAMS)
("TeamLock", "unlocked", ValidityState.UNLOCKED_TEAMS),
("Unranked", "Yes", ValidityState.HOST_SET_UNRANKED)
]
mods = (
FeaturedModType.FAF,
Expand Down

0 comments on commit 7df685e

Please sign in to comment.