diff --git a/server/lobbyconnection.py b/server/lobbyconnection.py index 8127b7e91..6fe8fdc9f 100644 --- a/server/lobbyconnection.py +++ b/server/lobbyconnection.py @@ -929,13 +929,6 @@ async def command_game_matchmaking(self, message): recoverable=True ) - # TODO: Remove this legacy behavior, use party instead - if "faction" in message: - party.set_factions( - self.player, - [Faction.from_value(message["faction"])] - ) - self.ladder_service.start_search( players, queue_name=queue_name, diff --git a/tests/integration_tests/test_game.py b/tests/integration_tests/test_game.py index d06e17451..b755b9e58 100644 --- a/tests/integration_tests/test_game.py +++ b/tests/integration_tests/test_game.py @@ -76,10 +76,13 @@ async def open_fa(proto): async def queue_player_for_matchmaking(user, lobby_server, queue_name): _, _, proto = await connect_and_sign_in(user, lobby_server) await read_until_command(proto, "game_info") + await proto.send_message({ + "command": "set_party_factions", + "factions": ["uef"] + }) await proto.send_message({ "command": "game_matchmaking", "state": "start", - "faction": "uef", "queue_name": queue_name }) await read_until_command( @@ -93,27 +96,21 @@ async def queue_player_for_matchmaking(user, lobby_server, queue_name): return proto -async def queue_players_for_matchmaking(lobby_server, queue_name: str = "ladder1v1"): +async def queue_players_for_matchmaking( + lobby_server, + queue_name: str = "ladder1v1" +): proto1 = await queue_player_for_matchmaking( ("ladder1", "ladder1"), lobby_server, queue_name ) - _, _, proto2 = await connect_and_sign_in( + proto2 = await queue_player_for_matchmaking( ("ladder2", "ladder2"), - lobby_server + lobby_server, + queue_name ) - await read_until_command(proto2, "game_info") - - await proto2.send_message({ - "command": "game_matchmaking", - "state": "start", - "faction": 1, # Python client sends factions as numbers - "queue_name": queue_name - }) - await read_until_command(proto2, "search_info", state="start") - # If the players did not match, this will fail due to a timeout error await read_until_command(proto1, "match_found", timeout=30) await read_until_command(proto2, "match_found") diff --git a/tests/integration_tests/test_teammatchmaker.py b/tests/integration_tests/test_teammatchmaker.py index 05ecfe501..ecbba8ce1 100644 --- a/tests/integration_tests/test_teammatchmaker.py +++ b/tests/integration_tests/test_teammatchmaker.py @@ -38,11 +38,17 @@ async def queue_players_for_matchmaking(lobby_server): read_until_command(proto, "game_info") for proto in protos ]) + await asyncio.gather(*[ + proto.send_message({ + "command": "set_party_factions", + "factions": ["uef"] + }) + for proto in protos + ]) await asyncio.gather(*[ proto.send_message({ "command": "game_matchmaking", "state": "start", - "faction": "uef", "queue_name": "tmm2v2" }) for proto in protos @@ -114,18 +120,27 @@ async def test_game_matchmaking_multiqueue(lobby_server): read_until_command(proto, "game_info") for proto in protos ]) + await protos[0].send_message({ + "command": "set_party_factions", + "factions": ["uef"] + }) await protos[0].send_message({ "command": "game_matchmaking", "state": "start", - "faction": "uef", "queue_name": "ladder1v1" }) await read_until_command(protos[0], "search_info", state="start") + await asyncio.gather(*[ + proto.send_message({ + "command": "set_party_factions", + "factions": ["aeon"] + }) + for proto in protos + ]) await asyncio.gather(*[ proto.send_message({ "command": "game_matchmaking", "state": "start", - "faction": "aeon", "queue_name": "tmm2v2" }) for proto in protos