Protocol Negotiation Issues
- Tijer
-
- Offline
- Senior Member
- Posts: 41
- Thank you received: 0

Please Log in or Create an account to join the conversation.
- RahjIII
-
- Offline
- New Member
- Posts: 13
- Thank you received: 0
IAC WILL 201
IAC WILL 91
IAC WILL TTYPE
IAC SB TTYPE IS mudportal.com IAC SE
IAC WILL TTYPE
IAC SB TTYPE IS XTERM-256color IAC SE
IAC WILL TTYPE
IAC SB TTYPE IS MTTS 141 IAC SE
IAC WILL TTYPE
IAC SB TTYPE IS 69.181.111.151 IAC SE
IAC WILL TTYPE
IAC SB TTYPE IS 69.181.111.151 IAC SE
IAC DO 86
Im still not seeing NAWS or ECHO or SGA negotiation. Should I be?
LO only asks for a TTYPE with a SEND when it gets a WILL TTYPE, and it won't ask for more than one ttype, so I suspect you are sending the WILL TTYPE's gratuitously after sending a TTYPE value instead of waiting for the next request from the server. Is that what is going on? My game can certainly deal with that, but for compatibility, RFC 1091 section 5 says that "Terminal type information may not be sent spontaneously, but only in response to a request."
In Mud Terminal Type Standard , the section on proxies suggests sending the IP address as a NEW-ENVIRON variable named IPADDRESS, rather than appending it as another ttype value. I think that recommendation is a lot easier to parse on the server, and its already how I've implemented address reporting for the LO proxy. Would be cool if mudportal did it that way.
I'm totally going to implement full mtts on the LO server if the mudportal client is using it. Very cool, plamzi.

The Last Outpost
last-outpost.com:23
Please Log in or Create an account to join the conversation.
- plamzi
-
- Offline
- Administrator
- Posts: 285
- Thank you received: 42
Regarding TTYPE, when I follow RFC1091 to the letter, the processing of multiple ttypes fails in Godwars derivatives. What works is if I send the first TTYPE after handshake, then wait for the server to ask for more, then preface additional responses with IAC WILL TTYPE. Right now, this seems to please everyone, unless you are having issues with it (let me know).
NAWS seems pretty useless to me given how the ScrollView works and the much richer abilities to control how text flows on the client side. Let me know if you disagree.
I started reading the Suppress Go Ahead RFC but my head began to hurt

AFAIK, MTTS is not very widespread, which is why we have to do the above gymnastics w/ TTYPE to tell certain servers that 256 colors are supported.
Please Log in or Create an account to join the conversation.
- RahjIII
-
- Offline
- New Member
- Posts: 13
- Thank you received: 0
When a server sends WILL ECHO and WILL SGA to a client, the is server trying to tell the client that it can support char-at-a-time mode-- like the mode what happens with a typical telnet or ssh cli shell session. In that mode, user types a character, and the client sends it immediately to the server without displaying it to the user. The server receives the character and decides whether to send it back to the client for display to the user. The server gets every keystroke and completely controls what is displayed back to the user.
Like a lot of (most?) mud servers, the mudportal client operates in a line-at-a-time mode. User enters a line of text, the client takes care of the line editing and character printing, and a complete line is sent up to the server only when the user hits enter. The server isn't supposed to echo the line back to the client for printing, because the client has already taken care of it.
My understanding is that when a server offers to provide ECHO and SGA by sending a WILL for those options, a client like mudportal that wants to stay in line-at-a-time mode has two options- either don't respond at all to either offer because line-at-a-time is supposed to be the default behavior, or respond with a DONT to explicitly refuse the offers.
Having the client respond with a DO ECHO isn't right, because the client has already shown the input line to the user. The server shouldn't try to do it too.
Setting the IPADDRESS variable via NEW-ENVIRON looks like it is working great on my end!
Thanks for the explanation on the TTYPE behavior. I understand now why you are doing it that way, and I'll fix my server side code to be more tolerant.
On NAWS- Its not useless. Muds that support the option use it to determine how many lines to display before sending the "hit return to continue" message in a pager, and some muds use it to decide when to wrap text. For example, LO uses it to decide how big of an ascii graphic map it can send to the user when they ask for one. LO and stock dikumuds default to an 80x24 size when there's no negotiation, so its not a big deal if the client doesn't support NAWS- but it means that paged text has a 'hit return' prompt after every 22 lines. Even if you don't ever want to support vt100 cursor positioning commands, it'd be a nice option to include in the client.
The Last Outpost
last-outpost.com:23
Please Log in or Create an account to join the conversation.
- plamzi
-
- Offline
- Administrator
- Posts: 285
- Thank you received: 42
The client wraps lines automatically and also lets people change the font on the fly. This means that the window size is not enough information to decide how many lines to display or how long the lines should be, etc. I could come up with some sort of formula to calculate approx. number of visible lines, and characters per line, but to me it feels like pouring work into the wrong thing.
I'm really not aiming to build a full-featured telnet terminal. I'm much more interested in helping devs think beyond telnet and unlock the full potential of a browser. For instance, I'd like to add MXP custom window support so a server can easily drive the whole contents of a help file into a separate window for the user to read at their leisure.
If you have web-based help files, or any other kind of web-accessible content, you can already dock that in an iframe for people to browse on the side.
Please Log in or Create an account to join the conversation.
- RahjIII
-
- Offline
- New Member
- Posts: 13
- Thank you received: 0
On the NAWS subject- I get what you are trying to do. I'm just saying that as nothing more than a concession to compatibility, It might be a useful thing to negotiate the window size to get the server side pager prompts and line wrapping to happen more reasonably. At least it would be there as a fallback until game devs can utilize the cooler browser functionality.
As a server developer I don't think NAWS is useless, but if its low on the priority list for the client code, so be it.

The Last Outpost
last-outpost.com:23
Please Log in or Create an account to join the conversation.
- Tijer
-
- Offline
- Senior Member
- Posts: 41
- Thank you received: 0
I will just say that before the changes you made mudportal app was working fine... apart from being sent random characters when it was negotiating the protocols on connection.
Please Log in or Create an account to join the conversation.
- plamzi
-
- Offline
- Administrator
- Posts: 285
- Thank you received: 42
Tijer wrote: Hate to say this Plamzi.. but what ever you have done to the mud portal app recently has made background colors no longer show on my mud... nor protocols getting negotiated properly (my mud MAY be down sporadicly... we have some issues we are working though)
Things look fine to me on godwars.net:2770 right now. I see background color on the splash screen, and 256 colors when I 'finger' my character. Maybe you looked while I was still tinkering earlier (I make changes to the proxy at runtime).
Tijer wrote: I will just say that before the changes you made mudportal app was working fine... apart from being sent random characters when it was negotiating the protocols on connection.
Well, bombing every server with protocol requests was good enough for the initial roll-out, but now the list of games is growing, and it's causing issues with some games. I'm making everything nice and clean, which means that things that used to work on some servers may stop working, temporarily. If that happens, just report it, give me enough details to reproduce, and all will be well very quickly, I promise.
Please Log in or Create an account to join the conversation.
- Tijer
-
- Offline
- Senior Member
- Posts: 41
- Thank you received: 0

Please Log in or Create an account to join the conversation.
- Splork
-
- Offline
- New Member
- Posts: 5
- Thank you received: 0
I am attaching a screenshot of my display.
Please Log in or Create an account to join the conversation.
- plamzi
-
- Offline
- Administrator
- Posts: 285
- Thank you received: 42
When the server (the receiver of the TERMINAL-TYPE IS) receives the same response two consecutive times, this indicates the end of the list of available types. Similarly, the client should indicate it has sent all available names by repeating the last one sent.
I use KaVir's snippet as well, and the version I use seems to store the first TTYPE while scanning the rest for info on 256-color support, etc. I'm not sure if you did modifications to yours or if your version behaves differently, but I think the portal app follows the RFC--it's just probably one of the few clients that actually cycle through multiple TTYPEs in order to give servers as much information as possible.
Please Log in or Create an account to join the conversation.
- RahjIII
-
- Offline
- New Member
- Posts: 13
- Thank you received: 0
Plamzi, instead of setting the environment variable named {IPADDRESS} to {1.2.3.4}, the client is setting variable { "IPADDRESS" } to { "1.2.3.4" }. Both the variable name and its value are being sent with a surrounding double quote and space. I don't think its supposed to be that way. The quotes and spaces aren't supposed to be sent by the client, are they?
The Last Outpost
last-outpost.com:23
Please Log in or Create an account to join the conversation.
- plamzi
-
- Offline
- Administrator
- Posts: 285
- Thank you received: 42
The NEW-ENVIRON RFC and MTTS are both not very clear on the quotes thing.
Please Log in or Create an account to join the conversation.
- RahjIII
-
- Offline
- New Member
- Posts: 13
- Thank you received: 0
I agree with you on the RFC. Might have been clear as a bell in 1983, but today it's just confusing.
The Last Outpost
last-outpost.com:23
Please Log in or Create an account to join the conversation.
- plamzi
-
- Offline
- Administrator
- Posts: 285
- Thank you received: 42
Please Log in or Create an account to join the conversation.
- RahjIII
-
- Offline
- New Member
- Posts: 13
- Thank you received: 0
Terminal: mudportal.com (80 x 25) (noecho/nosga)
Full TTYPE: mudportal.com, XTERM-256color, MTTS 141, 69.xxx.xxx.151
MTTS Decode: ANSI, UTF-8, 256 COLORS, PROXY
IPADDRESS = 69.xxx.xxx.151
The Last Outpost
last-outpost.com:23
Please Log in or Create an account to join the conversation.