ldmud/doc/hook/command
Lars f84a2fc7a0 Initial import from PRCS.
git-svn-id: svn://svn.bearnip.com/ldmud/trunk@4 56160b6e-f8f8-0310-bd54-bccebfe6a2f2
2005-06-21 01:46:13 +00:00

33 lines
1.2 KiB
Text

SYNOPSIS
#include <sys/driver_hooks.h>
set_driver_hook(H_COMMAND, value)
<value> being:
int <closure>(string command, object command_giver)
int <name>(string command, object command_giver)
DESCRIPTION
Optional hook to parse and execute commands. If this hook is
used, it bypasses the normal command parsing done by the
driver (including the MODIFY_COMMAND and NOTIFY_FAIL hooks).
The hook is called with two parameters: the command received
from the living (interactive user or NPC), and the living
object (the 'command giver') itself. The hook has to return
non-0 if the command was found and executed, and 0 otherwise.
At the time the hook is called, query_command() returns the
command string and this_player() returns the living object.
query_verb() and query_notify_fail() return 0.
If the hook is a string, it is the name of an lfun in the
command giver; if the hook is a lambda closure, it is bound to
the command giver before the call.
HISTORY
SEE ALSO
hooks(C), modify_command(H), modify_command_fname(H), notify_fail(H),
send_notify_fail(H)