blob: 360c8b72a761faf56250fc03394ee9603ea20880 [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
Zesstra715ec202025-07-09 22:18:31 +020038 The newline '\n', the NUL character '\0' and non-ASCII
39 characters (unicode characters > 127) are always
MG Mud User88f12472016-06-24 23:31:02 +020040 non-combinable.
41
42 The given string should contain all combinable characters.
43 If given as the number 0, the default combine charset is
44 re-established.
45
46 <what> == IC_COMBINE_CHARSET_AS_ARRAY
47 Set the set of characters which can be combined into a single
48 string, just like IC_COMBINE_CHARSET_AS_STRING.
49
Zesstra715ec202025-07-09 22:18:31 +020050 The given array shall contain an array of up to 16 integers
MG Mud User88f12472016-06-24 23:31:02 +020051 that are interpreted as 8-bit-values. Each character is encoded
52 as one bit (ASCII characters 0-7 in the first integer, and so on).
53 So a character <n> is treated as combinable if
54
55 array[n/8] & (1 << n%8)
56
57 If the array contains less elements, the missing elements will
58 be regarded as 0 (non-combinable characters).
59
60 <what> == IC_CONNECTION_CHARSET_AS_STRING
61 Set the set of characters which can be output to the interactive
Zesstra715ec202025-07-09 22:18:31 +020062 user <ob>. All other characters are discarded. This does only
63 apply to characters in the ASCII character set (first 128
64 characters). This does not apply to unicode characters > 127
65 or to binary_message().
MG Mud User88f12472016-06-24 23:31:02 +020066
67 The given string should contain all allowed characters.
68 If given as the number 0, the default charset is re-established.
69
70 <what> == IC_CONNECTION_CHARSET_AS_ARRAY
71 Set the set of characters which can be output to the interactive
72 user <ob>, just like IC_CONNECTION_CHARSET_AS_STRING.
73
Zesstra715ec202025-07-09 22:18:31 +020074 The given array shall contain an array of up to 16 integers
MG Mud User88f12472016-06-24 23:31:02 +020075 that are interpreted as 8-bit-values. Each character is encoded
76 as one bit (ASCII characters 0-7 in the first integer, and so on).
77 So a character <n> is allowed to be output if
78
79 array[n/8] & (1 << n%8)
80
81 If the array contains less elements, the missing elements will
82 be regarded as 0 (not allowed, ie. to be discarded).
83
84 <what> == IC_QUOTE_IAC
85 Sets whether the character 255 (telnet IAC) shall be quoted
86 by prepending another IAC character, so it will not be interpreted
87 by the telnet protocol. Enable with 1, disable with 0. By default
88 it is enabled and does only apply if character 255 is allowed to
89 be output (ie. it is part of the connection charset).
90
91 <what> == IC_TELNET_ENABLED
92 Enables (1) or disables (0) the telnet machine for the interactive
93 user <ob>. When deactivated the driver won't handle telnet
94 negotiations (eg. H_TELNET_NEG won't be called), they will be
95 part of the user input. Also INPUT_NOECHO won't be effective
96 as the driver won't send any telnet negotiations itself.
97
98 <what> == IC_MCCP
99 Starts oder ends MCCP compression of the driver -> client traffic.
100 <data> must be the MCCP version (either TELOPT_COMPRESS or
101 TELOPT_COMPRESS2 from <telnet.h>). When the telnet machine
102 is disabled, any value other then zero will do, and the compression
103 starts without a telnet preamble.
104
105 Available only if the driver is compiled with MCCP enabled;
106 __MCCP__ is defined in that case.
107
108 <what> == IC_PROMPT
109 Sets the prompt for the interactive user <ob> to <data>. The
110 prompt can either be a string or a closure that will be called
111 each time the prompt is shown.
112
113 <what> == IC_MAX_COMMANDS
114 Sets the max number of commands the interactive user <ob> is
115 allowed to execute per second to <data>. A negative value means
116 'unlimited' and is the setting for newly created connections.
117
118 A 'command' in this context means every received data packet
119 which causes a LPC call - actions and calls to input_to()
120 alike.
121
122 <what> == IC_MODIFY_COMMAND
123 Sets an object that will act as a modifier for each command.
124 All commands for the interactive user <ob> will be passed to
125 data->modify_command() before actually being executed.
126 <data> must be given as an object.
127
128 When an object is set, the H_MODIFY_COMMAND hook wont be
129 called anymore. 0 as argument will stop the command modification
130 and reinstall the use of that driver hook.
131
132 This mechanism is intended to expand aliases on quicktypers
133 or the like. The name of the lfun called can be changed
134 from modify_command() to something else using the
135 H_MODIFY_COMMAND_FNAME hook.
136
Zesstra715ec202025-07-09 22:18:31 +0200137 <what> == IC_ENCODING
138 Sets the encoding to convert the network input to/from.
139 All received bytes (except telnet negotiations) will be converted
140 using this encoding to the internal unicode representation.
141 And all text strings will be converted back to this encoding
142 when sent to the interactive.
143
144 Default is "ISO-8859-1//TRANSLIT".
145
MG Mud User88f12472016-06-24 23:31:02 +0200146
147HISTORY
148 Introduced in LDMud 3.3.719.
Zesstra715ec202025-07-09 22:18:31 +0200149 IC_ENCODING introduced in LDMud 3.6.0.
150
MG Mud User88f12472016-06-24 23:31:02 +0200151
152SEE ALSO
153 configure_driver(E)