blob: 0a6f67b643ebd3431c0f567e24c86a965173db22 [file] [log] [blame]
MG Mud User88f12472016-06-24 23:31:02 +02001SYNOPSIS
Zesstra715ec202025-07-09 22:18:31 +02002 #include <driver_hook.h>
3
MG Mud User88f12472016-06-24 23:31:02 +02004 void set_driver_hook(int what, closure arg)
5 void set_driver_hook(int what, string arg)
Zesstra715ec202025-07-09 22:18:31 +02006 void set_driver_hook(int what, string *arg)
MG Mud User88f12472016-06-24 23:31:02 +02007
8DESCRIPTION
9 This privileged efun sets the driver hook 'what' (values are
Zesstra715ec202025-07-09 22:18:31 +020010 defined in <driver_hook.h>) to 'arg'.
MG Mud User88f12472016-06-24 23:31:02 +020011 The exact meanings and types of 'arg' depend of the hook set.
12 To remove a hook, set 'arg' to 0.
13
14 These hooks exist:
15
16 H_MOVE_OBJECT0
17 H_MOVE_OBJECT1
18 arg: unbound lambda
19 Mandatory hooks implementing the move_object() efun.
20
21 H_LOAD_UIDS
22 H_CLONE_UIDS
23 arg: unbound lambda or lfun closure
24 Mandatory hooks to determine the (e)uid of new objects.
25
26 H_CREATE_SUPER
27 H_CREATE_OB
28 H_CREATE_CLONE
29 H_RESET
30 H_CLEAN_UP
31 arg: lambda closure (H_CLEAN_UP also accepts a lfun
32 closure), function name.
33 Optional hooks for creation/reset/clean up-actions.
34
Zesstra715ec202025-07-09 22:18:31 +020035 H_CREATE_LWOBJECT
36 H_CREATE_LWOBJECT_COPY
37 H_CREATE_LWOBJECT_RESTORE
38 arg: lambda closure, function name.
39 Optional hooks for creation of lightweight objects
40 with new_lwobject(), copy()/deep_copy() resp.
41 restore_value()/restore_object().
42
MG Mud User88f12472016-06-24 23:31:02 +020043 H_DEFAULT_METHOD
44 arg: lambda closure, lfun closure, function name.
45 Optional hook for default method implementation.
46
47 H_DEFAULT_PROMPT
48 arg: lambda closure, lfun closure, prompt string.
49 Optional hook for the default command prompt.
50
51 H_PRINT_PROMPT
52 arg: lambda closure, lfun closure, function name.
53 Optional hook to print the command prompt.
54
55 H_MODIFY_COMMAND
56 arg: lambda closure, lfun closure, function name, mapping
57 Optional hook for modifying player commands before the
58 parser sees them.
59
60 H_NOTIFY_FAIL
61 arg: lambda closure, lfun closure, string.
62 Mandatory hook to generate the default message if an entered
63 command couldn't be parsed and no notify_fail() command is
64 in effect.
65
66 H_SEND_NOTIFY_FAIL
67 arg: lambda closure, lfun closure, string.
68 Optional hook to deliver the notify fail message from a failed
69 command.
70
71 H_NO_IPC_SLOT
72 arg: string.
73 Optional hook specifying the 'sorry' messages if logins are
74 rejected due to fullness of the mud.
75
76 H_INCLUDE_DIRS
77 arg: lambda closure, lfun closure, string array.
78 Semi-mandatory hook specifying the directories where <>-type
79 include files are searched.
80
81 H_AUTO_INCLUDE
82 arg: lambda closure, lfun closure, string
83 Optional hook to specify a string to be included before the
84 source of every compiled LPC object.
85
Zesstra715ec202025-07-09 22:18:31 +020086 H_AUTO_INCLUDE_EXPRESSION
87 H_AUTO_INCLUDE_BLOCK
88 arg: closure, string
89 Optional hook specifying a string to be prepended before
90 the string of a compile_string() call.
91
92 H_FILE_ENCODING
93 arg: lambda closure, lfun closure, string
94 Optonal hook specifying the name of the encoding to be used
95 for decoding a file (default: "ascii").
96
MG Mud User88f12472016-06-24 23:31:02 +020097 H_TELNET_NEG
98 arg: lambda closure, lfun closure, string.
99 Optional hook to specifiy how to perform a single telnet
100 negotiation.
101
102 H_NOECHO
103 arg: lambda closure, lfun closure, string.
104 Optional hook to specifiy how to perform the telnet actions
105 to switch the echo mode (used for e.g. password input_to()s).
106
107 H_ERQ_STOP
108 arg: lambda closure, lfun closure.
109 Optional hook to notify the mudlib about the termination of
110 the erq demon.
111
Zesstra715ec202025-07-09 22:18:31 +0200112 H_MSG_DISCARDED
113 arg: lambda closure, lfun closure, string
114 Optional hook to specify a message or take other measures
115 when a message had to be discarded.
116
MG Mud User88f12472016-06-24 23:31:02 +0200117 See hooks(C) for a detailed discussion.
118
119HISTORY
120 Introduced in 3.2.1@1 as efun309(), renamed to
Zesstra715ec202025-07-09 22:18:31 +0200121 set_driver_hook() in 3.2.1@13.
MG Mud User88f12472016-06-24 23:31:02 +0200122
123SEE ALSO
124 hooks(C)