These are chat archives for Mudlet/Mudlet/whatever

13th
Jul 2017
Stephen Lyons
@SlySven
Jul 13 2017 03:37
Does anyone recognise the user name of the author of this it actually help make sense of some of the telnet stuff - and suggests that I might want to start looking more closely at option 42...! It does seem a little old because Mudlet does some of the things that the article says it doesn't! 😥
Vadim Peretokin
@vadi2
Jul 13 2017 06:08
Nope, sorry
We could really use STD::optional to simplify our status Boolean, String error pattern
Stephen Lyons
@SlySven
Jul 13 2017 14:40

Just looking under the stone that is Telnet option negotiation 🤢 and spotted that GMCP (ATCP, and 102) is(are) applicable in BOTH directions but it is not obvious that we actually negotiate it like that - e.g. we set enableGMCP as soon as we get either a DO or a WILL and do not negotiate BOTH directions as we ought as I understand it at the start HE (as SERVER) sends us a WILL to which WE (as CLIENT) reply DO and then enable the use of the option from HIM to US, however it is not obvious to me that WE (as SERVER) also sends a WILL separately to await HIM (as CLIENT) to replay with a DO/DONT in order for us to enable using the option from US to HIM... my head aches getting this clear in my mind 🤕

Also spotted KazDragon's Telnet library on GitHub which seems to be an active, up to date implimentation if we should ever decided to use a pre-packaged TelNet class.

keneanung
@keneanung
Jul 13 2017 14:49
Like with edbee, I'm all for using other people's projects (because we can concentrate on our stuff and others on what they know things about).
keneanung
@keneanung
Jul 13 2017 14:57
Though the README documentation of that library is not much less headache inducing than the telnet spec...
Stephen Lyons
@SlySven
Jul 13 2017 15:01
telnet spec you make it sound like there is just ONE document. 🤣
keneanung
@keneanung
Jul 13 2017 15:01
:D
Stephen Lyons
@SlySven
Jul 13 2017 15:03
I'm trying to nail a RFC1143 system into the cTelnet class with a pair of six-state enums to track each pair of options (HIM->US and US->HIM)...
keneanung
@keneanung
Jul 13 2017 15:08
I'm also not sure the library allows for our "Open suboption" concept or if it answers DONT for all suboptions it doesn't know about
Stephen Lyons
@SlySven
Jul 13 2017 15:19
Answering DONT for an option you do not understand is the correct response however this is mitigated by the user/a script registering an interest in the option with a Lua call to addSupportedTelnetOption(optionNumber) that sets a flag in (QMap<int, bool>) cTelnet::supportedTelnetOptions which changes that to a DO - mind you that only works for communications from HIM to US - it is down to the user/script to manage any negotiation for US to HIM (we send WILL option and await a DO back) - and I am not sure our code responds to that correctly as we then send another WILL in response to things that we understand...
keneanung
@keneanung
Jul 13 2017 15:20

however this is mitigated by the user/a script registering an interest in the option with a Lua call to addSupportedTelnetOption(optionNumber)

That's what I mean: I am not sure that telnet library is able to do that.

Stephen Lyons
@SlySven
Jul 13 2017 15:22

I have asked a question on SE lets see if I get any biters...

I think it does, the README points out:
>

  • activate() - this is used to request activation on the remote side.
  • set_activatable() - this is used to allow the option to be activated from the remote side.
  • on_state_changed - this is a signal that is called when the option is either being activated, active, being deactivated, or has become inactive.
active() is us sending a WILL to request HE uses the option to SEND TO us
set_activatable() is us being prepared to get a DO from HIM so we use option to SEND TO him
keneanung
@keneanung
Jul 13 2017 15:26
But those things- I think I'm just getting an :bulb: You can of course add a new option to session upon addSupportedTelnetOption (including callback to raise an event...)
I'm still not always good at linking lua and c++ together in my mind...
Stephen Lyons
@SlySven
Jul 13 2017 15:27
It is hard though, to keep track of what is happening in both directions at the same time... 🤢
keneanung
@keneanung
Jul 13 2017 15:28
hence why I like using external libraries if we can
Stephen Lyons
@SlySven
Jul 13 2017 15:28
Anyhow must take a break now... Bye 4 Now.
keneanung
@keneanung
Jul 13 2017 15:28
enjoy your time!