Craftd:Configuration: Difference between revisions

From wiki.vg
Jump to navigation Jump to search
imported>Dotblank
(Update default values and add new variables)
imported>Dotblank
(Update default values and add new variables)
(No difference)

Revision as of 01:54, 1 February 2011

Menu

After building and installing craftd, you will need to move the config files into place. craftd looks for the main config file in the following order:

  • ~/.craftd/craftd.conf
  • /etc/craftd/craftd.conf
  • /usr/local/etc/craftd/craftd.conf
  • Current working directory (useful for developers)


By default, these are located in $prefix/etc/craftd/ as *.dist files so as not to overwrite existing configs when you install updates.

<syntaxhighlight lang="bash"> cd /usr/local/etc mv craftd.conf.dist craftd.conf mv motd.conf.dist motd.conf </syntaxhighlight>

A config file is necessary, but it can consist of nothing more than {} if you wish to accept the defaults. Options may be omitted, in which case the defaults will be used. If the file fails to parse, an error message will be logged.

Default configuration file

Using this configuration file will not change any of the internal default variables <syntaxhighlight lang="javascript"> {

 "00": "craftd config file.  Must be valid JSON.",
 "server": {
   "daemonize": true,
   "game-port": 25565,
   "minecraft-stringmax": 100,
   "max-listenbacklog": 16,
   "worker-pool-size": 2,
   "motd-file": "motd.conf",
   "world-dir": "world/",
   "day-rate": 20,
   "sunset-rate": 20,
   "night-rate": 20,
   "unrise-rate": 20,
   "proxy-enabled": false,
   "default-server": "Default Server",
   "servers" : [ {
       "host" : "127.0.0.1",
       "name" : "Default Server",
       "port" : 25565 }
   ]
 },
 "httpd": {
   "enabled": false,
   "httpd-port": 25566,
   "static-docroot": "htdocs/"
 }

} </syntaxhighlight>


Available options and their defaults

Game Config
Option Default Action Notes
daemonize true Fork the server and run in background N/A
game-port 25565 The port players connect to craftd does not run as root; it must be >1024
minecraft-stringmax 100 Players are not allowed to send messages longer than this N/A
motd-file ./motd.conf Text displayed when user logs in N/A
worker-pool-size 2 Number of threads to use for packet processing Set between 1-2x number of CPU cores
world-dir ./world Location of the NBT world save directory N/A
day-rate 20 Game time tick rate during day N/A
sunset-rate 20 Game time tick rate during sunset N/A
night-rate 20 Game time tick rate during night N/A
sunrise-rate 20 Game time tick rate during sunrise N/A
proxy-enabled false Run in proxy mode on port 'game-port' To run both a game server and proxy, run as separate processes on different ports
default-server Default Server The name of the server to connect to when a client logs in and the server is in proxy mode N/A
servers N/A Specifies an array of servers See the server section for default values
Server options
Option Default Action Notes
host 127.0.0.1 The ip address or domain name N/A
name undefined The name for use in configuration files or in-game commands N/A
port 25565 The port of the currently described server N/A
Integrated httpd server
Option Default Action Notes
enabled true Enable the integrated httpd server Used for admin and status
httpd-port 25566 The port web browsers connect to craftd does not run as root; it must be >1024
static-docroot ./htdocs Location of static web content N/A