Skip to content

CONFIG_D

object CONFIG_D adm/daemons/config.c

Centralised configuration daemon. Loads a cascading pair of LPML files — shipped defaults plus local overrides — and serves values by flat key or dot-path. Most code reads config through the mud_config() simul_efun, which wraps get_mud_config().

inherits STD_DAEMON std/daemon/daemon.c
variable config mapping
variable DEFAULT_CONFIG string
variable CONFIG_FILE string
variable loaded int
# public get_mud_config

Retrieves a configuration value. The key may be a flat top-level key ("PORT") or a dot-separated path into nested mappings ("RESOURCE.GLOBAL_SPAWN_CHANCE"), resolved via dot_walk. Errors if the key is missing or a path hop hits a non-mapping intermediate.

param key string The configuration key or dot-separated path
returns mixed The value at key; a sub-mapping when the path stops at a non-leaf
# public rehash_config

Reloads and re-merges both files — default.lpml first, then config.lpml on top via shallow mapping addition. Runs automatically on startup; call it (or the master admin command) to pick up edits without a restart.

returns void
# public get_all_config

Returns a copy of the entire configuration mapping. Use this to walk keys defensively when a key may not exist, since get_mud_config() errors on a miss.

returns mapping A copy of the current configuration