Development/Configuration

From LookingGlass

Revision as of 12:07, 7 November 2009 by Misterblue (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Home < Development < Configuration

Configuration

Configuration is handled by collections of named parameters. All parameters start with a default value which is over-ridden by the contents of the configuration file (most often named "LookingGlass.json", then user specific saved parameters and then command line parameters.

You can see a sampling of all the parameters with explanations on the default parameters page.

LookingGlass.json

Modules.json

LookingGlass reads the file Modules.json before LookingGlass.json and you can consider the two files concatenated together. The original design was to have all the module definitions in this file since the module linkage is required and shouldn't be confused with the optional parameter overrides that appear in LookingGlass.json. This might happen yet.

The modules are specified as a JSON array of module specifications. Modules are not dynamically searched for but are loaded if specified in the modules configuration section.

For each module, the following must be specified:

Assembly the name of the assembly file (usually a dll to search for the interface
Interface the name of the interface to find. The interface must also include the IModule interface
Name a name for this module. Other modules find this module by this name. In theory, one could have multiple viewers looking into the world and this would be done by specifying the viewer multiple times but with different names.
Order modules are loaded according to this value from lowest to greatest

An example snippet:

"Modules": [
    {   "Assembly": "LookingGlass.World.dll",
        "Interface": "LookingGlass.World.IWorld",
        "Name": "World",
        "Order": 30
    },
    {   "Assembly": "LookingGlass.View.dll",
        "Interface": "LookingGlass.View.IViewProvider",
        "Name": "Viewer",
        "Order": 40
    }
],

Grids.json

Predefined grid names and definitions are kept in this file.

Command Line Parameters

The command invocation of LookingGlass takes some parameters. Command line parameters override any default or configuration file parameter setting.

The command line parameters are:

  • --first UserFirstName (sets "User.Firstname")
  • --last UserLastName (sets "User.Lastname")
  • --password UserPassword (sets "User.Password")
  • --grid DefaultGrid (sets "User.Grid")
  • --loginuri GridLoginURI (sets "User.LoginURI")
  • --configFile Filename (sets "Settings.File")
  • --modulesFile Filename (sets "Settings.Modules")
  • --cache Directory (sets "Comm.Assets.CacheDir")
  • --param parameter:value (used to set any configuration parameter)

Parameter Defaults

A list of all the parameters is on the Default Parameters page. These are the values for parameters which can be overridden in one of the files mentioned above.

Personal tools