Skip to content
YaroKasear edited this page Dec 18, 2015 · 1 revision

lib-yaro configuration framework

Lib-yaro uses a flexible framework for storing settings and data that allows yaro-muf programs to search a wide spectrum of database objects for needed data. It has a number of components:

  • getConfig, which searches using a pre-defined set of preferred data objects relative to the player or a specific object.
  • setConfig, which writes data to a specific object to assure that getConfig will find it if it's in the spectrum.
  • A cache system to allow programs to refrain from searching the database repeatedly for the same data per run.
  • Special tags introduced to allow a player to pull settings into messages, with the intent of respecting all players' preferences.
  • "Intelligent" typing of data to make sure that singular data, lists, and dictionaries get loaded and stored properly and predictably.

All yaro-muf programs will use this framework for storing and retrieving data. Yaro-editplayer allows players to change their color and interface settings.

The settings that this framework uses will be found in "_config/" and will try to separate data between "global" data and "command" data, allowing a player to set things such as colors specifically for one command.

lib-yaro also comes with a command called "yaroconf" which allows a player to manually set configuration settings for themselves or objects they control. The usage is:

yaroconf #set-config <OBJECT> <KEY> <VALUE> [COMMAND]

Where OBJECT is the object to set the data on, KEY is the specific key that lib-yaro would use in searching for the data, VALUE is the data itself, and COMMAND is an optional qualifier setting data on a specific command, allowing lib-yaro to resolve the proper propdir to store the setting in.

This is roughly equivalent to the following command:

@set <OBJECT>=_config/[COMMAND]/<KEY>:<VALUE>

The reason you'd want to use yaroconf is to make it easier to make sure the setting gets into the correct propdir for a command to find if it uses lib-yaro.