Another Kind of MUD
The MUD itself is composed of these parts:
- Data store. The data store is a basic key-value store with MVCC capabilities.
- Interface. These could be a web-based protocol such as AJAX, the telnet protocol or even something else.
- Rules Engine. This determines how the MUD behaves. The rules engine should be modifiable in real-time. This suggests a core rules engine that is never modified, with the larger rules loaded on top of that framework.
The core engine defines:
- What an object is
- What an object's attributes are
- How external entities (players and scripts) can interact with the objects.
- Basic permissions.
The core engine connects the interface to the object universe and ensures that they are properly stored in the data store.
How a Command is Executed
Accounts are one of the core objects. When a user connects, they can create a new account, or log in to an existing one.
If the account is marked as a superuser account, then the user who authenticates against that account has access to account-level commands that other accounts will not have. These include:
- View all accounts
- View a particular account
- Create a new account
- Delete an account
- Grant/Revoke Superuser Permissions on an account.
In addition to the above, the superuser is capable of defining the basic rules and objects in the universe. These are accomplished with the following commands:
- Create a rule
- Destroy a rule
- Edit a rule
- Load a rule library.
- Create an object
- Destroy and object
- Edit an object
- Load an object library.
How Rules Work
A rule simply code---a group of functions that work together to accomplish a purpose.
Rules have dependencies. For instance, rules that expect a clock need the clock rule to be running.
Rules register themselves in the global rule registration system. They can plugin to certain events, being executed when conditions are right. Some rules define new events.