Conversation
|
doesnt work when building |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting
| def confirm_minecraft_by_protocol( | ||
| ip: str, | ||
| port: int, | ||
| timeout: float, | ||
| *, | ||
| handshake_host: Optional[str] = None, | ||
| connector: Optional[Connector] = None, | ||
| ) -> Tuple[bool, Optional[Dict[str, object]], str]: | ||
| """Perform a protocol handshake to confirm a Java server.""" | ||
|
|
||
| connector = connector or direct_tcp_connector | ||
| info_modern = _probe_java_status( | ||
| ip, | ||
| port, | ||
| timeout, | ||
| protocols=PROTOCOL_CANDIDATES, | ||
| handshake_host=handshake_host, | ||
| connector=connector, | ||
| ping_pong=True, | ||
| ) | ||
| info_legacy = _legacy_status(ip, port, timeout, connector=connector) | ||
|
|
||
| if not info_legacy: | ||
| info_secondary = _probe_java_status( |
There was a problem hiding this comment.
Handle legacy handshake failures to preserve Java detection
In confirm_minecraft_by_protocol the call to _legacy_status is now performed without any exception handling. Many modern servers reset or time out when they receive the legacy 0xFE ping, which raises ConnectionResetError/TimeoutError. Under this implementation that exception bubbles out of the function, the outer probe_with_fallbacks catches it and skips all subsequent protocol fallbacks, returning only an nmap guess (or nothing if nmap is unavailable). The previous version wrapped the legacy call in a try/except so that failure to speak the legacy protocol still allowed the modern handshake to run. Reintroducing that guard restores detection for servers that reject the legacy ping.
Useful? React with 👍 / 👎.
No description provided.