Client Parsing?

  • Lyanic
  • Lyanic's Avatar Topic Author
  • Offline
  • Junior Member
More
13 Aug 2013 13:59 #1 by Lyanic
Client Parsing? was created by Lyanic
Someone logged into 7th Plane yesterday from the MUD Portal web client, complaining of odd display issues. I checked it out myself, and it seems to be inserting extra EOL characters, which wreaks havoc on ASCII art and maps.

I don't know if it's a protocol issue, improper handling of EOL characters, or something else. My code sends "\r\n" for linebreaks, and supports the following protocols: ANSI, ATCP, MCCP1/2, MSDP, MSP, MXP, NAWS, TTYPE, UTF8, and xterm256.

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

More
13 Aug 2013 14:43 #2 by plamzi
Replied by plamzi on topic Client Parsing?

Lyanic wrote: Someone logged into 7th Plane yesterday from the MUD Portal web client, complaining of odd display issues. I checked it out myself, and it seems to be inserting extra EOL characters, which wreaks havoc on ASCII art and maps.

I don't know if it's a protocol issue, improper handling of EOL characters, or something else. My code sends "\r\n" for linebreaks, and supports the following protocols: ANSI, ATCP, MCCP1/2, MSDP, MSP, MXP, NAWS, TTYPE, UTF8, and xterm256.


Try now. I don't have time to get to the bottom of the issue but I added a workaround.

If you want to help track this down, take a look at the .out window and "ui.js" with something like Firebug. I saw two linebreaks in the welcome screen art where there should be one. The extra one ends up in a span tag with nothing but whitespaces behind it.

The workaround is at line 1517 ATM:
t = t.replace(/<span(.+?)>\n( +?)</g,'<span$1>$2<');

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

More
13 Aug 2013 14:55 #3 by plamzi
Replied by plamzi on topic Client Parsing?
You mentioned MXP. Just on a hunch, is the game sending out-of-band data that may have line breaks inside it?

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

More
13 Aug 2013 15:25 #4 by Arynth
Replied by Arynth on topic Client Parsing?
I was also testing the Client out on the 7th Plane. I played with Chrome Dev Tools some, and found why it displays like it does, though not why it's getting put in the client. There are extra returns in your generated Div elements, between the Spans. I am still trying to see where those are coming from. I know the mud sends a format clear on each new line, so that might be causing it, but I will have to double check the code and see.

As for MXP, it only sends it on certain lines, not on all lines like this, and only if it is turned on through negotiation. If it isn't enabled, it will not be sent. Same for any other Out-of-band data we send (MSDP, ATCP, etc).

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

More
13 Aug 2013 15:41 #5 by plamzi
Replied by plamzi on topic Client Parsing?

Arynth wrote: I know the mud sends a format clear on each new line, so that might be causing it, but I will have to double check the code and see.


Sounds like a good lead. Let me know what that looks like.

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

More
13 Aug 2013 16:31 #6 by Arynth
Replied by Arynth on topic Client Parsing?
Played with it for awhile, and can't see where it would be sending any extra returns. If it was, other clients would show them as well, not just here.

The who list and in game maps are the easiest to see it, and are both locations where there is only one /r/n sent per line, so it shouldn't be doing anything odd there. Do you know of an easy way to see the raw data coming from the mud to your client? Just trying to track down where these extra returns are.

Oddest thing: the html source code (Chrome on OSX) only has \n's between the span elements in the Divs. I know we send \r\n, but these only have \n. I didn't see where you are parsing those out, though I admit to not looking very hard either (at work).

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

More
13 Aug 2013 16:38 #7 by Tijer
Replied by Tijer on topic Client Parsing?
my listing has suddenly stopped letting me connect via here... dont think i edited anything.. dunno..

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

More
13 Aug 2013 16:45 #8 by plamzi
Replied by plamzi on topic Client Parsing?
I enabled console.log of raw input.

The stuff that's causing the extra line breaks at the welcome screen is an ANSI color sequence: [1;37m[0m\n

Can you take this further? Thanks.

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

More
13 Aug 2013 16:48 #9 by plamzi
Replied by plamzi on topic Client Parsing?

Tijer wrote: my listing has suddenly stopped letting me connect via here... dont think i edited anything.. dunno..


Fixed. Not sure how it broke.

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

More
13 Aug 2013 16:51 #10 by Tijer
Replied by Tijer on topic Client Parsing?
thanks :)..... strange issue tho.. extra lines between everything.. and some colors not displaying properly... My MUD utilizes kavirs mud protocol snippet. so i dont know if that is causing issues

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

More
13 Aug 2013 16:54 #11 by plamzi
Replied by plamzi on topic Client Parsing?

Tijer wrote: thanks :)..... strange issue tho.. extra lines between everything.. and some colors not displaying properly... My MUD utilizes kavirs mud protocol snippet. so i dont know if that is causing issues


Will sort these issues out quickly. Up until a few days ago, the app was only pointing to my game, so the parsing code is still very lazy and gimmicky.

I have a theory about how that button broke and how to prevent it from happening again. Thanks for catching it.

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

More
13 Aug 2013 17:41 #12 by plamzi
Replied by plamzi on topic Client Parsing?
I believe the extra line feeds issue is behind us.

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

More
13 Aug 2013 17:43 #13 by Tijer
Replied by Tijer on topic Client Parsing?
Yep working correctly for my MUD

only thing that isnt is the Dark White ANSI sequence... (aka Default)

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

More
13 Aug 2013 17:50 #14 by Tijer
Replied by Tijer on topic Client Parsing?
Also light green ansi color is showing as yellow..

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

More
13 Aug 2013 17:56 #15 by Tijer
Replied by Tijer on topic Client Parsing?
almost there :)

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

  • Lyanic
  • Lyanic's Avatar Topic Author
  • Offline
  • Junior Member
More
14 Aug 2013 00:14 #16 by Lyanic
Replied by Lyanic on topic Client Parsing?
Yes, the linebreak issue seems fixed on 7th Plane too. The colors look fine to me. If I had a complaint about one, it'd be the brown/orange ANSI color - it's a little more "orange" than I'm used to from most other clients. That's very subjective and nitpicky, though. Is there any chance of supporting xterm256 in the future?

P.S. Thanks for all the quick updates to the site/client, and for adding an image back to my game listing. I like the direction of this site so far.

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

More
14 Aug 2013 01:57 #17 by plamzi
Replied by plamzi on topic Client Parsing?

Lyanic wrote: it's a little more "orange" than I'm used to from most other clients. That's very subjective and nitpicky, though. Is there any chance of supporting xterm256 in the future?


Eventually, we'll have a module for customizing the basic colors, another module for xterm256, the whole nine. I'm making a push to get us to a point where multiple contributors can customize the app via the website, at the same time.

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

More
16 Aug 2013 22:18 - 16 Aug 2013 22:18 #18 by Tijer
Replied by Tijer on topic Client Parsing?
the updates to the client to use mxp are messing up on my mud.... my mxpified exits, are merging with my prompt.. i think it may be something to do with how KaVir's snippet parses mXp.... ofcourse i could be totally wrong....
Last edit: 16 Aug 2013 22:18 by Tijer.

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

More
16 Aug 2013 22:34 #19 by plamzi
Replied by plamzi on topic Client Parsing?

Tijer wrote: the updates to the client to use mxp are messing up on my mud.... my mxpified exits, are merging with my prompt.. i think it may be something to do with how KaVir's snippet parses mXp.... ofcourse i could be totally wrong....


The plugin is very first-draft. I'll take a look later tonight.

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

More
16 Aug 2013 22:35 #20 by Tijer
Replied by Tijer on topic Client Parsing?
not a problem just thought id let ya know...

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