Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Fri May 02, 2008 4:32 am   

[2.23] HTML Logging
 
The colors were white fore and blue back. It logged this.

Code:
<SPAN style="color:white;background-color:lue;">


If you notice it has lue instead of blue. Razz
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Fri May 02, 2008 5:21 am   
 
Now it's not logging the color at all.

Code:
<hr>---<hr><BR/>
<strong>Afflictions Reset<strong><BR/>
<hr>---<hr><BR/>
<strong>Defenses Reset<strong><BR/>
<hr>---<hr><BR/>
<strong>Pipes Reset<strong><BR/>
<hr>---<hr><BR/>


Those should all be white fore and blue back. They all have tags like this:

Code:
<color white blue><strong>Afflictions Reset</strong></color>


However, it is only logging opening strong tags.

By the way, xhtml is what these should really be if you want CMUD to be Web standards compliant in the future, which I would think since you are starting the My Muds project, and having this markup in the logs players can now just post their logs on the Web in full color as well. Consider this, you can now create a quick script to finish the rest of the markup tags to create the full page from a log when you load the client add in all the header stuff, start the log, then when you disconnect or exit add the closing body, html and so on. This of course is just what I did, although I can't stand how CMUD writes to a file without being able to specify the file name.

Anyway, strong tags should be closed. All tags should be lowercase, because in XHTML they are lowercase. This part, "<hr>---<hr>" should only be this "<hr>" because the Web page ends up having horizontal rules and the "---" on it.

http://www.webreference.com/xml/reference/xhtml.html


  • Close all tags: Omitting </p> is not valid anymore.
  • Change all tags to lowercase: <P> becomes <p>.
  • Correctly specify empty elements: <hr> becomes <hr />.
  • Quote all attribute values: <p align="right">.
  • Always add attribute values: <hr noshade="noshade">.
  • Always use &amp; for & in attributes: <a href="?a=1&amp;b=2">.



Here is my log file now. I just loaded a session then closed it.

Code:

<!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Avalon0502080035</title>
</head>
<body>
<hr>---<hr><BR/>
<strong>Afflictions Reset<strong><BR/>
<hr>---<hr><BR/>
<strong>Defenses Reset<strong><BR/>
<hr>---<hr><BR/>
<strong>Pipes Reset<strong><BR/>
<hr>---<hr><BR/>
<strong>TodoList Reset<strong><BR/>
<hr>---<hr><BR/>
<strong>Herbs and Potions Reset<strong><BR/>
<hr>---<hr><BR/>
<b>This is bold white with red background<b><BR/>
</body>
</html>


If you notice none of the colors are logging now. Everything with strong I have built into the script to do <color white blue><strong> and the last one I did a #show from the command line but the <color white red><b> ended up just with two opening bold tags. :(


Last edited by oldguy2 on Fri May 02, 2008 5:42 am; edited 1 time in total
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Fri May 02, 2008 5:35 am   
 
Keep in mind that this is the first version to have the HTML logging. It is very crude at this point. I thought people would like to have something basic to play with. Sorry if it wasn't good enough.

But if you want to post useful bug reports about this, then I need to see the original #debugfile from the MUD that shows the exact text being displayed. That is the only way I can replay it and reproduce any problems.

I'm not very concerned about XHTML because all CMUD is doing right now is converting color values. All other MXP tags, such as IMG, SEND, etc, are passed directly to the log file, and these tags don't even comply with normal HTML rules. So I never had any intent of providing a completely standard HTML or XHTML output...MXP makes that impossible. The idea was to produce something basic enough for people to start using. I agree that there are probably bugs, and with more details I should be able to fix the bugs in the future.
Quote:
I can't stand how CMUD writes to a file without being able to specify the file name.

Not sure what you are talking about here. The #LOG command does take a filename. So does the #FILE command.

The reason CMUD doesn't write the opening and closing tags is because you can toggle logging off and on using the #LOG command, so there really isn't any way for CMUD to know when you are done logging. Also, by default the #LOG command *appends* to an existing file, to allow you to easily log multiple sessions to the same file. Obviously if CMUD wrote the headers and footers the file would be messed up when you append another session. It's very easy for anyone to add the header/footer, or to just use an Include directive. There is no need for CMUD to write that information to the file itself.
Quote:
Close all tags: Omitting </p> is not valid anymore.

CMUD does close all tags. CMUD doesn't use the </p> tag, so I'm not sure where you are getting that from. Again, CMUD passes the MXP from the MUD into the log file, and MXP is *not* HTML or XHTML, so if the MUD is using </p> then there isn't anything CMUD can do about that. There is no way to convert full MXP into HTML/XHTML.
Quote:
Change all tags to lowercase: <P> becomes <p>.

I'll change the SPAN tags that CMUD is generating to lowercase, but again, any MXP sent from the MUD is going to get logged without that conversion.
Quote:
Correctly specify empty elements: <hr> becomes <hr />.

I already send <BR/> instead of <BR>, so I am already doing that. But again, <hr> is an MXP tag, and not XHTML, so if the MUD sends <hr>, then that is what will be in the log file.
Quote:
Quote all attribute values

MXP doesn't require quoted attribute values.

etc. etc. I know I sound like a broken record here, but you seem to have a basic misunderstanding of what the MXP/HTML logger is doing. It tries to convert ANSI color codes to HTML. It attempts to convert the MXP COLOR tag into an HTML SPAN syntax using styles. That's it. All MXP is passed to the log file because some people want to manipulate that data. Web browsers will ignore unknown tags, and with the proper DOCTYPE (which I am still trying to determine), the existing log file can be displayed in browsers.

It is possible in a future version that I will add an option to strip the unwanted MXP tags from the output file. In any case, I am well aware of the XHTML standard. But that's not what CMUD is using. CMUD is using MXP, which is different.


Last edited by Zugg on Fri May 02, 2008 6:40 am; edited 1 time in total
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Fri May 02, 2008 5:55 am   
 
I know Cmud is using MXP.

Here is what the page I just created above looks like.

http://jhees.110mb.com/Avalon0502080035.html

That's nothing like what it should look like.



I guess I seriously don't understand. By the way did your post get mangled or something? It's all messed up and hard to read.

You said:

Quote:
CMUD does close all tags. CMUD doesn't use the

tag, so I'm not sure where you are getting that from. Again, CMUD passes the MXP from the MUD into the log file, and MXP is *not* HTML or XHTML, so if the MUD is using

then there isn't anything CMUD can do about that.


The mxp in the script is this:

Code:
#mxp {<hr>}
#mxp {<color white blue><strong>Herbs and Potions Reset</strong></color>}
#mxp {<hr>}


In the log it ends up as:

Code:
<hr>---<hr><BR/>
<strong>Herbs and Potions Reset<strong><BR/>
<hr>---<hr><BR/>


I'm not saying you don't know about XHTML. Geesh. WTF I'm saying that it isn't closing the tags right and not logging some of them correctly. I wasn't trying to say you don't know what you are doing. If it's not a bug then I will find some stupid ass way to get around it all I guess.
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Fri May 02, 2008 6:13 am   
 
You know Zugg, I try to get everyone I know to buy CMUD. People bitch about it and I support it. However, this crap pisses me off.

Quote:
The reason CMUD doesn't write the opening and closing tags is because you can toggle logging off and on using the #LOG command, so there really isn't any way for CMUD to know when you are done logging. Also, by default the #LOG command *appends* to an existing file, to allow you to easily log multiple sessions to the same file. Obviously if CMUD wrote the headers and footers the file would be messed up when you append another session. It's very easy for anyone to add the header/footer, or to just use an Include directive. There is no need for CMUD to write that information to the file itself.


Quote:
t is possible in a future version that I will add an option to strip the unwanted MXP tags from the output file. In any case, I am well aware of the XHTML standard. But that's not what CMUD is using. CMUD is using MXP, which is different.


Look at my post. Obviously I know all of this. Look at the screen shot! You can see it happening. Look at the HTML code. I may not be the greatest zscript coder but I was just trying to say that <hr> should not turn into <hr>---<hr> and all the god damn color tags vanished.

Where did I ever say CMUD should use XHTML? I said for the tags in the LOG. Are you not logging HTML tags in the log?

Edit: I know what is going on here. I also know if you are going to make this log HTML code into the Log file why not have it do it correctly the first time? Other people may not give a shit about this little feature, but this part actually interested me. Instead of having to write a program to search the entire text file and change all the Ansi and Mxp to HTML tags, CMUD can now do it directly which is great. All I had to do was add in the DOCTYPE, header, html, and body tags. No big deal! However, it isn't doing it correctly, and therefore, I thought it was a bug. I am sorry if my post offended you, but you don't have to be condescending to me and act like I am some kind of idiot when I do understand what is going on and do know what I am talking about. I also wasn't saying CMUD should use all of those rules of XHTML. I just pointed them out as a general as an example. Of course you aren't going to need them all.


Last edited by oldguy2 on Fri May 02, 2008 6:59 am; edited 1 time in total
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Fri May 02, 2008 6:53 am   
 
Sorry I misunderstood the tone of your message. From the first message it sounded like you were complaining that CMUD wasn't making XHTML compliant files.

I will replay the #MXP commands that you mentioned on Monday to see if I can reproduce it. Honestly, this first version wasn't tested much with MXP. The main purpose of this first iteration was to convert ANSI color codes into HTML output. I did some basic testing of the MXP COLOR tag, but not with anything nested, like the STRONG tag that you mentioned.

So yes, obviously this needs more testing. As I said, I thought some people would want to play with the basic version, especially for converting ANSI color logs into HTML logs.

Maybe I shouldn't have released this feature at all. But that's just the way I have always done stuff. I'd rather release features incrementally and improve them over time. Some people would rather just wait 3 years and release something when it's perfect. I'm not like that. I'd rather release something and then improve it.

And for dealing with the vast majority of MUDs that only use ANSI color, the current HTML log works very well. It's just the MXP conversion that needs work. The difficulty is that CMUD doesn't store the original data from the MUD. It tries to recreate the tags from the data on the screen. If you copy/paste your screen data, you will see that the "---" characters are put into the HR line as placeholders for the graphical line, and obviously that is messing up the log output.

I'll add this to the bug list, but let's both try not to get too upset about this. Let's take it in the spirit that it was intended...as a useful feature for ANSI MUDs. It's better than nothing. But I'll try not to react to strongly to your posts...release weeks/days are just very stressful around here.
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Fri May 02, 2008 7:38 am   
 
I understand it gets stressful. I'm not mad.

Quote:
From the first message it sounded like you were complaining that CMUD wasn't making XHTML compliant files.


I was saying since CMUD is the future client, why not make sure the HTML you use is XHTML compliant to start off with so you don't have to change anything in the future.

Quote:
Maybe I shouldn't have released this feature at all. But that's just the way I have always done stuff. I'd rather release features incrementally and improve them over time. Some people would rather just wait 3 years and release something when it's perfect. I'm not like that. I'd rather release something and then improve it.


Why not? I was looking forward to this feature as I said above in my edit. However, I use all MXP in my scripting and not ANSI. The screenshot and log above I wasn't even connected to a MUD. MXP is more powerful than ANSI, and seems to me it would be easier to convert to HTML tags.

Quote:
And for dealing with the vast majority of MUDs that only use ANSI color, the current HTML log works very well. It's just the MXP conversion that needs work. The difficulty is that CMUD doesn't store the original data from the MUD. It tries to recreate the tags from the data on the screen. If you copy/paste your screen data, you will see that the "---" characters are put into the HR line as placeholders for the graphical line, and obviously that is messing up the log output.


I'm sure it does, but what about all the MXP I use to color things? I see why it is showing the --- now but I don't understand why it is sticking two horizontal rule tags on either side of it.

Anyway, I was trying to be helpful. I know I am not the only one who uses MXP to do all of their coloring. I think FANG does too. I'm sure many others do as well. I wanted this feature, and it makes it very easy to share colored log files over the Web. You don't even need a converter any more to search the text files and convert everything to HTML, which is great.
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Fri May 02, 2008 9:46 am   
 
oldguy2 wrote:
I know I am not the only one who uses MXP to do all of their coloring. I think FANG does too.

You're right, OLDGUY2, and I'm quite excited to see this working. I just haven't had time to test it since, y'know, last night.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Fri May 02, 2008 10:50 am   
 
Okay here is what is happening Zugg.

I created a little script to go through and change all the horizontal rule problems and convert my log to html.

If I don't use bold or strong along with the "<color>" MXP tags, then it will record the colors fine. If I do use them, then it won't log the colors at all. However, it strips the first letter of the background color every time. I thought it might have been just blue specifically since thats the only color I had used earlier, but it isn't it is every occurrence.

Code:
<span style="color:white;background-color:ed;">This is white on red</span><br/>
<span style="color:white;background-color:reen;">This is white on green</span><br/>
<span style="color:white;background-color:urple;">This is white on purple</span><br/>
<span style="color:white;background-color:lue;">This is white on blue</span><br/>
<span style="color:white;background-color:range;">This is white on orange</span><br/>


It has no problem with fore color though. It's just if you use a back color or add in to bold the text.
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Fri May 02, 2008 10:52 am   
 
Fang Xianfu wrote:
oldguy2 wrote:
I know I am not the only one who uses MXP to do all of their coloring. I think FANG does too.

You're right, OLDGUY2, and I'm quite excited to see this working. I just haven't had time to test it since, y'know, last night.


lol I didn't mean to shout your name there. I thought it was normally in all caps but now I see it isn't so sorry.
Reply with quote
Asilient_1
Apprentice


Joined: 26 Apr 2007
Posts: 113

PostPosted: Fri May 02, 2008 8:01 pm   
 
Logged commands don't seem to be adding in linebreaks after them, by the way. Other than that, what little playing around I have done it seems fine.
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Fri May 02, 2008 9:53 pm   
 
Is that while connected? They log fine for me.

Code:
<span style="color:#FFFF00;">command</span><br />
This is a test.<br />
<span style="color:#FFFF00;">command</span><br />
This is a test.<br />
<span style="color:#FFFF00;">command</span><br />
This is a test.<br />
<span style="color:#FFFF00;">command</span><br />
Reply with quote
Asilient_1
Apprentice


Joined: 26 Apr 2007
Posts: 113

PostPosted: Fri May 02, 2008 10:39 pm   
 
Here's what I mean:

Code:
smoke pipe163417
<SPAN style="color:#FFFF00;">You feel an aura of rebounding surround you.</SPAN><BR/>
curious
<SPAN style="color:#00B300;">H:5448 M:5172 E:26035 W:24720</SPAN><SPAN style="color:#FF0000;"> B:100%</SPAN> XP:68% [csdb eb lr]<SPAN style="color:#00FFFF;"> </SPAN><SPAN style="color:#FFFFFF;"><<21:36:16:468>><SPAN style="color:#00FFFF;"> </SPAN></SPAN><SPAN style="color:#000080;">M-10(-0.17%)</SPAN><BR/>


Results in..

Quote:
smoke pipe163417 You feel an aura of rebounding surround you.
curious H:5448 M:5172 E:26035 W:24720 B:100% XP:68% [csdb eb lr] <<21:36:16:468>> M-10(-0.17%)


When it should be:

Quote:
smoke pipe163417
You feel an aura of rebounding surround you.
curious
H:5448 M:5172 E:26035 W:24720 B:100% XP:68% [csdb eb lr] <<21:36:16:468>> M-10(-0.17%)


EDIT: To clarify, this is with command echos off, log commands on.

EDIT2: Helps if you quote the right HTML for the log quotes. >.<
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Fri May 02, 2008 11:15 pm   
 
Right. They should be showing up like mine did above with "command". You have all the right stuff checked in logging options?
Reply with quote
Asilient_1
Apprentice


Joined: 26 Apr 2007
Posts: 113

PostPosted: Sat May 03, 2008 12:23 am   
 
Yeah, the only thing I'm not logging is timestamps, basically.
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Sat May 03, 2008 12:56 pm   
 
Ok I have echo commands turned on. Maybe that's the difference.
Reply with quote
Asilient_1
Apprentice


Joined: 26 Apr 2007
Posts: 113

PostPosted: Mon May 05, 2008 12:06 am   
 
It appears that it's also logging gray/grey (%ansi(grey)) as black for the HTML code (#000000) whereas it should be: #C0C0C0
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Tue May 06, 2008 10:18 pm   
 
OK, I fixed the problem with the command logging not having a BR at the end.

I also fixed the HR tag, the problem with the missing first letter of the background color, and the nested STRONG within the COLOR tag problems that are reported here. I also fixed unreported bugs where it wasn't closing MXP tags properly in the HTML output, and wasn't handling the COLOR tag when using named arguments (like fore=$RRGGBB).

These fixes are in v2.24. I still consider HTML logging a "crude" feature, even in 2.24. There might still be some MXP cases that don't work properly. But I've done a lot more testing, and the ANSI -> HTML seems to be working great now, and basic MXP color handling is working. Over time I will improve the conversion of other MXP tags into proper HTML.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net