MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 1 | SYNOPSIS |
Zesstra | d59c389 | 2019-11-28 20:53:39 +0100 | [diff] [blame] | 2 | int execute_command(string command, object origin, object player) |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 3 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 4 | DESCRIPTION |
| 5 | Low-level access to the command parser: take the <command>, parse it |
| 6 | into verb and argument and call the appropriate action added to |
| 7 | <origin> (read: <origin> is the object 'issuing' the command). |
| 8 | For the execution of the function(s), this_player() is set to |
| 9 | player. The function also sets results of query_command() and |
| 10 | query_verb() to match the given <command>. |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 11 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 12 | The result is non-0 if the command was found and execute, and 0 |
| 13 | otherwise. |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 14 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 15 | The efun raises a privilege violation ("execute_command", |
| 16 | this_object(), origin, command). |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 17 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 18 | Note that this function does not use the H_MODIFY_COMMAND |
| 19 | and H_NOTIFY_FAIL hooks; the notify_fail() efun is can be used, |
| 20 | but must be evaluated by the caller. |
| 21 | |
| 22 | HISTORY |
| 23 | Introduced in LDMud 3.2.7. |
| 24 | |
| 25 | SEE ALSO |
| 26 | hooks(C), match_command(E), command(E), notify_fail(E), |
| 27 | command_stack(E) |