Issue? Displaying different colors?

Posted by Zeno on Fri 04 Jan 2008 09:30 PM — 3 posts, 9,836 views.

USA #0
For this image:
http://img.photobucket.com/albums/v123/rebirthseph/mc_color_bleed.jpg
You will notice the room title (the second time) is dark red. All room titles in the MUD are bright red, and I am trying to figure out why it displayed as dark red. Yes, there was a color bleed. But it should stop as soon as another color is used.

Here is the debug data:
1;35m76.[1;34m/.   31 3b 33 35 6d 37 36 1b 5b 31 3b 33 34 6d 2f 1b
 [1;35m315.[0;34m   5b 31 3b 33 35 6d 33 31 35 1b 5b 30 3b 33 34 6d
 ] .[1;33mReserve   5d 20 1b 5b 31 3b 33 33 6d 52 65 73 65 72 76 65
 .[0;33m:.[0;34m[   1b 5b 30 3b 33 33 6d 3a 1b 5b 30 3b 33 34 6d 5b
 .[1;31m0.[0;34m]   1b 5b 31 3b 33 31 6d 30 1b 5b 30 3b 33 34 6d 5d
  .[1;37m>          20 1b 5b 31 3b 33 37 6d 3e 
   
 Sent  packet: 610 (3 bytes) 
   
 w..                77 0d 0a 
   
 Incoming packet: 1768 (999 bytes) 
   
 .[1;31mSakuragaw   1b 5b 31 3b 33 31 6d 53 71 6b 75 72 61 67 61 77
 a: 4th Lane...[0   61 3a 20 34 74 68 20 4c 61 6e 65 0a 0d 1b 5b 30
 ;37mAs the 4th L   3b 33 37 6d 41 73 20 74 68 65 20 34 74 68 20 4c
 ane of Sakuragaw   61 6e 65 20 6f 66 20 53 61 6b 75 72 61 67 61 77
 a continues traf   61 20 63 6f 6e 74 69 6e 75 65 73 20 74 72 61 66
 fic seems to eas   66 69 63 20 73 65 65 6d 73 20 74 6f 20 65 61 73
 e up. ..However,   65 20 75 70 2e 20 0a 0d 48 6f 77 65 76 65 72 2c


Any clues as to why the room name was displayed dark red?

[EDIT] Hmm, seems the player had debug and gotten the wrong data (4th lane?). Still a color issue though, hmm.

Edited by Nick to add backslashes to brackets.
Amended on Sat 05 Jan 2008 07:14 PM by Nick Gammon
Australia Forum Administrator #1
To make it easier to analyze your data I wrote a small script to convert the escape character to printable form:


s = utils.fromhex [[
31 3b 33 35 6d 37 36 1b 5b 31 3b 33 34 6d 2f 1b
5b 31 3b 33 35 6d 33 31 35 1b 5b 30 3b 33 34 6d
5d 20 1b 5b 31 3b 33 33 6d 52 65 73 65 72 76 65
1b 5b 30 3b 33 33 6d 3a 1b 5b 30 3b 33 34 6d 5b
1b 5b 31 3b 33 31 6d 30 1b 5b 30 3b 33 34 6d 5d
20 1b 5b 31 3b 33 37 6d 3e 
1b 5b 31 3b 33 31 6d 53 71 6b 75 72 61 67 61 77
61 3a 20 34 74 68 20 4c 61 6e 65 0a 0d 1b 5b 30
3b 33 37 6d 41 73 20 74 68 65 20 34 74 68 20 4c
61 6e 65 20 6f 66 20 53 61 6b 75 72 61 67 61 77
61 20 63 6f 6e 74 69 6e 75 65 73 20 74 72 61 66
66 69 63 20 73 65 65 6d 73 20 74 6f 20 65 61 73
65 20 75 70 2e 20 0a 0d 48 6f 77 65 76 65 72 2c
]]

t = { ["\027"] = "<esc>",
      ["\013"] = "<cr>",
    }

print (string.gsub (s, ".", t))



The hex codes I got from your post, discarding the ASCII stuff at the start of the lines.

This is the result of running that:


1;35m76<esc>[1;34m/<esc>[1;35m315<esc>[0;34m] 
<esc>[1;33mReserve<esc>[0;33m:<esc>[0;34m[<esc>[1;31m0<esc>[0;34m] 
<esc>[1;37m><esc>[1;31mSqkuragawa: 4th Lane

<cr><esc>[0;37mAs the 4th Lane of Sakuragawa continues traffic seems to ease up. 

<cr>However,


First, there is something funny there. On the first line of packet 1768 there is the word "Sakuragawa", however you can see from my debug script that it is really "Sqkuragawa". You can see from further down in that packet that hex "53 61 6b" is "Sak", and near the start of the packet you have "53 71 6b" which is "Sqk". This makes me wonder if the packet has been doctored a bit. ;)

Putting that aside for the moment, the start of that line appears to be: <esc>[1;31mSqkuragawa

This is "turn on bold" (the 1) and "text red" (the 31), so that should have shown in bold red.

I don't see why it didn't in this case, however I don't think your packet exactly matches the screen capture that shows the erroneous display.

Amended on Sun 06 Jan 2008 04:00 AM by Nick Gammon
Australia Forum Administrator #2
One suggestion I have is to thrown in an ANSI reset, at the start of a room name. In other words, change:

<esc>[1;37m

to

<esc>[0;1;37m