Skip to content

feat: support fractional reconnect delays - #18

Merged
NotRyken merged 4 commits into
TerminalMC:mc26.1from
Sn0wo2:feat/fractional-reconnect-delays
Sep 3, 2026
Merged

feat: support fractional reconnect delays#18
NotRyken merged 4 commits into
TerminalMC:mc26.1from
Sn0wo2:feat/fractional-reconnect-delays

Conversation

@Sn0wo2

@Sn0wo2 Sn0wo2 commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

<3

@NotRyken

NotRyken commented Sep 1, 2026

Copy link
Copy Markdown
Member

What use-case is this associated with?

@Sn0wo2

Sn0wo2 commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

What use-case is this associated with?

Where I need to retry joining a server at a high frequency

When I connect to mc.hypixel.net through a proxy, the proxy IP may sometimes be blocked by Cloudflare Spectrum. In that case, I may need to repeatedly attempt to rejoin before the connection eventually succeeds

I'm not the only person experiencing this issue:
https://hypixel.net/threads/i-am-about-to-scream-why-can-i-never-connect-to-hypixel.6063303/
https://hypixel.net/threads/cant-connect-to-server.6136142/

If reconnecting has a minimum delay of 1 second, it unnecessarily wastes more time. Allowing the delay to be set to 0.1 seconds would let me retry joining the server much more quickly

@NotRyken

NotRyken commented Sep 2, 2026

Copy link
Copy Markdown
Member

Noted, I'm not sure that rapidly retrying is likely to be a good idea (you may trip a rate limit, for example) but I suppose that responsibility can be left to the user.

@NotRyken NotRyken left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

On the whole, seems like a pretty good implementation. I do have some questions/comments though, see inline.

Comment thread common/src/main/resources/assets/autoreconnectrf/lang/en_us.json
Comment thread common/src/main/java/dev/terminalmc/autoreconnectrf/AutoReconnect.java Outdated
Comment thread common/src/main/java/dev/terminalmc/autoreconnectrf/config/Config.java Outdated
@Sn0wo2
Sn0wo2 requested a review from NotRyken September 2, 2026 20:10
@NotRyken

NotRyken commented Sep 3, 2026

Copy link
Copy Markdown
Member

Had to double-check my previous assertion. Turned out it was incorrect: MC does not in fact use String#format in any form, and automatically converts %d, %f in translation strings to %s.

That being the case, I've pushed a commit to replace all placeholders in translation keys with %s for clarity, and adjusted the countdown display to only display the decimal part when it's below 10 seconds (and then only one decimal place).

@NotRyken NotRyken left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

See previous comment, but since it was my error I've pushed a commit to fix it. Content with the state of this now, though I'm not sure when it will be released.

@NotRyken
NotRyken merged commit 1bcb437 into TerminalMC:mc26.1 Sep 3, 2026
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.

2 participants