Protocol Negotiation Issues

More
02 Oct 2013 21:05 - 05 Nov 2013 15:11 #1 by Ornir
Protocol Negotiation Issues was created by Ornir
On the wilderness map of Luminari MUD, we currently use background colors in some areas. While this may change, I did notice that the mud client shows TWO characters, a 'm' and the character I expect to see. This sends the whole map out of alignment, screwing up navigation and pretty much everything.

Thanks!

- Ornir Elunari
Last edit: 05 Nov 2013 15:11 by plamzi.

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

  • plamzi
  • plamzi's Avatar
  • Away
  • Administrator
More
03 Oct 2013 01:24 #2 by plamzi
Replied by plamzi on topic Background colors not displaying properly
Hi,

What's the quickest way to reproduce this issue? I tried creating a character and roaming around but couldn't get to a place where background colors were used.

Luminari will now show in the app Game Center. it won't show up in listings until you add a description and image.

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

More
03 Oct 2013 04:45 #3 by Ornir
Replied by Ornir on topic Background colors not displaying properly
The quickest way to reproduce the issue is to log in when I am around! :)

The wilderness is still in development and there is no easy way to get there from the mud proper.

- Ornir Elunari

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

More
03 Oct 2013 16:04 #4 by hawgpadre
Replied by hawgpadre on topic Background colors not displaying properly
Seeing the same issue on Wayfar - quickest way to the map is to create character, head east after leaving the shuttle, set gender, choose background, then CHOOSE DISPATCH, pick a planet, and you'll be landed in the wilderness.

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

  • plamzi
  • plamzi's Avatar
  • Away
  • Administrator
More
05 Oct 2013 18:52 #5 by plamzi
Replied by plamzi on topic Background colors not displaying properly
Should work better now, though probably not perfect yet.

Luminari is doing <ANSI Foreground Color><ANSI Invert> instead of setting the background color directly.

I wasn't able to reach a wilderness on Wayfar but it looks like it could be the same issue.

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

More
07 Oct 2013 15:51 #6 by hawgpadre
Replied by hawgpadre on topic Background colors not displaying properly
That might be how Wayfar specifies background ANSI as well, I'll have to check. Map display is improved by a lot, although it's not coming through exactly as displayed in MushClient:



One other thing I've noticed:

#-5457 from (mudportal websocket proxy) > client mudportal.comclient_version 1.0client_ip 63.233.133.4E[**Vco swampdog ******

This first line sent by the web client is not terminated with a newline, so the first time you try to login (co swampdog *****) the client identifier line is all jumbled up with your login and the login fails.

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

  • plamzi
  • plamzi's Avatar
  • Away
  • Administrator
More
10 Oct 2013 13:44 #7 by plamzi
Replied by plamzi on topic Background colors not displaying properly
The second issue had to do with the proxy sending identification info via GMCP even if the server doesn't support it. This should be fixed now.

For the ANSI background map, try setting the background colors without using the invert code (7). Invert doesn't make it clear what you want the foreground color to be. This may have the result you expect on some clients, but not on others.

You can set background colors by sending codes #40-47, as per: en.wikipedia.org/wiki/ANSI_escape_code

The Portal app also supports 256-color codes, including background colors. The wiki link above covers those as well.

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

More
10 Oct 2013 20:29 #8 by Tijer
Replied by Tijer on topic Background colors not displaying properly
that change has made the 256 colors stop working entirely on my test mud!! And my main mud also!!!

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

  • plamzi
  • plamzi's Avatar
  • Away
  • Administrator
More
10 Oct 2013 20:40 #9 by plamzi
Replied by plamzi on topic Background colors not displaying properly

Tijer wrote: that change has made the 256 colors stop working entirely on my test mud!! And my main mud also!!!


When you're reporting issues, please remember to share the quickest way to reproduce.

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

More
11 Oct 2013 17:38 #10 by Tijer
Replied by Tijer on topic Background colors not displaying properly
connect to godwars.net 2770, and type help extended colours....
using the portal app...

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

  • plamzi
  • plamzi's Avatar
  • Away
  • Administrator
More
12 Oct 2013 00:23 #11 by plamzi
Replied by plamzi on topic Background colors not displaying properly
Says there is no help on that word.
Attachments:

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

More
13 Oct 2013 10:11 #12 by Tijer
Replied by Tijer on topic Background colors not displaying properly
or just type colorlist ( i think thats the command.... not really been working on that code) the greeting should be in orange... and if you check "finger" it no longer displays the Protocols you are supporting... nor the client you are using to connect (but this all works when connecting via mushclient)

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

More
03 Nov 2013 11:05 #13 by Tijer
Replied by Tijer on topic Background colors not displaying properly
still not working...

looks as if the actual protocols are not being negotiated by the mudportal plugin, used to work... :( Issues affecting my test mud.. AND Legends of Hatred....

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

  • plamzi
  • plamzi's Avatar
  • Away
  • Administrator
More
03 Nov 2013 13:19 #14 by plamzi
Replied by plamzi on topic Background colors not displaying properly
Thanks for narrowing it down to negotiation.

Here's what you should be getting as TTYPE on connect:

"mudportal.com", "ANSI-256COLOR", "MTTS 141", <user IP>

The second and the third entry both should declare 256-color support. Let me know if you think the issue is on my end.

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

More
03 Nov 2013 15:07 #15 by Tijer
Replied by Tijer on topic Background colors not displaying properly
its not showing any protocols... nor is it showing the name of the client...

will point out that the negotiation works on zMUD, cMUD and Mushclient... just hasnt since the first response on this thread by me (if that gives you a little idea as to when the issue started)

if you connect to my mud.. and type finger (on your own character) it should show the following if protocols are supported:

Client: MUSHclient (Version: 4.91).
Protocols: NAWS, TTYPE, 256 Colours, MXP (0.5), MCCP.
Screen Size: 271 characters wide and 60 characters high.

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

More
03 Nov 2013 15:14 #16 by Tijer
Replied by Tijer on topic Background colors not displaying properly
LoH and the test mud use a modified version of KaVir's MUD protocol snippet, just attempted to connect to a MUD that uses an unmodified version of that code, and it hangs on connection.. so my guess is its something your end... not on the MUD's concerned...

never get past password entry screen...

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

More
03 Nov 2013 17:26 #17 by RahjIII
Replied by RahjIII on topic Background colors not displaying properly
I don't see the mudp client doing any linemode, naws, ttype or env negotiation when it connects. LO sends these modes to the client:

IAC WILL TELOPT_ECHO,
IAC WILL TELOPT_SGA,
IAC DO TELOPT_TTYPE,
IAC DO TELOPT_NAWS,
IAC DO TELOPT_NEW_ENVIRON,
IAC WILL TELOPT_MSSP,

And all it gets back from the client is:

IAC WILL 201
IAC DO 69
IAC DO 86

(LO doesn't support those protos and they aren't in arpa/telnet.h so I don't have a decode for what they are.)

The Last Outpost
last-outpost.com:23

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

  • plamzi
  • plamzi's Avatar
  • Away
  • Administrator
More
03 Nov 2013 20:05 #18 by plamzi
Replied by plamzi on topic Background colors not displaying properly
Try now, both of you. I made a number of adjustments to the negotiations and I believe at least the TTYPE and 256-color negotiation should be sorted out.

Also, now it should be sending client info via MSDP as well on connect, including the user IP.

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

More
04 Nov 2013 08:10 #19 by Tijer
Replied by Tijer on topic Background colors not displaying properly
Works now... BUT no longer displays the client name.. displays it as "unknown" used to (before all the changes back at the start of the thread) display "Mudportal Client" or something along those lines... doesnt also appear to be negotiating 256 colours at al now!!

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

  • plamzi
  • plamzi's Avatar
  • Away
  • Administrator
More
04 Nov 2013 14:07 #20 by plamzi
Replied by plamzi on topic Background colors not displaying properly
Try now. I used Legends of Hatred's finger command to verify.
The following user(s) said Thank You: RahjIII

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

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.

  • plamzi
  • plamzi's Avatar
  • Away
  • Administrator
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.

  • plamzi
  • plamzi's Avatar
  • Away
  • Administrator
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.

  • plamzi
  • plamzi's Avatar
  • Away
  • Administrator
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.

  • plamzi
  • plamzi's Avatar
  • Away
  • Administrator
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.

  • plamzi
  • plamzi's Avatar
  • Away
  • Administrator
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.

  • plamzi
  • plamzi's Avatar
  • Away
  • Administrator
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.