-
-
Notifications
You must be signed in to change notification settings - Fork 70
Punish the host with a matchmaker violation if game setup times out #1070
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?
Conversation
WalkthroughThe Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
server/ladder_service/ladder_service.py (1)
686-689: Consider using explicit exception chaining.For clarity, use
raise ... from Noneto explicitly indicate this is a new exception, not chained from the caughtTimeoutError.except asyncio.TimeoutError: connected_players = game.get_connected_players() # The host is included here, because he might be responsible for # a guest being unable to connect, e.g. because they didn't # receive his connect message. raise NotConnectedError([ player for player in guests if player not in connected_players - ] + [host]) + ] + [host]) from NoneBased on static analysis hints.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
server/ladder_service/ladder_service.py(1 hunks)
🧰 Additional context used
🪛 Ruff (0.14.3)
server/ladder_service/ladder_service.py
686-689: Within an except clause, raise exceptions with raise ... from err or raise ... from None to distinguish them from errors in exception handling
(B904)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Codacy Static Code Analysis
- GitHub Check: unit-test
🔇 Additional comments (1)
server/ladder_service/ladder_service.py (1)
683-689: The review comment is based on incomplete understanding of the code history.The unconditional host penalty is not a new issue introduced by this change—it existed in the previous version. Before this commit, the code was
raise NotConnectedError([host]), penalizing only the host on timeout. This commit actually refined the logic by conditionally penalizing guests who failed to connect while maintaining the intentional host penalty policy.The unconditional host penalty represents an explicit design decision stated in the commit message: "Punish the host with a matchmaker violation if game setup times out." The code works as designed. While the review comment raises a valid fairness concern about false positives, it proposes changing an established policy rather than fixing a defect.
Likely an incorrect or invalid review comment.
|
Here's an idea: punish everyone, because everybody can be the cause. This might punish innocent players, but will 100% punish guilty ones. |
|
Are you unhappy with the original proposal? |
|
Maybe I'm somewhat unhappy, there are already some weird 'innocent' bans when players seemed to be connected, and this will just add more to that Like at least checking the number of connected players before including host would somewhat reduce false positives -- if no one else were able to connect (or only few were able) then it is more likely that host is to blame |
|
I coded this because there was suspicion that some players would maliciously send incorrect packets to other players if they are the host, preventing the game from starting. In this case, checking if the majority of players are connected would not help, because they could send invalid packets to just one player. |
The host might be responsible for other players failing to connect to the game. The host will now receive a matchmaker violation every time the game setup times out. This might punish innocent hosts, but to prevent abuse it is important to acknowledge the possible contribution of the host as well.
Summary by CodeRabbit