Skip to content

Improve: add support for Telnet AreYouThere command#7050

Merged
SlySven merged 5 commits intoMudlet:developmentfrom
SlySven:Improve_addSupportForTelnet_AreYouThere
Dec 27, 2023
Merged

Improve: add support for Telnet AreYouThere command#7050
SlySven merged 5 commits intoMudlet:developmentfrom
SlySven:Improve_addSupportForTelnet_AreYouThere

Conversation

@SlySven
Copy link
Copy Markdown
Member

@SlySven SlySven commented Dec 22, 2023

Motivation for adding to Mudlet

Following a discussion in the "#coding" channel in the MUD guild on Discord: https://canary.discord.com/channels/279748146316312576/359062772337606656/1187507352346304583 I pointed out that Mudlet does not respond to the AYT command.

Brief overview of PR changes/additions

This PR fixes that so that it immediately responds (with one of a number of random text phrases) when it gets that command - which should fulfil the requirements for that command.

It also increases the number of Telnet commands that get reported (to all of them) in debug output - including the AYT one. To see them it will be necessary to changed the DEBUG_TELNET #define from the 1 it had been left as (perhaps it should have been left undefined after #2236 was merged) to 2.

Other info (issues closed, discussion etc)

None

Following a discussion in the "#coding" channel in the MUD guild on Discord:
https://canary.discord.com/channels/279748146316312576/359062772337606656/1187507352346304583
I pointed out that Mudlet does not respond to the AYT command. This PR
fixes that so that it immediately responds (with one of a number of random
text phrases) when it gets that command - which should fulfil the
requirements for that.

It also increases the number of Telnet commands that get reported (to all
of them) in debug output - including the AYT one. To see them it will be
necessary to changed the `DEBUG_TELNET` #define from the `1` it had been
left as (perhaps it should have been left undefined after Mudlet#2236 was merged)
to `2`.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
@SlySven SlySven requested a review from a team December 22, 2023 20:51
@SlySven SlySven requested a review from a team as a code owner December 22, 2023 20:51
@SlySven SlySven requested a review from a team December 22, 2023 20:51
@add-deployment-links
Copy link
Copy Markdown

add-deployment-links bot commented Dec 22, 2023

Hey there! Thanks for helping Mudlet improve. 🌟

Test versions

You can directly test the changes here:

No need to install anything - just unzip and run.
Let us know if it works well, and if it doesn't, please give details.

Fixes this notification from CodeFactor:
"Storage-class specifier (static, extern, typedef, etc) should be at the
beginning of the declaration." for src/ctelnet Line 1011.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
Copy link
Copy Markdown
Contributor

@Kebap Kebap left a comment

Choose a reason for hiding this comment

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

Seems legit.

This also somewhat refactors the case handling of telnetCommand[1] in ctelnet.cpp file.
Also moves the debug configuration out of there into the respective CMakeLists.txt and mudlet.pro files.
Thought this was worth a mention here.

src/ctelnet.cpp Outdated
// expects is "something" - so let's keep 'em guessing 8-) - SlySven
const static QByteArrayList randomStrings = {
{"Yep."},
{"You bet your sweet arse I am!"},
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
{"You bet your sweet arse I am!"},

Think of the children!

Copy link
Copy Markdown
Member Author

@SlySven SlySven Dec 22, 2023

Choose a reason for hiding this comment

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

Would s/arse/cheeks/ be acceptable? 😜

Though https://www.indy100.com/viral/british-swear-word-ranked-offensiveness-2659905092 reports that in a survey the word ranks only as "mild" :

Words rated as mild were thought to be okay to use around children, whereas medium words were seen by most to be potentially unacceptable before the 9pm watershed. The vast majority thought the strong words should definitely be saved for after 9pm.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
@SlySven SlySven enabled auto-merge (squash) December 23, 2023 01:03
Copy link
Copy Markdown
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.

Looks good to me in general. Can we get 2-3 game admins to implement this in their games so it has some real world testing before we merge?

@SlySven SlySven disabled auto-merge December 27, 2023 19:14
@SlySven
Copy link
Copy Markdown
Member Author

SlySven commented Dec 27, 2023

Ah, trying to determine what the correct response to an <IAC><AYT> is not as simple as I thought. https://www.rfc-editor.org/rfc/rfc854.txt just says:

Are You There (AYT)

Many systems provide a function which provides the user with some visible (e.g., printable) evidence that the system is still up and running. This function may be invoked by the user when the system is unexpectedly "silent" for a long time, because of the unanticipated (by the user) length of a computation, an unusually heavy system load, etc. AYT is the standard representation for invoking this function.

Then later in the same document:

Send back to the NVT some visible (i.e., printable) evidence that the AYT was received.

There is no "standard" reply but the most popular one I have seen in on-line examples which actually offer one is a simple "YES" - the trouble with my fancy "random" strings is knowing that they were sent in response to an <IAC><AYT> and not some other output from Mudlet that just happened to turn up at the time the Server was waiting for a reply. So I'm going to go KISS (keep it simple, stupid).

Copy link
Copy Markdown
Member Author

@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.

Nuke the random replies.

@SlySven SlySven enabled auto-merge (squash) December 27, 2023 19:22
@SlySven SlySven merged commit ab5cdff into Mudlet:development Dec 27, 2023
vadi2 pushed a commit to vadi2/Mudlet that referenced this pull request Jan 5, 2024
#### Motivation for adding to Mudlet
Following a discussion in the "#coding" channel in the MUD guild on
Discord:
https://canary.discord.com/channels/279748146316312576/359062772337606656/1187507352346304583
I pointed out that Mudlet does not respond to the AYT command.

#### Brief overview of PR changes/additions
This PR fixes that so that it immediately responds (with "YES")
when it gets that command - which should fulfil the requirements
for that command.

It also increases the number of Telnet commands that get reported (to
all of them) in debug output - including the AYT one. To see them it
will be necessary to changed the `DEBUG_TELNET` #define from the `1` it
had been left as (perhaps it should have been left undefined after Mudlet#2236
was merged) to `2`.

#### Other info (issues closed, discussion etc)
None

---------

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
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.

3 participants