[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  SMAUG
. -> [Folder]  SMAUG coding
. . -> [Subject]  Color reference problem

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?
(New message)
Subject: Color reference problem
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please).
Forum codes:
Check this if your message uses 'forum codes' or templates (auto-detected for new posts).
Forum codes Templates

Save this message ...


Subject review (reverse sequence)

Pages: 1 2  

Posted by Zeno   USA  (2,867 posts)  [Biography] bio   Moderator
Date Thu 14 Aug 2003 04:16 AM (UTC)  quote  ]

Amended on Thu 14 Aug 2003 04:19 AM (UTC) by Zeno

Message
Ah, a permanant fix. Just what I've been looking for. I'll look it over, thanks.

[EDIT] Would that be "Customizable ANSI Color v3.0 " ?

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by Samson   USA  (683 posts)  [Biography] bio
Date Thu 14 Aug 2003 01:33 AM (UTC)  quote  ]
Message
The problem you're having is because the Smaug 1.4a color parser is buggy as all hell. I spent months trying to wrestle it into submission and finally gave up and replaced it with the custom color code I have on my site. Ever since I did that, everything just works as expected. You may want to consider doing the same rather than relying on cheap fixes :P

SmaugMuds.org: http://www.smaugmuds.org - The Smaug MUDs Community Center

"The past was erased, the erasure was forgotten, the lie became truth." -- George Orwell, 1984
[Go to top] top

Posted by Zeno   USA  (2,867 posts)  [Biography] bio   Moderator
Date Wed 13 Aug 2003 05:23 AM (UTC)  quote  ]
Message
Alright, I found a way to fix it. If you get this problem, do this. Lets say you use &G and it displays the darker. Use &w&G and it will work fine.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by Nick Gammon   Australia  (18,772 posts)  [Biography] bio   Forum Administrator
Date Tue 08 Jul 2003 08:55 AM (UTC)  quote  ]
Message
I suspect it is something to do with the optimization code at the server end. Somehow seeing the green first is making it think it doesn't need to send the bold code again the next time around.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Zeno   USA  (2,867 posts)  [Biography] bio   Moderator
Date Tue 08 Jul 2003 05:46 AM (UTC)  quote  ]
Message
I don't think its MUSHclient, I've heard other people having this problem who use various other clients.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio   Moderator
Date Tue 08 Jul 2003 05:09 AM (UTC)  quote  ]
Message
I've noticed a similar problem. I don't know if it's the MUD or the server either, but it seems that occasionally colors are darker than they're supposed to be. It also seems to have to do with setting a color on the line before. I haven't done a complete diagnosis, which I'll do and post here, but I'm wondering if it's MUSHclient, since other people I've spoken to don't seem to have the same problem. The problem seemed to be fairly sporadic, and was hard to obtain with regularity.

Personally I've never really trusted the SMAUG color code sending... then again, it's from SMAUG 1.0 and it has probably been improved since then. :)

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Zeno   USA  (2,867 posts)  [Biography] bio   Moderator
Date Mon 07 Jul 2003 07:57 PM (UTC)  quote  ]
Message
I'll provide an example of the room desc.
Room name- Test
Room desc-
&Rred
&Yyellow
&Ccyan
&Bblue
That would show up fine. But if I change...
Room name- &GTest
Room desc-
Same.

It would then convert all the room desc colors to the darker color.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by Nick Gammon   Australia  (18,772 posts)  [Biography] bio   Forum Administrator
Date Mon 07 Jul 2003 07:01 AM (UTC)  quote  ]
Message
For a start, I'm a bit worried about these lines:

if ( xIS_SET(ch->act, PLR_RIP) )
// send_rip_screen(ch);

You have left the "if" in but taken out the line that it affects, this will change the logic.

However I don't think this is the problem, if it is affecting room descs as well you have some sort of problem in the way it translates colours.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Zeno   USA  (2,867 posts)  [Biography] bio   Moderator
Date Sun 06 Jul 2003 11:17 PM (UTC)  quote  ]

Amended on Sun 06 Jul 2003 11:18 PM (UTC) by Zeno

Message
If it matters, its actually the IMOTD. And the code isn't the same... I figured why bother with those ansi files, I just made a help file.

        set_pager_color( AT_PLAIN, ch );
        if ( xIS_SET(ch->act, PLR_RIP) )
         // send_rip_screen(ch);
        if ( xIS_SET(ch->act, PLR_ANSI) )
          do_help( ch, "_login_" );
          //send_to_pager( "\033[2J", ch );
        else
          send_to_pager( "\014", ch );
        if ( IS_IMMORTAL(ch) )
          do_help( ch, "imotd" );
        if ( ch->level == 50)
          do_help( ch, "motd" );
        if ( ch->level < 50 && ch->level > 0 )
          do_help( ch, "motd" );
        if ( ch->level == 0 )
          do_help( ch, "motd" );
        send_to_pager( "\n\rPress [ENTER] ", ch );
        d->connected = CON_READ_MOTD;

But it doesn't happen in IMOTD alone, it also happens in room desc's etc

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by Nick Gammon   Australia  (18,772 posts)  [Biography] bio   Forum Administrator
Date Sun 06 Jul 2003 11:08 PM (UTC)  quote  ]
Message
Strange. So in the initial login you don't get the "1;" but later on you do? Can you confirm that the message is indeed the MOTD one, and that your code in comm.c looks like the stuff I posted further up?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Zeno   USA  (2,867 posts)  [Biography] bio   Moderator
Date Sun 06 Jul 2003 09:58 PM (UTC)  quote  ]
Message
Did the test and got things like
.[m.[1;32m
...[33m

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by Nick Gammon   Australia  (18,772 posts)  [Biography] bio   Forum Administrator
Date Sun 06 Jul 2003 09:01 PM (UTC)  quote  ]
Message
Bold (hilite really) is an ANSI code that says to use the stronger version of a colour. See:

http://www.gammon.com.au/scripts/doc.php?function=ansi

This lists common ANSI codes. You can see from that that bold is 1 and green is 32.

So, .[1;32m (where the dot is Escape) would be bold and green. It could also appear as: .[1m.[32m (ie bold and then green). However the fact that you got .[m.[32m is strange. It suggests the bold is not being sent. I think you would find that the first one (.[m) is just a "reset" to turn everything back to normal. That is, without a number it is assumed to be zero, and zero is reset.

The next test is to do "help motd" with packet debug and see if the code you get is different (ie. is the "1;" there?).

A bit of research shows that the MOTD shows up by simply doing a "help MOTD" like this:


        set_pager_color( AT_PLAIN, ch );
        if ( xIS_SET(ch->act, PLR_RIP) )
          send_rip_screen(ch);
        if ( xIS_SET(ch->act, PLR_ANSI) )
          send_to_pager( "\033[2J", ch );
        else
          send_to_pager( "\014", ch );
        if ( IS_IMMORTAL(ch) )
          do_help( ch, "imotd" );
        if ( ch->level == 50)
          do_help( ch, "amotd" );
        if ( ch->level < 50 && ch->level > 0 )
          do_help( ch, "motd" );
        if ( ch->level == 0 )
          do_help( ch, "nmotd" );
        send_to_pager( "\n\rPress [ENTER] ", ch );
        d->connected = CON_READ_MOTD;


The \033[2J is sending a "page clear" which will blank the page on ANSI emulators. After that it seems to be doing the same thing as HELP MOTD.


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Zeno   USA  (2,867 posts)  [Biography] bio   Moderator
Date Sun 06 Jul 2003 06:44 PM (UTC)  quote  ]
Message
I'm using MUSHclient 3.32, Smaug 1.4a.
Although a question. What exactly is a bold text, is it with Smaug?

Logged on normally, MOTD darker color. Logged off, turned on debug packet, and logged on. I got stuff like .[m.[32m or ...[31m

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by Nick Gammon   Australia  (18,772 posts)  [Biography] bio   Forum Administrator
Date Sun 06 Jul 2003 07:07 AM (UTC)  quote  ]
Message
I don't seem to be able to reproduce this. What version of MUSHclient are you using, and what version of SMAUG?

One possibility seems to be that it remembers what colour it last output, and if no change, doesn't send the same colour again. I see in new_descriptor is a line:

dnew->prevcolor = 0x07;


However it sounds in your case that you have somehow not got the bold version of green - for me dark green is unbold, whereas light green is bold green.

I suggest doing a packet debug. Quit your character, turn it on (edit menu) log on, see the MOTD, do your HELP MOTD, turn off packet debug, and compare the codes output.

I got this (amongst a heap of other stuff):

.[1;32m

The dot was the escape character. That represents bold green.

What we need to know is if you got that code. If you got it, and it isn't bold green on the screen it is a client problem. If you didn't it is a server problem.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Zeno   USA  (2,867 posts)  [Biography] bio   Moderator
Date Sun 06 Jul 2003 05:49 AM (UTC)  quote  ]
Message
MUSHclient of course. :P

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


3,455 views.

This is page 1, subject is 2 pages long: 1 2  [Next page]

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]