Skip to content
This repository was archived by the owner on Jan 14, 2026. It is now read-only.

clean up code#17

Closed
braydos-h wants to merge 1 commit intomainfrom
test
Closed

clean up code#17
braydos-h wants to merge 1 commit intomainfrom
test

Conversation

@braydos-h
Copy link
Copy Markdown
Owner

No description provided.

@braydos-h
Copy link
Copy Markdown
Owner Author

doesnt work when building

@braydos-h braydos-h closed this Oct 11, 2025
@braydos-h braydos-h deleted the test branch October 11, 2025 02:04
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 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

Comment thread mcsmartscan/probes.py
Comment on lines +100 to +123
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(
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant