Protocol Negotiation Issues

More
04 Nov 2013 18:48 #21 by Tijer
Replied by Tijer on topic Background colors not displaying properly
that got it... its working exactly like it was before the changes to the code back at the start of this thread.. thanks for looking into it.. i was wondering if it was my mud that was at fault.. :)

Please Log in or Create an account to join the conversation.

More
05 Nov 2013 08:02 #22 by RahjIII
Replied by RahjIII on topic Background colors not displaying properly
Now on input I'm seeing:

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.

More
05 Nov 2013 15:36 #23 by plamzi
Replied by plamzi on topic Background colors not displaying properly
You should now be seeing an ECHO negotiation, and the IPADDRESS sent via NEW-ENVIRON.

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 :) Can you tell me what it does and what you need it for?

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.

More
06 Nov 2013 07:48 #24 by RahjIII
Replied by RahjIII on topic Background colors not displaying properly
Sorry man, I should have been more clear. What I meant in my previous post was: "I do not see the client explicitly refusing the server's offer to ECHO and SGA. Did you intend to have the client ignore the offer, or did you intend to refuse it with a DONT? Either way is correct- but I'm not seeing an explicit DONT"

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.

More
06 Nov 2013 13:55 #25 by plamzi
Replied by plamzi on topic Background colors not displaying properly
I thought ECHO was just the ability to suppress local echo for password input etc. Sounds like there's more to it so I'm going to specifically decline with WONT in the first 8-10 seconds on connect (even though default is WONT ECHO, DONT ECHO). Same goes for SGA and NAWS.

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.

More
07 Nov 2013 08:08 #26 by RahjIII
Replied by RahjIII on topic Background colors not displaying properly
Ok, option negotiation looks good to me. Sweet!

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.

More
08 Nov 2013 17:48 #27 by Tijer
Replied by Tijer on topic Protocol Negotiation Issues
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)

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.

More
08 Nov 2013 18:16 - 08 Nov 2013 18:17 #28 by plamzi
Replied by plamzi on topic Protocol Negotiation Issues

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.
Last edit: 08 Nov 2013 18:17 by plamzi.

Please Log in or Create an account to join the conversation.

More
08 Nov 2013 18:26 #29 by Tijer
Replied by Tijer on topic Protocol Negotiation Issues
ok then... i take that back.. sorry.. lol... you mustve been mid change when i checked!! :)

Please Log in or Create an account to join the conversation.

More
11 Jun 2014 02:23 #30 by Splork
Replied by Splork on topic Protocol Negotiation Issues
Looks like my TTYPE is showing the IP address since it repeats itself twice. We switched over to use Kavir's protocol snippet, so I can only assume that everyone using it will be seeing the same thing? Looks like everything else is showing up correctly. Any ideas or should we simple capture the first TTYPE given which is actually against the RFC protocol as its supposed to repeat itself?


I am attaching a screenshot of my display.
Attachments:

Please Log in or Create an account to join the conversation.

More
11 Jun 2014 03:06 #31 by plamzi
Replied by plamzi on topic Protocol Negotiation Issues
From the RFC @ tools.ietf.org/html/rfc1091

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.

More
27 Aug 2014 06:48 #32 by RahjIII
Replied by RahjIII on topic Background colors not displaying properly
I was looking over the connection data for one of my players who uses the client here and see something strange with the MTTS PROXY IPADDRESS reporting.

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.

More
27 Aug 2014 12:53 #33 by plamzi
Replied by plamzi on topic Background colors not displaying properly
Removed the quotes, so try now.

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.

More
27 Aug 2014 17:30 #34 by RahjIII
Replied by RahjIII on topic Background colors not displaying properly
You should lose the spaces too. It was sending the 13 byte variable name {_"IPADDRESS"_}. After you removed the quotes it sends the 11 bytes {_IPADDRESS_}. It should send the nine byte name {IPADDRESS}. I've replaced spaces with _'s to make them stand out.

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.

More
27 Aug 2014 17:59 #35 by plamzi
Replied by plamzi on topic Background colors not displaying properly
Duh. Removed the spaces as well.

Please Log in or Create an account to join the conversation.

More
27 Aug 2014 18:29 #36 by RahjIII
Replied by RahjIII on topic Background colors not displaying properly
Beauty. Lookin' great.

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.