-
Notifications
You must be signed in to change notification settings - Fork 63
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
Remove references to equilibrium #744 #764
Changes from 2 commits
6863839
25c3c5d
53b0258
1ae15b0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,7 +32,15 @@ | |
from .factions import Faction | ||
from .game_service import GameService | ||
from .gameconnection import GameConnection | ||
from .games import FeaturedModType, GameState, VisibilityState | ||
from .games import ( | ||
CoopGame, | ||
CustomGame, | ||
FeaturedModType, | ||
Game, | ||
GameState, | ||
LadderGame, | ||
VisibilityState | ||
) | ||
from .geoip_service import GeoIpService | ||
from .ice_servers.coturn import CoturnHMAC | ||
from .ice_servers.nts import TwilioNTS | ||
|
@@ -895,9 +903,17 @@ async def command_game_host(self, message): | |
if rating_max is not None: | ||
rating_max = float(rating_max) | ||
|
||
game_class = { | ||
FeaturedModType.LADDER_1V1: LadderGame, | ||
FeaturedModType.COOP: CoopGame, | ||
FeaturedModType.FAF: CustomGame, | ||
FeaturedModType.FAFBETA: CustomGame | ||
}.get(game_mode, Game) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We only need to check for coop here, and default to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just use an if statement |
||
|
||
game = self.game_service.create_game( | ||
visibility=visibility, | ||
game_mode=game_mode, | ||
game_class=game_class, | ||
host=self.player, | ||
name=title, | ||
mapname=mapname, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ async def test_create_game(players, game_service): | |
game = game_service.create_game( | ||
visibility=VisibilityState.PUBLIC, | ||
game_mode="faf", | ||
game_class=CustomGame, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you could make this the default argument. |
||
host=players.hosting, | ||
name="Test", | ||
mapname="SCMP_007", | ||
|
@@ -32,6 +33,7 @@ async def test_all_games(players, game_service): | |
game = game_service.create_game( | ||
visibility=VisibilityState.PUBLIC, | ||
game_mode="faf", | ||
game_class=CustomGame, | ||
host=players.hosting, | ||
name="Test", | ||
mapname="SCMP_007", | ||
|
@@ -44,6 +46,7 @@ async def test_all_games(players, game_service): | |
async def test_create_game_ladder1v1(players, game_service): | ||
game = game_service.create_game( | ||
game_mode="ladder1v1", | ||
game_class=LadderGame, | ||
host=players.hosting, | ||
name="Test Ladder", | ||
) | ||
|
@@ -57,6 +60,7 @@ async def test_create_game_other_gamemode(players, game_service): | |
game = game_service.create_game( | ||
visibility=VisibilityState.PUBLIC, | ||
game_mode="labwars", | ||
game_class=CustomGame, | ||
host=players.hosting, | ||
name="Test", | ||
mapname="SCMP_007", | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would definitely either make
game_class
a required argument, or give it a sensible default. Defaulting toNone
just doesn't make any sense anymore.