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

Post new topic  Reply to topic     Home » Forums » Zugg's Blog
Zugg
MASTER


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

PostPosted: Tue Oct 03, 2006 10:54 pm   

CMUD 1.09 Development Blog
 
Time for a new CMUD blog entry!

I *hope* that I'm finally done messing around with Local Variables. Today I fixed a very obscure problem with the new %exp stuff. As I mentioned in the main forum, the results of expressions are now stored on the stack and can be accessed via the new %exp function. However, there was still one obscure case where the exp values could mess up other local variables. I think I've got those issues fixed now.

The last thing related to local variables that I needed to fix was to allow local variables to be used in the %regex and %match functions, and to support local named-patterns in trigger patterns.

Both of these things required some tricks in the parser to deal with local variables and script arguments. The %regex and %match functions were the easiest, and they seem to work great now. So, you can do this:
Code:
#ALIAS test($person) {
#if (%regex($person,"(.*) \(from (.*)\)",$one,$two)) {
  #SHOW One: $one
  #SHOW Two: $two
  }
}

This will be a big help and will prevent you from getting a bunch of unneeded variables created from using %regex and %match.

For making named-patterns in normal trigger patterns it was a bit tricker. I had to get into the actual trigger pattern parser and detect the proper local variable syntax and create arguments "on the fly". But after several hours of work, I think I've gotten it working. I'm using the syntax that was discussed a few months ago in the beta forum. Here is an example:
Code:
#TRIGGER {abc($arg:%d)def} {
  #SHOW fired: $arg
  }

So, to name a sub-pattern you put $name: right after the ( that starts the saved subpattern.

These should hopefully be some of the few last remaining issues that require a lot of parser/compiler changes. I want to start minimizing changes to the parser so that I can improve the stability in time for the announcement to existing zMUD users.

I will probably try to release 1.09 at the end of this week so that people can play with this and find out if I've messed up any other compatibility in the parser.
Reply with quote
Zugg
MASTER


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

PostPosted: Thu Oct 05, 2006 11:39 pm   
 
Today I got the code for the help system written. Thanks to the existing zApp DocView application, I was able to convert it into Delphi and get it working within just a few hours. It would have taken me a lot longer if I didn't have the existing zApp code to use as a sample.

Tomorrow I'll start porting the zMUD command and function articles over to CMUD and start writing some of the other documentation. I'll probably release 1.09 on Friday night or Saturday so that people can test all of this.
Reply with quote
Zugg
MASTER


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

PostPosted: Sun Oct 08, 2006 3:04 am   
 
I spent today fixing various crash bugs and getting the 1.09 release out. I'll be spending most of next week writing the new help topics for various important features in CMUD. Using the Get Updates button in the help system, you should be able to get these new topics as I add them without needing a new version of CMUD. At least that's the idea.

I ran into one real headache today. I was testing the system that lets you click on links within the help topics. If the link points to another topic, then the new topic is loaded. If not, the URL is loaded into the web browser (for external links). I was testing this on the %additem help topic by clicking on the %delitem link in the Related Topics line. And it kept opening it in the web browser instead of going to the help topic internally.

The links for functions are things like cmud_%delitem and I thought maybe the % character was causing the problem. It was doing a SQL lookup on that and not finding a match. Since % is used for wildcards in the LIKE function, I thought maybe it was an SQLite or ZeosLib database issue. So I changed the links to use $ instead of %. Still didn't work. Then I changed it to + instead of % and it STILL didn't work. OK, I was really starting to get frustrated with this.

Guess what...the %delitem topic wasn't even in the database! The problem was that when I converted the zMUD help topics to CMUD, the date-modified fields didn't get updated. So the only help topics that were being downloaded were the ones that I had recently modified. I fixed this problem so that CMUD properly downloads the correct updates and then the %delitem topic appeared and the link worked fine with % in it. So it was all just a wild-goose-chase.

I also dealt with some annoying database issues in the Settings Editor. One common crash is related to the filtered dataset. Imagine that you have entered text into the search field to filter the tree view to display matching settings. Now you edit the name of one of these settings so that it no longer matches the search text and click Save. Well, the setting disappears from the tree view (as it should...it no longer matches), but the edit panel on the right side of the window wasn't being updated to display the correct setting data. Also, creating a New setting while the view was filtered wasn't working since the new setting was blank and also didn't match the filter, and so it couldn't be displayed by the tree view. Sometimes this database stuff is really annoying. But I think it's working better now.

That's it for today. I hope the new version continues to be an improvement.
Reply with quote
slicertool
Magician


Joined: 09 Oct 2003
Posts: 459
Location: USA

PostPosted: Mon Oct 09, 2006 3:13 am   
 
well, for inserting hex characters into a URL such as the hex DE (as in _de_litem) you'd prefix it with a percent sign. ie, when you want a space added in there, you do %20.

So, with %de you might have been adding ascii character 222 which looks like a bull's face turned on its side.
_________________
Ichthus on SWmud: http://www.swmud.org/
Reply with quote
Zugg
MASTER


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

PostPosted: Mon Oct 09, 2006 4:49 pm   
 
Yep, that's partially to blame. The problem is that the GotoHelp routine in CMUD takes the name of a help topic to display. Internally, CMUD does stuff like GotoHelp('cmud_%delitem') to display a help topic. But as you mentioned, the links within the HTML body of other help topics are URL encoded, so CMUD ends up getting GotoHelp('cmud_%25delitem') when you click on a link.

So, the GotoHelp routine needs to perform URL decoding for the second example to work. But if it *always* performs the URL decoding, then the first example won't work because %de is a valid hex valid. This causes quite a problem. There is no way to tell for sure if something is URL encoded or not. So CMUD actually kludges this. Since % and # are the only special characters used in the help topic index values, the GotoHelp routine will only decode %25 and %23 values.

Sometime in the future I'll think more about how to fix this for real. Only converting %xx where xx starts with a numeric digit might also help, since this handles most of the special characters.

Special characters also ended up being an issue in downloading some help topics. The download data is in XML format. But there were some non-standard quote characters in some help topics added by the original ForeHelp system that created the original zMUD help topics. These special characters caused XML decoding errors when I tried to download them. So I had to fix that too.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » Zugg's Blog 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 on Wolfpaw.net