Skip to content

Conversation

@1-alex98
Copy link
Member

@1-alex98 1-alex98 commented Sep 24, 2022

Closes #675

await game_connection.handle_action("GameOption", ["ScenarioFile", "C:\\Maps\\Some_Map"])
assert game.map_file_path == "maps/some_map.zip"
assert game.map_name == "some_map"
assert game.map_scenario_path == "C:/Maps/Some_Map"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since game is a mock the setter is not invoked and map_file_path is not set by the setter

@1-alex98 1-alex98 marked this pull request as ready for review September 30, 2022 19:01
Copy link
Collaborator

@Askaholic Askaholic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sort of half reviewed it. Biggest thing is please undo the indentation changes. It looks like you might have an autoformatter or something that is changing those.

Comment on lines +985 to +989
def wait_launched(self, param):
pass

def wait_hosted(self, param):
pass
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need these in the base class? They only make sense for automatch games.

game.gameOptions.update(game_options)

mapname = re.match("maps/(.+).zip", map_path).group(1)
map_name = re.match("maps/(.+).zip", map_path).group(1)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we refactor the regex?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where to?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about just making use of the properties you added to the Game class? The map_file_path is already being set on line 532.

map_name = game.map_name

make_game_options: Callable[[Player], GameLaunchOptions]
async def launch_server_made_game(
self,
game: Game,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could make an intermediate class AutomatchGame


def is_confirmation_overdue(self):
time_passed = datetime.utcnow() - self.created_time
return time_passed.seconds > self.response_time_seconds + 5
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why hardcode +5 here? Just set the response time to 35 seconds?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did give the client 5 more seconds to answer because of network delay etc.
What do you mean by just set the response time higher? That would also cause the client to display a longer time to the user.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok I see. I didn't catch that the response time is sent to the client.

@@ -0,0 +1,766 @@
[*]
charset = utf-8
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need to look into this editorconfig stuff. Would probably be best to do it in a separate PR. This file also looks like it has way too much stuff in it. I would want to trim out anything we don't need.

assert self._rating_type_ids is not None

if summary.rating_type is None:
self._logger.debug(f"Not processing game {summary.game_id} since it is not rated.")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't use f-strings in log messages.

Suggested change
self._logger.debug(f"Not processing game {summary.game_id} since it is not rated.")
self._logger.debug("Not processing game %s since it is not rated.", summary.game_id)

@Askaholic Askaholic force-pushed the develop branch 3 times, most recently from 75a18d1 to 0a667d2 Compare December 22, 2024 22:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RFC: Take matchmaking requests from RabbitMQ

2 participants