-
-
Notifications
You must be signed in to change notification settings - Fork 70
Issue/#675 Matchmaking requests from RabbitMQ #788
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
base: develop
Are you sure you want to change the base?
Issue/#675 Matchmaking requests from RabbitMQ #788
Conversation
Codecov ReportAttention:
Additional details and impacted files
|
eoinnoble
left a comment
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.
Much of this is beyond my understanding, but what I do understand seems correct. I think we need to get more of the branches covered, and I have some very minor stylistic suggestions.
server/ladder_service.py
Outdated
| map_name = request["map_name"] | ||
| game_name = request["game_name"] | ||
| participants = request["participants"] |
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.
Maybe keep the queue_name logic in one block and pull these out of the request closer to where they're being used.
server/ladder_service.py
Outdated
| player_ids = [participant["player_id"] for participant in participants] | ||
| missing_players = [ | ||
| id for id in player_ids if self.player_service[id] is None | ||
| ] | ||
| if missing_players: | ||
| raise Exception( | ||
| "players_not_found", | ||
| *[{"player_id": id} for id in missing_players] | ||
| ) | ||
|
|
||
| all_players = [ | ||
| self.player_service[player_id] for player_id in player_ids | ||
| ] | ||
| non_idle_players = [ | ||
| player for player in all_players | ||
| if player.state != PlayerState.IDLE | ||
| ] |
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.
Certainly not a big deal but feels like we can probably reduce some of this looping?
| player_ids = [participant["player_id"] for participant in participants] | |
| missing_players = [ | |
| id for id in player_ids if self.player_service[id] is None | |
| ] | |
| if missing_players: | |
| raise Exception( | |
| "players_not_found", | |
| *[{"player_id": id} for id in missing_players] | |
| ) | |
| all_players = [ | |
| self.player_service[player_id] for player_id in player_ids | |
| ] | |
| non_idle_players = [ | |
| player for player in all_players | |
| if player.state != PlayerState.IDLE | |
| ] | |
| all_players = [] | |
| missing_players = [] | |
| non_idle_players = [] | |
| for participant in participants: | |
| player_id = participant["player_id"] | |
| player = self.player_service[player_id] | |
| if self.player_service[player_id]: | |
| all_players.append(player) | |
| if player.state != PlayerState.IDLE: | |
| non_idle_players.append(player) | |
| else: | |
| missing_players.append(player_id) | |
| if missing_players: | |
| raise Exception( | |
| "players_not_found", | |
| *[{"player_id": id} for id in missing_players] | |
| ) |
server/ladder_service.py
Outdated
| [ | ||
| {"player_id": player.id, "state": player.state.name} | ||
| for player in all_players | ||
| ] |
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.
Did you want to unpack this list like you did when there were missing_players?
server/ladder_service.py
Outdated
| queue = self.queues[queue_name] if queue_name else None | ||
| featured_mod = featured_mod or queue.featured_mod |
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.
It would be easier on my poor brain if these two lines were closer in the code to where we're grabbing initial values.
server/ladder_service.py
Outdated
| host = all_players[0] | ||
| guests = all_players[1:] |
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.
Do we need to check anywhere that len(all_players) >= 2?
6677516 to
4b597cc
Compare
4b597cc to
8c3e205
Compare
b2502a0 to
e61dc25
Compare
|
Recap of additionally required gw features as discussed in chat:
|
9fbac70 to
04b0524
Compare
|
This branch now supports:
The autolobby system already supports setting arbitrary game options, but only for scalar values. Unit restrictions are represented as a nested value under the The player name is not part of the game options, so it would not be able to be set in this way. Supporting that would require starting on the lua side to figure out how that value should be passed in. I would also think this is not a blocker for an initial GW implementation. Since these rabbitmq requests come from an external service which must be treated as a black box by the lobby server, there is no way for the lobby server to know if a player is in queue for GW or not, so we can't build any 'exclusive queue' logic around it. |
75a18d1 to
0a667d2
Compare
04b0524 to
6a8b8de
Compare
6a8b8de to
9f266fc
Compare
I changed a few things from the issue. Mostly I'm using name keys instead of ids for everything except players because that's what the ladder service expects in client messages already.
Probably need to refactor the
rating_typeon Game objects to allow unrated games by settingrating_typeto None.Closes #675