Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ MUSHclient
➜ Bug reports
➜ World.Execute & Namespace confusion.
World.Execute & Namespace confusion.
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Magnum
Canada (580 posts) Bio
|
Date
| Tue 04 Nov 2003 09:51 AM (UTC) Amended on Tue 04 Nov 2003 09:56 AM (UTC) by Magnum
|
Message
|
Quote: ------ world.Execute processing starts here ------>
c. The "command execution depth" is incremented by one. If it exceeds the limit (currently 20) the execution terminates with an error status (which can be detected in a script).
d. The start of the command is checked for the "scripting prefix" - default is the "/" character (this is only done if scripting is active). If it is detected the result of the line(s) are passed to the script engine for execution. Then the "command execution depth" is decremented again, and processing is complete.
***
e. Otherwise the command is now broken into individual lines at the command-stack character, excepting that two command stack characters in a row are replaced with a single command stack character. For example, if the command stack character is ";" and assuming \n represents a new line, this might happen:
command: south ; east ; say I go;; I eat; drink \n sigh
replacement: south \n east \n say I go; I eat\n drink \n sigh
Note that you can put multiple lines into a command by simply using the newline character (eg. typing Ctrl+Enter). Using the command stack character is simply another way of achieving the same result.
f. The resulting command (with command-stack characters replaced by newlines) is then broken into individual lines. Note that there is always considered to be at least one line, so entering a blank command will result in one newline being sent to the MUD. Each line is then processed in the following way ...
----- Start of processing for each individual command line ----->
g. Each plugin (if any) is given a chance to evaluate the command line ("OnPluginCommand" script subroutine). If it chooses to reject that line, then processing for that line terminates.
h. If the line is totally empty a blank line is sent to the world.
i. Otherwise, if the speedwalk prefix applies to this line, then the speedwalk is evaluated and sent to the world.
j. If no speedwalk prefix was detected the line is scanned for global aliases. If one matches the action specified is done (ie. the "send" text is sent to the "send to" location). If "keep evaluating" was set for that alias then further aliases will be scanned (for the same text, not the output from the previous alias).
k. This process is repeated for the aliases in all plugins.
l. If no alias was found at all, then the text is sent to the world "as is" - note this is the normal case where something you type is just an ordinary command for the MUD.
m. If one or more aliases were found, the alias scripts are now executed. Note that the scripts are executed after the alias "send" text has been sent.
<----- End of processing for each individual command line -----
!!!
*** Internally, Mushclient now references the main world's namespace.
!!! If World.Execute was called from a script, control now returns to the script file. Uhm, Oops, Internally, Mushclient still references the main world's namespace. IE: Plugin VATT's are no longer accessible in the remaining script to be executed, if the script was within a plugin.
...at least, this is my guess. |
Get my plugins here: http://www.magnumsworld.com/muds/
Constantly proving I don't know what I am doing...
Magnum. | Top |
|
Posted by
| Nick Gammon
Australia (23,158 posts) Bio
Forum Administrator |
Date
| Reply #1 on Tue 04 Nov 2003 08:31 PM (UTC) |
Message
| Added as bug #500.
This sounds related to the recent posts about problems using world.execute.
It is by design that the execute itself operates in the world namespace, not the plugin namespace, but I gather you are reporting that the plugin namespace is not re-installed? That sounds like a bug. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Magnum
Canada (580 posts) Bio
|
Date
| Reply #2 on Wed 05 Nov 2003 04:36 AM (UTC) |
Message
| Correct.
For example, a malicious plugin author could issue a World.Execute to call an alias which omit's itself from output to lower if's profile of something secret going on.
After the World.Execute, the rest of the plugin script's routine is now running in the main world's "space", so it could do things like fetch a password (as talked about in this thread: http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=3198).
|
Get my plugins here: http://www.magnumsworld.com/muds/
Constantly proving I don't know what I am doing...
Magnum. | 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.
15,924 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top