Skip to content

Component Configuration

mikeprimm edited this page Oct 1, 2011 · 28 revisions

The interface for Dynmap is defined via a set of components. Not all components can be enabled at once, and some are required. Details on the defined compnents, and their attributes, are in the following sections.

Core Client Components

The following components defined the core of the client's interface with the Dynmap server. The Client Configuration Component, and at least one of the Client Update Components is required for any client functionality.

Client Configuration Component

This component is defined by the following lines in the components section:

  - class: org.dynmap.ClientConfigurationComponent

This component is required, and has no settings.

Internal Client Update Component

This component defines the primary interface for the web client via Dynmap's internal web server (which must be enabled for this component to function). It defines URLs for the client to use under the http://address:port/up/ path, including both fetching configuration data, and fetching map updates, player status and chat messages. The component is configured via the following lines in the components section:

  - class: org.dynmap.InternalClientUpdateComponent
    sendhealth: true
    sendposition: true
    allowwebchat: true
    webchat-interval: 5
    hidewebchatip: false
    trustclientname: false
    includehiddenplayers: false

The settings are defined as follows:

  • sendhealth : this controls whether or not the health data for players is reported to the web client. If it is disabled, other components that report player health will not have the needed data to do so, but player health information is also safe from being inspected. If enabled, health information may still be hidden for players located on specific worlds via the sendhealth: false setting on those worlds.

  • sendpostiion : this controls whether or not the position data for players is reported to the web client. If it is disabled, other components that report position will not have the needed data to do so, but player position information is also safe from being inspected. If enabled, position information may still be hidden for players located on specific worlds via the sendposition: false setting on those worlds.

  • allowwebchat : this setting controls whether or not the interface to allow chat messages to be sent from the web client to the server is enabled. If false, no web messages may be sent from the client.

  • webchat-interval : this controls the minimum period, in seconds, between consecutive chat messages from a given web client.

  • hidewebchatip : if set to true, this causes web chat messages to be reported via generic names versus the IP address of the sender.

  • trustclientname : if set to true, this causes the hostname/IP reported by the web client (which may be falsified) to be reported as the sender's address (versus using the address seen by the web server).

  • includehiddenplayers : if set to true, players that are hidden (via the /dynmap hide command) will be reported to the UI as online, but with their position, health, and messages still hidden. They will appear in the player list.

JSON File Client Update Component

The alternative to using the internal web server is for all communications between Dynmap and the web client to be done via files served through an external web server. As this is done with files formatted using JSON (JavaScript Object Notation), this mode of operation is often referred to as "JSON File Mode". This mode allows the internal web server to be disabled, and is the alternative to using the Internal Client Update Component (only one of them may be enabled at a time). The component is defined by the following lines in the components section:

  - class: org.dynmap.JsonFileClientUpdateComponent
    writeinterval: 1
    sendhealth: true
    sendposition: true
    allowwebchat: false
    webchat-interval: 5
    hidewebchatip: false
    includehiddenplayers: false

The definitions of the attributes are the same as the corresponding attributes in the Internal Client Update Component. The additional attributes are as follows:

  • writeinterval : this is the period, in seconds, used by the component for writing updated configuration and map update files to the webpath/standalone directory. These are the files loaded by the web client via the external web server to receive the map configuration, as well as notifications of map updates, player position and health data, and chat messages.

Markers Component

This component, added in v0.22, provides built-in support for map markers, both through the /dmarker commands and through an API published for use by other plugins. The component is configured via the following lines in the components section:

  - class: org.dynmap.MarkersComponent
    type: markers
    showlabel: false
    enablesigns: false
    showspawn: false
    spawnicon: world
    spawnlabel: "Spawn"

The settings for the component include the following:

  • showlabel : if defined and set to true, this causes the labels for map markers to be shown all the time, versus only being shown when the user's mouse is hovering over the icon.

  • enablesigns : If defined and set to true, this enables support for defining markers using signs. If enabled, and if the player has the dynmap.marker.sign privilege, a player can make a marker by creating a sign with '[dynmap]' as the first line, with the label being derived from the first non-blank line after that (that is not a setting). The icon will be the 'sign' icon, unless one of the lines is 'icon:'. The marker set for the marker will be the default 'markers' set, unless one of the lines is 'set:'. Once accepted, the '[dynmap]' line and any settings lines will be blanked, leaving the sign with the label line and any remaining lines. Destroying the sign will delete the corresponding marker.

  • showspawn : if defined and set to true, this causes the spawn points of each world to be shown with an appropriate marker (the default being the 'world' marker) and label (the default being "Spawn").

  • spawnicon : if defined, provides the ID of the icon to use for the spawn points (if showspawn is true). Default is 'world'.

  • spawnlabel : if defined, provides the label for the spawn point markers (if showspawn is true). Default is "Spawn".

Server-Side Chat Components

These components control the server-side implementation of chat, including the sending of chat messages from the server to the client, as well as particulars of how chat messages from the client to the server are delivered to players on the server. Only one of these components should be defined at a time.

Simple Chat Component

This component implements access to the standard Bukkit/Minecraft server's chat channel. When active, all chat messages are shared with the web client, and all messages received from the web client are sent to all players on the server (as well as all other web clients). This component is configured via the following lines in the components section:

  - class: org.dynmap.SimpleWebChatComponent
    allowchat: true

The settings for the component include:

  • allowchat : if enabled, this setting determines if chat messages on the server are to be sent to the web clients. If set to 'false', no chat messages are sent to the web clients.

HeroChat Chat Component

The HeroChat plugin implements channels and other behaviors that require special treatment. This component interfaces with HeroChat, and allows the selection of which HeroChat channels have their messages reported to the web clients, and which channel messages from the web clients are reported on. This component is configured via the following lines in the components section:

  - class: org.dynmap.herochat.HeroWebChatComponent
    herochatwebchannel: Global
    herochatchannels:
      - Global

The settings for the component are as follows:

  • herochatwebchannel : this is the name of the HeroChat channel that will be used for any chat messages received from the web clients. Default value is 'Global'

  • herochatchannels : this is the list of HeroChat channel names that will be monitored for chat messages, which will then be shared with the web clients. Zero or more channels may be listed. The default is a single channel list containing 'Global'.

Client-Side Chat Components

These components control the behavior and availability of the components of the web client used to support sending and receiving of chat messages. These components depend upon the corresponding server-side components being enabled and allowing the requested functions. The components can be defined individually or in any combination.

Chat Client Component

This component enables the input field for chat messages, allowing the users to enter and send chat messages to the server from the web client. It is defined by the following lines:

  - class: org.dynmap.ClientComponent
    type: chat

It currently supports no settings.

Chat Balloon Client Component

This component implements support for pop-up balloon messages, with the balloon being placed above the location of the sending player on the map, if any. The component is defined via the following lines in the components section:

  - class: org.dynmap.ClientComponent
    type: chatballoon
    focuschatballoons: false

The component supports the following settings:

  • focuschatballoons : if enabled, this causes the map to pan to the chat balloon, if it is not currently visible on the map.

Note that placement of the word balloons requires that the position data for the speaking player is known, which may not be the case if sendposition: false has been set for the player's current world, or globally via the active Client Update Component.

Chat Box Client Component

This implements the box for viewing chat messages received from players on the server, as well as from other web clients. The component is defined via the following lines in the components section:

  - class: org.dynmap.ClientComponent
    type: chatbox
    showplayerfaces: true
    messagettl: 5
    scrollback: 100

The settings for this component are as follows:

  • showplayerfaces : if enabled, the face icons for the player that sent a given chat message will be shown next to the message.

  • messagettl : this controls the number of seconds that a received chat message is shown on the screen before fading. If scrollback is defined, this setting is ignored.

  • scrollback : if defined, this specifies the number of messages to keep in the scrollable message list. If specified, messages will not age out (messagettl is ignored) and will only be dropped as the number of messages exceeds the scrollback count.

Map Controls Components

These define additional map content, such as player markers, clocks, logos, etc. Any set of these components can be defined.

Player Markers Component

This component is used to show player positions and names as markers on the displayed map. The player's position can only be shown if it is available (see the sendposition setting, above). The component is defined by the following lines in the components section:

  - class: org.dynmap.ClientComponent
    type: playermarkers
    showplayerfaces: true
    showplayerhealth: true
    smallplayerfaces: false
    hidebydefault: false
    layerprio: 0
    label: "Players"

The settings for the component include the following:

  • showplayerfaces : if enabled, this causes the client to attempt to load the custom skin for the player (if any) and to show the face portion of that skin as the icon for the player. Otherwise, a small generic marker is shown instead.

  • showplayerhealth : if enabled, the client will attempt to show health and armor attributes for the player, as two rows of small icons below the player's name. This requires that the player's health information be available (see sendhealth, above).

  • smallplayerfaces : if enabled, player faces are shown (assuming showplayerfaces is true), but at 1/2 the normal size (equivalent to the small generic markers used when showplayerfaces is false).

  • hidebydefault : this optional parameter, if defined and set to true, changes the default visibility state for the map layer with the player markers to be hidden. The layer can still be made visible with the layer control on the web client UI.

  • layerprio : this optional parameter provides an ordering weight for the layer in the layer selection control, which orders from lowest to highest layerprio (and then alphabetically for equal priority layers). Default is 0.

  • label : this optional parameter provides the label used for the layer selection control for this layer set. Default is 'Players'.

Digital Clock Component

This is used to display a simple digital clock, corresponding to the time on the world being displayed. The component is defined by the following lines in the components section:

  - class: org.dynmap.ClientComponent
    type: digitalclock

Only one clock component can be enabled at a time.

Time Of Day Clock Component

This is a more sophisticated clock component, showing day and night via sun and moon icons that rise and set to match the time in the world being shown. The component is defined via the following lines in the components section:

  - class: org.dynmap.ClientComponent
    type: timeofdayclock
    showdigitalclock: true
    showweather: true

The settings for the component include the following:

  • showdigitalclock : if enabled, the digital clock is displayed (in addition to the sun and moon display)

  • showweather : if enabled, an icon is shown to indicate weather (rain, thunder) on the world being shown by the map.

Coord Component (0.23)

This component is used to show the world coordinates corresponding to the position of the mouse pointer. The component is defined via the following lines in the components section:

   - class: org.dynmap.ClientComponent
     type: coord
     label: "Location"

The settings for the component are as follows:

  • label : this allows control of the label used on the control presenting the coordiates. Default is 'x,y,z'.

Logo Component

This component is used to allow an optional logo and link to be shown on the map. The component is defined via the following lines in the components section:

   - class: org.dynmap.ClientComponent
     type: logo
     text: "Dynmap"
     linkurl: "http://forums.bukkit.org/threads/dynmap.489/"

The settings for the component are as follows:

  • text : the label shown for the logo

  • linkurl : the URL associated with the link tied to the displayed label

Region Display Components

These components support the display of overlays on the present maps, corresponding to regions within the world in question. Regions defined by several different plugins are supported, and most of the settings for the components for these plugins are common, while some are quite specific to each component.

WorldGuard Region Component

This component supports the display of regions defined in the WorldGuard plugin, including both rectangular and polygonal regions (found in WorldGuard 5). The WorldGuard component is defined via the following lines in the components section:

   - class: org.dynmap.regions.RegionsComponent
     type: regions
     name: WorldGuard
     useworldpath: true
     filename: regions.yml
     basenode: regions
     use3dregions: true
     infowindow: '<div class="infowindow"><span style="font-size:120%;">%regionname%</span><br /> Owner <span style="font-weight:bold;">%playerowners%</span><br />Flags<br /><span style="font-weight:bold;">%flags%</span></div>'
     regionstyle:
       strokeColor: "#FF0000"
       strokeOpacity: 0.8
       strokeWeight: 3
       fillColor: "#FF0000"
       fillOpacity: 0.35
     visibleregions:
       - homebase
       - miningsite
     hiddenregions:
       - hiddenplace
       - secretsite
     customstyle:
       homebase:
         strokeColor: "#00FF00"
     hidebydefault: false
     layerprio: 0

The settings for this component include the following:

  • name : For WorldGuard, this must be set to WorldGuard.

  • useworldpath : For WorldGuard, this must be set to true

  • filename : For WorldGuard, this must be set to regions.yml

  • basenode : For WorldGuard, this must be set to regions

  • use3dregions : If set to true, the regions will be presented with their vertical limits shown (as a cubiod or other volume). If set to false, the region is shown 2D at a position corresponding to average ground level (Y=64).

  • infowindow : this setting controls the generation of the HTML within the popup window displayed with the region is clicked. Several substitution macros are supported, which will be resolved into appropriate data specific to the region being displayed:

    • %regionname% - the name of the region

    • %playerowners% - the names of the players that own the region

    • %groupowners% - the names of the groups that own the region

    • %playermanagers% - the names of the managers or associated for the region

    • %playermembers% - the names of the players that are members of the region

    • %groupmembers% - the names of the groups that are members of the region

    • %parent% - the name of the parent of the region

    • %priority% - the region's priority

    • %nation% - the nation or group that the region is a member of

    • $flags% - the various attribute flags for the region

  • regionstyle : this is a map of attributes used for describing the coloring of the outline and fill for the regions being presented. The attributes include:

    • strokeColor : this specified the color of the outline of the regions

    • strokeOpacity : this specifies how opaque the outline is (0.0 = transparent, 1.0 = solid)

    • strokeWeight : this specifies the thickness of the outline

    • fillColor : this specifies the color used to fill the interior of the region

    • fillOpacity : this specifies how opaque the fill color is (0.0 = transparent, 1.0 = solid)

  • visibleregions : this optional parameter, if defined, is used to provide a list of region names to be shown (any not on the list will not be shown). If the visibleregions attribute is not defined (the default), all regions will be shown.

  • hiddenregions : this optional parameter, if defined, is used to provide a list of region names to NOT be shown.

  • customstyle : this optional parameter, if defined, allows the regionstyle attributes used for specific regions to be overridden. The sections under the customstyle correspond to the name of the region to be customized, and the attributes within that section are the style settings (strokeColor, strokeOpacity, strokeWeight, fillColor, fillOpacity) that will be used in place of the defaults from the regionstyle setting.

  • hidebydefault : this optional parameter, if defined and set to true, changes the default visibility state for the map layer with the region information to be hidden. The layer can still be made visible with the layer control on the web client UI.

  • layerprio : this optional parameter provides an ordering weight for the layer in the layer selection control, which orders from lowest to highest layerprio (and then alphabetically for equal priority layers). Default is 0.

Residence Regions Component

The Residence Regions Component functions in a very similar fashion to the WorldGuard component, and shares many of the same settings. The component supports the display of Residences and the first level of subareas within those residences. The Residence component is defined by the following lines in the components section:

   - class: org.dynmap.regions.RegionsComponent
     type: regions
     name: Residence
     useworldpath: false
     filename: res.yml
     basenode: Residences
     use3dregions: false
     infowindow: '<div class="infowindow"><span style="font-size:120%;">%regionname%</span><br /> Owner <span style="font-weight:bold;">%playerowners%</span><br />Flags<br /><span style="font-weight:bold;">%flags%</span></div>'
     regionstyle:
       strokeColor: "#FF0000"
       strokeOpacity: 0.8
       strokeWeight: 3
       fillColor: "#FF0000"
       fillOpacity: 0.35
     visibleregions:
       - homebase
       - miningsite
     hiddenregions:
       - hiddenplace
       - secretsite
     customstyle:
       homebase:
         strokeColor: "#00FF00"
     groupstyle:
       homebase:
         strokeColor: "#007F00"
     hidebydefault: false
     layerprio: 0

The parameters for this component are the same as those of the WorldGuard Regions Component, with the following differences and additions:

  • name : For Residence, this must be Residence

  • useworldpath : For Residence, this must be false

  • filename : For Residence, this must be res.yml

  • basenode : For Residence, this must be Residences

  • customstyle : This works as in WorldGuard. To tailor a subarea of a Residence, add a section named residencename.areaname (e.g. myresidence.lot123).

  • groupstyle : This works like the customstyle attribute, but applies to the group of subareas under the residence with the given name. That is, to tailor the display style for the subareas of residence XYZ, add a section named XYZ under groupstyle and set its attributes to the appropriate colors. Put another way, customstyle tailors the attributes of a specific region, while groupstyle tailors the attributes of the children of that region.

Towny Region Component

The Towny Region Component is also very similar in function to the WorldGuard Region Component. As with Residence, most of the settings are common. With the Towny Component, all regions refer to towns, while region groups refer to nations. The component is defined by the following set of lines in the components section:

   - class: org.dynmap.regions.RegionsComponent
     type: regions
     name: Towny
     use3dregions: false
     infowindow: '<div class="infowindow"><span style="font-size:120%;">%regionname% (%nation%)</span><br /> Mayor <span style="font-weight:bold;">%playerowners%</span><br /> Associates <span style="font-weight:bold;">%playermanagers%</span><br/>Flags<br /><span style="font-weight:bold;">%flags%</span></div>'
     regionstyle:
       strokeColor: "#FF0000"
       strokeOpacity: 0.8
       strokeWeight: 3
       fillColor: "#FF0000"
       fillOpacity: 0.35
     visibleregions:
       - homebase
       - miningsite
     hiddenregions:
       - hiddenplace
       - secretsite
    customstyle:
       homebase:
         strokeColor: "#00FF00"
    groupstyle:
       MyNation:
         strokeColor: "#007F00"
    hidebydefault: false
    layerprio: 0

The settings for this component are common with the WorldGuard Region Component, with the following exceptions and additions:

  • name : this must be Towny

  • groupstyle : This works like the customstyle attribute, but applies to all the towns that are members of the nation with the given name. That is, to tailor the display style for all the towns of nation XYZ, add a section named XYZ under groupstyle and set its attributes to the appropriate colors. Put another way, customstyle tailors the attributes of a specific town, while groupstyle tailors the attributes of all the towns of a given nation. If both apply to a given town, customstyle has priority over groupstyle.

Factions Region Component

The Factions Region Component is also very similar in function to the WorldGuard Region Component. As with Towny, most of the settings are common. With the Factions Component, all regions refer to factions, including 'War Zone' and 'Safe Zone'. The component is defined by the following set of lines in the components section:

   - class: org.dynmap.regions.RegionsComponent
     type: regions
     name: Factions
     use3dregions: false
     infowindow: '<div class="infowindow"><span style="font-size:120%;">%regionname%</span><br />Flags<br /><span style="font-weight:bold;">%flags%</span></div>'
     regionstyle:
       strokeColor: "#FF0000"
       strokeOpacity: 0.8
       strokeWeight: 3
       fillColor: "#FF0000"
       fillOpacity: 0.35
     visibleregions:
       - faction1
       - faction2
     hiddenregions:
       - hiddenfaction
    customstyle:
       faction1:
         strokeColor: "#00FF00"
    hidebydefault: false
    layerprio: 0

The settings for this component are common with the WorldGuard Region Component, with the following exceptions and additions:

  • name : this must be Factions