5 .. Copyright (c) 2004-2018 Jeremy Stanley <fungi@yuggoth.org>.
6 Permission to use, copy, modify, and distribute this software is
7 granted under terms provided in the LICENSE file distributed with
10 One of the primary goals for mudpy is to apply a consistent data
11 model for all information, from configuration and preferences to
12 user accounts and world data. Individual pieces of information are
13 called *facets*, and are grouped together into entities called
14 *elements*. Elements are meant to be treated as loosely-typed
15 objects (if it walks like a duck and talks like a duck...), while
16 facets within them have predefined names and are strictly typed.
17 This combination provides the ability to have facet inheritance
18 among elements as a layered sieve.
20 The mudpy data model consists of a mix of persistent data (stored
21 externally but cached in memory), and ephemeral data
22 (cross-reference indexes which can be regenerated from it). For now,
23 persistent data is stored externally in a tree-like hierarchy of
24 text files starting from a main configuration usually named
25 mudpy.yaml and cached in memory as a single python dict known as the
26 *universe*. This default implementation, while memory-hungry, is
27 planned so as to reduce the number of dict lookup operations
28 performed to retrieve an individual piece of information, when
29 compared with a more deeply-nested dict model.
34 The universe is organized with a hierarchical namespace using the
35 period (``.``) symbol as a separator. It is rooted at ``.`` and
36 grows to the right with successive nodes. The right-most node must
37 always be a facet, and the remainder of the series thus denotes the
38 absolute name of an element within the universe (the second node
39 from the right being the relative element name and the remaining
40 nodes to the left are called the *group*). Near the root of the
41 universal namespace are a number of special elements anchored within
42 the ``.mudpy`` branch which provide necessary configuration
43 information and keeps some basic elements from cluttering the rest
49 Where new actor elements with no specified storage destination are
56 Where the default archetype definitions are grouped together.
61 Where the default command definitions are grouped together.
66 Defines default long-term storage locations for various element
72 Defines default values and validation checks for every facet.
77 Defines filesystem-based backend storage meta data.
82 Language specific configuration.
87 Various aspects determining mudpy performance.
92 Configuration for logging.
97 Where the default menu definitions are grouped together.
102 Defines movement directions.
107 Network socket configuration.
112 Process-specific configuration.
117 Where new prop elements with no specified storage destination are
123 Where new room elements with no specified storage destination are
129 Timing-specific settings and scheduling for the main loop.
134 Long-term storage is accomplished with YAML format files, consisting
135 of an associative array of keys mapped to values of various data
136 types. The keys can be either absolute (beginning with a ``.``
137 character) or relative to the anchor specified by the parent file
138 which loaded it. Special records can also exist to describe a data
139 file's properties, and always begin with an underscore (``_``).
140 These are stored in the universe under the ``.mudpy.file`` group
141 with elements named for escaped versions of the file path (``.`` and
142 ``:`` replaced by ``\.`` and ``\:``) and the underscore stripped
143 from the beginning of each facet.
148 Arbitrary string providing copyright notice and license information.
153 Arbitrary string containing a description of the file or any other
154 useful information worth noting.
159 List of additional data sources to load and where to anchor their
160 elements in the universe. The value is prefaced by the storage
161 medium separated from the remainder by an optional parenthetical
162 parameter and a colon. The only type implemented so far is ``file``
163 and the optional parameter is ``p`` to indicate a private file which
164 should only be readable by the account under which the process is
165 running rather than created with the default umask (ignored on
166 unsupported platforms).
171 Boolean value indicating read-only status. Any file not protected
172 with a _lock record will be regenerated and rewritten by mudpy if
173 its records are changed, so record format will be normalized,
174 records arbitrarily reordered and YAML comments lost in the process.