|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Fri Jan 09, 2009 10:12 pm
[Feature] Enforce valid names. |
Check, after someone's entered a name for, say, an alias, window or class, and make sure that it's valid before creating it. If a script command tries to create an invalid class name, it should generate a script error. If someone tries to create an invalid class name with the UI, an error box like the "two aliases with that name" box should pop up.
I say this because it's very common for people to have invalid alias, window or class names containing hyphens, starting with a number, and so on. This causes all kinds of problems, but they never know why - CMUD should tell them. |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Fri Jan 09, 2009 11:43 pm |
Yep, that's been on the to-do list for a while. I tried to do this at one point in zMUD and it was a mess. Because there are so many different ways to create something: via the GUI, via the command line, via a text/XML import, etc. It might be something more suited to the Compatibility report rather than something that is enforced when you are trying to type into a box or something. For example, I wouldn't want to prevent you from importing an XML script just because an alias name was improper.
|
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Sat Jan 10, 2009 1:28 am |
I dunno, I think you would want to stop that. As long as the import error gave a decent description of what was wrong and where, they'd be able to fix it. Since importing a script with improperly-named settings can cause all kinds of weird problems, you'd want to protect people from that.
|
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Sat Jan 10, 2009 7:23 am |
Your call ultimately Zugg but I've got to go with Fang on this one. I know the setting can be created in multiple interfaces but I'm inclined to think you have only have a handful of routines that does the actual creation, if not in memory then certainly at the DB level. Even it's a simple call out method a generic name validator, I still think you'd want to catch it and throw an exception.
|
|
_________________ Asati di tempari! |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Mon Jan 12, 2009 6:12 pm |
Yeah, but it's usually running in another thread where you can't just throw an exception. Also, throwing an exception during an import would prevent the entire import from completing. It gets complicated because you'd really want to to "queue" the error, continue with the import, and then just report a list of settings that had trouble importing when it's finished, passing the list of settings that had errors back to the main thread. In other words, after importing it would bring up some sort of compatibility-like report showing the problems.
Flagging this problem in the GUI is easier, and as I said, that is already on the to-do list. |
|
|
|
|
|