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

Issue/#838 Check for manual unrank game option #851

Merged
merged 2 commits into from
Nov 6, 2021
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
- cron: '0 0 * * *'

env:
FAF_DB_VERSION: v121
FAF_DB_VERSION: v122
FLYWAY_VERSION: 7.5.4

jobs:
Expand Down
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