跳到主要内容

Driver Configuration File

FluffOS reads a runtime configuration file at startup to configure the driver. The file is passed as the first argument to the driver executable.

./driver path/to/config.cfg

File Format

  • Lines beginning with # are comments; blank lines are ignored.
  • One setting per line, in the form setting name : value.
  • Most mudlib paths are relative to the mudlib directory; exceptions are noted per option (e.g. mudlib directory is an absolute OS path, and log directory is a filesystem path relative to the driver's working directory).
  • Integer options out of range are reset to their default with a warning.

For extended commentary and example values, see the annotated src/Config.example in the source tree. The tables below are generated directly from the driver, so they always match the options it actually recognizes.

Options

Identity & Network

SettingTypeDefaultDescription
namestringRequired. Name of this MUD.
mud ipstringIP address to bind to; useful on hosts with multiple network addresses.

Directory Structure

SettingTypeDefaultDescription
mudlib directorystringRequired. Absolute path to the mudlib root (this path is not relative to the mudlib).
log directorystringRequired. Filesystem directory for debug.log and stats files, resolved relative to the driver's "
"working directory (leading slashes are stripped); not a mudlib virtual path. |

| include directories | string | — | Required. Colon-separated list of directories searched by #include <...>. |

Core Files

SettingTypeDefaultDescription
master filestringRequired. Path to the object that defines the master object.
simulated efun filestringPath to the object that defines global simulated efuns.

Logging

SettingTypeDefaultDescription
debug log filestringRecommended. Filename (within the log directory) for the driver's debug log.

Error Handling

SettingTypeDefaultDescription
mudlib error handlerint1Pass runtime errors to the master object's error_handler() instead of handling them in the "
"driver. |

| trap crashes | int | 1 | Call crash() in the master object and shut down cleanly on signals that would otherwise " "crash the driver. | | default error message | string | — | Message shown to players when error() occurs. |

Timing & Lifecycle

SettingTypeDefaultDescription
time to clean upint600Seconds an object may be idle before clean_up() is called on it; should be well above 'time "
"to swap'. |

| time to reset | int | 900 | Seconds between successive reset() calls on an object. | | time to swap | int | 300 | Seconds an unused object stays in memory before being swapped out; 0 disables swapping. | | gametick msec | int | 1000 | Granularity of in-game time in milliseconds (the shortest visible time interval). | | heartbeat interval msec | int | 1000 | Heartbeat interval in milliseconds. |

Limits

SettingTypeDefaultDescription
evaluator stack sizeint65536Maximum size of the evaluator stack, which holds all local variables and call arguments.
inherit chain sizeint30Maximum depth of an object's inheritance chain.
maximum evaluation costint30000000Maximum eval cost a single thread may consume before execution is aborted.
maximum call depthint150Maximum nesting depth of LPC function calls.
maximum array sizeint15000Maximum number of elements in a single array.
maximum buffer sizeint1048576Maximum size, in bytes, of a single buffer variable.
maximum mapping sizeint150000Maximum number of entries in a single mapping.
maximum string lengthint1048576Maximum length, in bytes, of a single string variable.
maximum bits in a bitfieldint12000Maximum number of bits in a bitfield (stored 6 bits per printable byte).
maximum byte transferint262144Maximum number of bytes a single read_bytes()/write_bytes() call may transfer.
maximum read file sizeint262144Maximum size, in bytes, of a file that read_file() may read.

Hash Tables

SettingTypeDefaultDescription
hash table sizeint65536Size of the shared-string hash table; should be prime, roughly 1/5 of the number of distinct "
"strings. _(min 7001)_ |

| object table size | int | 4096 | Size of the object hash table; roughly 1/4 of the number of objects in the game. (min 1024) | | living hash table size | int | 256 | Size of the find_living() hash table; must be one of 4, 16, 64, 256, 1024, or 4096. (min 256) |

Reset Behavior

SettingTypeDefaultDescription
no resetsint0Completely disable the periodic calling of reset().
lazy resetsint0Only call reset() when an object is touched via call_other() or move_object().
randomized resetsint1Spread reset() calls over a randomized interval rather than firing them all at once.

Language Behavior

SettingTypeDefaultDescription
sane explode stringint1explode() strips at most one leading delimiter (and still one trailing delimiter).
reversible explode stringint0Make implode(explode(x, y), y) always equal x; overrides 'sane explode string'.
sane sortingint1Use a well-defined, stable ordering for the driver's sorting operations.
this_player in call_outint1Make this_player() usable from within call_out() callbacks, and from the callbacks of other "
"deferred efuns (resolve(), async_read(), async_write(), async_getdir(), async_db_exec()). |

| reverse defer | int | 0 | Run deferred functions registered with defer() in reverse order. | | old range behavior | int | 0 | Treat negative range indices in strings/buffers as counting from the end (rvalue use only). | | warn old range behavior | int | 1 | Warn when code relies on 'old range behavior'. | | enable_commands call init | int | 1 | Call init() in an object when enable_commands() is invoked on it. | | sprintf add_justified ignore ANSI colors | int | 1 | Make sprintf() column justification ignore ANSI color codes when computing field width. | | call_out(0) nest level | int | 1000 | Maximum nesting level for chains of call_out(0) within a single backend cycle. |

Type Checking

SettingTypeDefaultDescription
call other type checkint0Enable type checking for call_other() (the -> operator on objects).
call other warnint0Emit warnings instead of errors for call_other() type mismatches.
old type behaviorint0Reintroduce a legacy type-checking bug for backwards compatibility.

Player I/O

SettingTypeDefaultDescription
no ansiint1Replace ANSI escape characters (ASCII 27) in user input with a space before add_actions "
"run. |

| strip before process input | int | 1 | Strip ANSI before process_input() sees the input, rather than only before add_actions are " "called. | | interactive catch tell | int | 0 | Call catch_tell() on interactive users as well as on NPCs. | | receive snoop | int | 1 | Send snoop text to receive_snoop() in the snooper instead of directly via add_message(). | | snoop shadowed | int | 0 | Report snooped output even when the target's catch_tell() is shadowed (prefixed with $$). | | noninteractive stderr write | int | 0 | Write tells/messages sent to non-interactive objects to stderr, prefixed with ']' (legacy " "behavior). |

Diagnostics

SettingTypeDefaultDescription
traceint1Enable the trace() and traceprefix() efuns (leaving it off runs slightly faster).
trace codeint0Include the preceding lines of LPC code in error traces (slower).
has consoleint1Allow the driver's interactive console via the -C command-line argument.
suppress argument warningsint1Suppress unused-argument warnings, warning only about unused local variables.
trace lpc execution contextint0Record LPC execution context for tracing and debugging.
trace lpc instructionsint0Trace individual LPC instructions for debugging.
display preload progressint1Print each file name to the debug log while preload files are loaded at boot.

Protocol Support

SettingTypeDefaultDescription
enable mxpint0Advertise and enable the MXP telnet protocol.
enable gmcpint0Advertise and enable the GMCP telnet protocol.
enable zmpint0Advertise and enable the ZMP telnet protocol.
enable msspint1Advertise and enable the MSSP telnet protocol.
enable mspint1Advertise and enable the MSP telnet protocol.
enable msdpint0Advertise and enable the MSDP telnet protocol.

Security

SettingTypeDefaultDescription
ffi allowed librariesstringColon-separated allow-list of shared-library paths that ffi_load() may open (package_ffi). "
"Empty means the driver imposes no path restriction and defers entirely to the master apply "
"valid_ffi(); every ffi_load/symbol/prepare/callback is gated by that apply regardless. |

| allowed os environment variables | string | — | Colon-separated allow-list of environment variable names readable via get_os_env() " "(package_contrib). Names in 'writable os environment variables' are readable too. Empty " "(the default) denies all access. | | writable os environment variables | string | — | Colon-separated allow-list of environment variable names that set_os_env() may modify " "(package_contrib); these are implicitly readable. Empty (the default) denies all writes. |

Ports and Connections

The listening ports are configured with numbered external_port_N entries (N = 1 to 5). Each names a protocol and a port number:

external_port_1 : telnet 4000
external_port_2 : binary 4001
external_port_3 : websocket 8080

Recognized protocols are telnet, binary, ascii, MUD, and websocket.

SettingDescription
external_port_NProtocol and port for listener N, e.g. telnet 4000.
external_port_N_tlsEnable TLS on listener N: cert=path/to/cert.pem key=path/to/key.pem.
websocket http dirDirectory (under src/www) of static files served to web clients; required when a websocket port is defined.
port numberLegacy single telnet port; equivalent to defining external_port_1 : telnet <n>.

A websocket port requires websocket http dir to be set. With TLS, point cert=/key= at a PEM certificate and key, for example:

external_port_1 : telnet 4443
external_port_1_tls : cert=etc/cert.pem key=etc/key.pem

External Commands

When the driver is built with PACKAGE_EXTERNAL, external programs callable via external_start() are declared with numbered entries:

SettingDescription
external_cmd_NCommand line for external slot N (1-based).

Other Options

SettingDescription
global include fileHeader automatically #included in every compiled object, e.g. "/include/globals.h" or <globals.h>. Quotes are added if omitted.
default fail messageMessage used when an action returns 0 and no notify_fail() was set. Defaults to What?.

Obsolete Options

These settings are no longer used and should be removed. The driver prints a warning if any of these appear: address server ip, address server port, reserved size, fd6 kind, fd6 port, binary directory, swap file.

These are accepted for backwards compatibility but silently ignored: maximum users, compiler stack size.

See Also

Reference Files

  • src/base/internal/rc.cc - The INT_FLAGS[] / STR_FLAGS[] tables (source of truth)
  • src/Config.example - Annotated example configuration
  • src/include/runtime_config.h - Config slot constants