MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame^] | 1 | SYNOPSIS |
| 2 | #include <sys/driver_hooks.h> |
| 3 | |
| 4 | set_driver_hook(H_NOTIFY_FAIL, value) |
| 5 | |
| 6 | <value> being: |
| 7 | |
| 8 | string <msg> |
| 9 | string <closure>(string entered_command, object cmd_giver) |
| 10 | |
| 11 | DESCRIPTION |
| 12 | Mandatory hook to issue the default message if an entered |
| 13 | command couldn't be parsed and no notify_fail() command is in |
| 14 | effect. Hook setting can be a any closure, or a string. |
| 15 | |
| 16 | If set to a string, it is the message returned to the |
| 17 | player. |
| 18 | |
| 19 | If set to a closure, it is called with the command and the |
| 20 | command giver as arguments, and the result is used as failure |
| 21 | message. Lambda closures are bound to this_player() prior to |
| 22 | execution. |
| 23 | |
| 24 | <cmd_giver> is the object which received the command in the |
| 25 | first place. It is usually identical with this_player(), |
| 26 | unless the H_MODIFY_COMMAND hook changed it. |
| 27 | |
| 28 | HISTORY |
| 29 | LDMud 3.2.7 added the new 'command_giver' argument. |
| 30 | |
| 31 | SEE ALSO |
| 32 | hooks(C), command(H), modify_command(H), modify_command_fname(H), |
| 33 | send_notify_fail(H) |