StormFront Server Settings
From WarlockWiki
Contents |
About
With the inception of StormFront and the XML-based StormFrontProtocol, weight gain introduced a way to save a player's settings and scripts on the server. This makes it very easy to access your configuration and scripts from any location with an internet location, and removes the need for backup.
The purpose of this Wiki is to document the server settings XML document, and also the way in which server settings are added, updated, and removed from the server.
Notation
There are a some special cases of unique notations in the XML file. The most common being:
- Palette References**
- Palette references are described as "@<id>" where <id> is the id of the palette color to be used (see below). - Example: <p id="roomName" color="@97" bgcolor="@84"/>. This preset's foreground color will be the palette entry 97, and background color will be palette entry 84.
- Skin Color**
- A color value of "skin" indicates that the client should pull the color from some sort of skin. WarlockTwo Warlock2 defines a [DefaultSkin] class that tries to emulate StormFront's default skin colors. - Example: <p id="bold" color="skin" bgcolor="skin"/>
- Hex Colors**
- Colors in the palette are defined using [Standard HTML Hex Color notation], with the exception that all hex characters must be upper case. - Example: <i id="0" color="#FFFF90"/>
- Boolean Values**
- In the case of a boolean expression the values "y" or "t" is seen as true, and a "f" or null/empty attribute is seen as false. For example:
- The line attribute here is **True**: <p id="roomName" color="@97" bgcolor="@84" line="y"/> - The line attribute here is **False**: <p id="roomName" color="@97" bgcolor="@84" /> - The vis attribute here is **True**: <w id="sinv" vis="t"/> - The vis attribute here is **False**: <w id="sinv" vis="f"/>
Caveats
The server settings XML document is sent in ISO-8859-1 character encoding (which is incompatible with UTF-8, the default xml encoding). To succesfully parse the XML document with a standard XML library such as [dom4j], the following processing instruction needed to be added to the xml file:
%%(xml) <?xml version="1.0" encoding="ISO-8859-1"?> %%
Server Settings XML Document
- <settings>**: The document itself begins and ends with this tag; all of the actual configuration is nested.
- <palette>**: This is the color palette that all settings with colors make reference to.
- ****: This is a palette color entry under the palette tag. This tag contains two attributes and no data: - **id**: The numeric id for this palette entry (a 0-based index) - **color**: The actual color described in HTML Hex format (i.e #FFFFFF, #C0C0C0, etc).
- <presets>**: This element defines the "preset" elements, or the static colors/fonts for things like room names, bold text, speech, whispers, thoughts, etc.
**: This is a preset entry under the presets tag. This tag has 2 required attributes "color" and "bgcolor", all the rest are optional. - **color**: A palette reference to the foreground color for this preset. - **bgcolor**: A palette reference to the background color for this preset. - **ulcolor**: A palette reference to the underline color for this preset (optional). - **line**: A boolean indicating whether or not to highlight the entire line (optional).
- <strings>**: This element contains all of the user-entered highlight strings and their colors/fonts.
- <names>**: This element contains a list of names to highlight / ignore. The entries are identical to the strings element above.
- <vars>**: This element contains a list of variables the user has defined.
- <stream>**: This element contains stream window definitions including x/y position, width, height, default colors and fonts.
- <cmdline>**: This tag describes the colors for the game's entry box.
- <scripts>**: All of the player's scripts are stored here.