mirror of
https://github.com/ldmud/ldmud
synced 2026-08-12 14:26:05 -04:00
Driver hooks that accepted lfun closures before can now handle any type of closure. Also the H_CREATE_* hooks can now handle any type of closure.
33 lines
1.1 KiB
Text
33 lines
1.1 KiB
Text
SYNOPSIS
|
|
#include <sys/driver_hooks.h>
|
|
|
|
set_driver_hook(H_NOTIFY_FAIL, value)
|
|
|
|
<value> being:
|
|
|
|
string <msg>
|
|
string <closure>(string entered_command, object cmd_giver)
|
|
|
|
DESCRIPTION
|
|
Mandatory hook to issue the default message if an entered
|
|
command couldn't be parsed and no notify_fail() command is in
|
|
effect. Hook setting can be a any closure, or a string.
|
|
|
|
If set to a string, it is the message returned to the
|
|
player.
|
|
|
|
If set to a closure, it is called with the command and the
|
|
command giver as arguments, and the result is used as failure
|
|
message. Unbound lambda closures are bound to this_player()
|
|
prior to execution.
|
|
|
|
<cmd_giver> is the object which received the command in the
|
|
first place. It is usually identical with this_player(),
|
|
unless the H_MODIFY_COMMAND hook changed it.
|
|
|
|
HISTORY
|
|
LDMud 3.2.7 added the new 'command_giver' argument.
|
|
|
|
SEE ALSO
|
|
hooks(C), command(H), modify_command(H), modify_command_fname(H),
|
|
send_notify_fail(H)
|