Skip to content

Fix: Block auto reconnect if connection duration less than 5 seconds. #7952

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

Merged
merged 2 commits into from
Jul 16, 2025

Conversation

Harrison-Teeg
Copy link
Contributor

Brief overview of PR changes/additions

Use cTelnet's mConnectionTimer to track whether the client was connected to the server for under 5 seconds. If so, auto-reconnect is blocked.

Also the disconnect message is modified to clarify that the disconnection reason was for "Connection/login attempt rejected by server".

Motivation for adding to Mudlet

Hopefully an approximate fix for the issues surrounding failed auto-logins / Mudlet spamming servers with automatic reconnects.

Other info (issues closed, discussion etc)

Tested to prevent login-loops for mistaken passwords, but succeeds in reconnecting for disconnection events during a normal playing session. Also this doesn't prevent echoing connection errors via e.g. failed SSL authentication.

I consider this an elegant solution for differentiating between servers rejecting a client's connection attempt and disconnecting while playing, but I would understand if Mudlet would prefer to more explicitly track whether a login attempt failed etc.

(Potentially) Fixes: #7584

@Harrison-Teeg Harrison-Teeg requested a review from a team as a code owner July 13, 2025 23:01
Copy link
Member

@SlySven SlySven left a comment

Choose a reason for hiding this comment

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

Looks reasonable - except that I've just spotted that ALL the reason strings are present on the main console and should be translated for the end-users locale - use tr(...) instead of qsl(...) around them. The detection of the specific check for unsupported "Secure connections" ALSO needs checking to see whether Qt provides a translated text in the QSslSocket::errorString() output or it is ALWAYS in English - which will modify handling THAT case.

Copy link
Member

@vadi2 vadi2 left a comment

Choose a reason for hiding this comment

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

Thanks!

@vadi2 vadi2 merged commit 8829f97 into Mudlet:development Jul 16, 2025
11 checks passed
vadi2 pushed a commit that referenced this pull request Jul 21, 2025
#7957)

#### Brief overview of PR changes/additions
Change the qsl("connection failure messages") that we stumbled upon in
PR #7952 to tr("connection failure messages").

Additionally, replace the string matching for a failed secure connection
(which didn't seem to work) with a check against the SSL handshake fail
error enum (QAbstractSocket::SocketError(13))

#### Motivation for adding to Mudlet
Tidying up this little bit of code to the more modern internationalized
Mudlet standard.

#### Other info (issues closed, discussion etc)
@SlySven, if you could test this I would appreciate it. The SSL
handshake error catching has worked in all failure modes I've managed to
test, but I haven't managed to duplicate the errors I saw you produce on
Discord.
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.

Prevent excessive login attempts with auto-reconnect on a bad password
3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy