OVERVIEW

Driver-supported hooks

DESCRIPTION

To allow a greater flexibility of the muds, the gamedrivers since 3.2.1 moved several once hardcoded ‘underground’ activities from the driver into the mudlib. This includes for example the differences between compat and native mode.

The hooks are set with the privileged set_driver_hook(E). Some of the hooks are mandatory, some not. Most hooks accept unbound lambda closures as values, some also lfun closures or even strings.

The hooks are identified by an ordinal number, for which symbolic names are defined in /sys/driverhooks.h.

H_MOVE_OBJECT0(H)
H_MOVE_OBJECT1(H)
Mandatory hooks to implement move_object(E).
H_LOAD_UIDS(H)
H_CLONE_UIDS(H)
Mandatory hooks to determine the uid and euid of loaded or cloned objects.
H_CREATE_SUPER(H)
H_CREATE_OB(H)
H_CREATE_CLONE(H)

Optional hooks to initialize an object after creation.

H_CREATE_SUPER(H) is called for blueprints implicitely loaded by inheritance, H_CREATE_OB(H) for explicitely loaded blueprints/objects, and H_CREATE_CLONE(H) for cloned objects.

H_RESET(H)
Optional hook to reset an object.
H_CLEAN_UP(H)
Optional hook to clean up an object.
H_DEFAULT_METHOD(H)
Optional hook to provide default implementation for unresolved calls.
H_DEFAULT_PROMPT(H)
Optional hook for the command prompt. If this hook is not used, the driver will use “> ” as the command prompt.
H_PRINT_PROMPT(H)
Optional hook to print the current command prompt. If this hook is not set, the driver will just print the prompt to the user.
H_COMMAND(H)
Optional hook to parse and execute commands. If this hook is used, it bypasses the normal command parsing done by the driver (including H_MODIFY_COMMAND(H) and H_NOTIFY_FAIL(H) hooks).
H_MODIFY_COMMAND(H)
Optional hook to modify commands (both entered or given by a call to command(E)) before the parser sees them (this includes special commands like ‘status’).
H_MODIFY_COMMAND_FNAME(H)
Mandatory hook specifying the name of the ‘modify_command’ lfun to call for newly entered commands as result of a set_modify_command(E).
H_NOTIFY_FAIL(H)
Mandatory hook to issue the default message if an entered command couldn’t be parsed and no notify_fail(E) command is in effect.
H_SEND_NOTIFY_FAIL(H)
Optional hook to send the notify fail message, regardless of how it was determined, to the player. If the hook is not set, the message is delivered using tell_object(E) internally.
H_NO_IPC_SLOT(H)
Optional hook specifying the message given to logins rejected due to space limitations (MAX_PLAYER).
H_INCLUDE_DIRS(H)
Semi-mandatory hook specifying the directories where <>-type include files are searched (this includes “”-includes not found as specified).
H_AUTO_INCLUDE(H)
Optional hook specifying a string to be included before the source of every compiled LPC object.
H_TELNET_NEG(H)
Optional hook to specifiy how to perform a single telnet negotiation. If not set, most telnet options are rejected (read: only a very minimal negotiation takes place).
H_NOECHO(H)

Optional hook to specifiy how to perform the telnet actions to switch the echo mode (used for e.g. passwords with input_to(E)). If not set, a default handling is performed.

IMPORTANT: If this hook is used, the control of all telnet negotiation is transferred to the mudlib (you must combine it with H_TELNET_NEG(H) to conform to the telnet protocol).

H_ERQ_STOP(H)
Optional hook to notify the mudlib about the termination of the erq demon.
H_MSG_DISCARDED(H)
Optional hook to specify a message or take other measures when a message had to be discarded.

HISTORY