blob: b7d145d63601c1573da573ab1f9f4d24ea6bb7f3 [file] [log] [blame]
MG Mud User88f12472016-06-24 23:31:02 +02001SYNOPSIS
2 #include <configuration.h>
3
4 void configure_interactive(object ob, int what, mixed data)
5
6DESCRIPTION
7 Sets the option <what> to the value <data> on the interactive <ob>
8 or the default for all interactives if <ob> is 0.
9
10 If the first argument <ob> is not this_object(), the privilege
11 violation ("configure_interactive", this_object(), ob, what, data)
12 occurs.
13
14 As <what>, the following arguments are accepted:
15
16 <what> == IC_MAX_WRITE_BUFFER_SIZE
17 Sets the maximum amount of data to be held pending for writing
18 per player to <data> bytes. A value of -1 means unlimited,
19 0 deactivates the write buffer.
20
21 <what> == IC_SOCKET_BUFFER_SIZE
22 Changes the socket buffer size to the given size in bytes.
23 Not every operating system might provide this option to
24 change the buffer size.
25
26 The buffer size is used for sending, when the remote side isn't
27 getting the data fast enough. When the socket buffer is full,
28 the driver will buffer in its internal write buffer (see
29 IC_MAX_WRITE_BUFFER_SIZE). When that gets full, too, then
30 messages are discarded.
31
32 <what> == IC_COMBINE_CHARSET_AS_STRING
33 Set the set of characters which can be combined into a single
34 string when already received en-bloc in charmode from the
35 interactive user <ob>. Non-combinable characters and single
36 received characters are returned as separate strings as usual.
37
38 The newline '\n' and the NUL character '\0' are always
39 non-combinable.
40
41 The given string should contain all combinable characters.
42 If given as the number 0, the default combine charset is
43 re-established.
44
45 <what> == IC_COMBINE_CHARSET_AS_ARRAY
46 Set the set of characters which can be combined into a single
47 string, just like IC_COMBINE_CHARSET_AS_STRING.
48
49 The given array shall contain an array of up to 32 integers
50 that are interpreted as 8-bit-values. Each character is encoded
51 as one bit (ASCII characters 0-7 in the first integer, and so on).
52 So a character <n> is treated as combinable if
53
54 array[n/8] & (1 << n%8)
55
56 If the array contains less elements, the missing elements will
57 be regarded as 0 (non-combinable characters).
58
59 <what> == IC_CONNECTION_CHARSET_AS_STRING
60 Set the set of characters which can be output to the interactive
61 user <ob>. All other characters are discarded. (This does not
62 apply to binary_message()).
63
64 The given string should contain all allowed characters.
65 If given as the number 0, the default charset is re-established.
66
67 <what> == IC_CONNECTION_CHARSET_AS_ARRAY
68 Set the set of characters which can be output to the interactive
69 user <ob>, just like IC_CONNECTION_CHARSET_AS_STRING.
70
71 The given array shall contain an array of up to 32 integers
72 that are interpreted as 8-bit-values. Each character is encoded
73 as one bit (ASCII characters 0-7 in the first integer, and so on).
74 So a character <n> is allowed to be output if
75
76 array[n/8] & (1 << n%8)
77
78 If the array contains less elements, the missing elements will
79 be regarded as 0 (not allowed, ie. to be discarded).
80
81 <what> == IC_QUOTE_IAC
82 Sets whether the character 255 (telnet IAC) shall be quoted
83 by prepending another IAC character, so it will not be interpreted
84 by the telnet protocol. Enable with 1, disable with 0. By default
85 it is enabled and does only apply if character 255 is allowed to
86 be output (ie. it is part of the connection charset).
87
88 <what> == IC_TELNET_ENABLED
89 Enables (1) or disables (0) the telnet machine for the interactive
90 user <ob>. When deactivated the driver won't handle telnet
91 negotiations (eg. H_TELNET_NEG won't be called), they will be
92 part of the user input. Also INPUT_NOECHO won't be effective
93 as the driver won't send any telnet negotiations itself.
94
95 <what> == IC_MCCP
96 Starts oder ends MCCP compression of the driver -> client traffic.
97 <data> must be the MCCP version (either TELOPT_COMPRESS or
98 TELOPT_COMPRESS2 from <telnet.h>). When the telnet machine
99 is disabled, any value other then zero will do, and the compression
100 starts without a telnet preamble.
101
102 Available only if the driver is compiled with MCCP enabled;
103 __MCCP__ is defined in that case.
104
105 <what> == IC_PROMPT
106 Sets the prompt for the interactive user <ob> to <data>. The
107 prompt can either be a string or a closure that will be called
108 each time the prompt is shown.
109
110 <what> == IC_MAX_COMMANDS
111 Sets the max number of commands the interactive user <ob> is
112 allowed to execute per second to <data>. A negative value means
113 'unlimited' and is the setting for newly created connections.
114
115 A 'command' in this context means every received data packet
116 which causes a LPC call - actions and calls to input_to()
117 alike.
118
119 <what> == IC_MODIFY_COMMAND
120 Sets an object that will act as a modifier for each command.
121 All commands for the interactive user <ob> will be passed to
122 data->modify_command() before actually being executed.
123 <data> must be given as an object.
124
125 When an object is set, the H_MODIFY_COMMAND hook wont be
126 called anymore. 0 as argument will stop the command modification
127 and reinstall the use of that driver hook.
128
129 This mechanism is intended to expand aliases on quicktypers
130 or the like. The name of the lfun called can be changed
131 from modify_command() to something else using the
132 H_MODIFY_COMMAND_FNAME hook.
133
134
135HISTORY
136 Introduced in LDMud 3.3.719.
137
138SEE ALSO
139 configure_driver(E)