Using the Server Property File

From Multiverse

Jump to: navigation, search

Contents

Overview

The Multiverse servers get their configuration settings from a properties file. By default, the properties file is multiverse/bin/multiverse.properties.

To specify a different property file, when using the bash start script, use the -p command-line option, as follows:

./multiverse.sh -v start -p propertyFile

If using the Windows batch file, simply provide the name of the properties file on the command line as the first argument:

start-multiverse.bat propertyFile

For example:

start-multiverse.bat myworld.properties

Setting the default properties file

If you do not specify a properties file on the command line, the startup scripts default to multiverse/bin/multiverse.properties. To change the default properties file, set the environment variable DEFAULT_MV_PROPERTYFILE. For information on how to set environment variables, see Setting Environment Variables.

If a property is not specified in the property file, or if the server cannot find the specified property file, then the server will instead look for a system property (specified on the Java command line with -D).

Property file

The server property file is a standard Java properties file, in which each line has the format:

propertyName=value

Part of the default properties file is shown below (comments removed for brevity):

multiverse.msgsvr_hostname=localhost
multiverse.msgsvr_port=20374
multiverse.worldmgrport=5040
multiverse.proxyserver=localhost
multiverse.proxyport=5050
multiverse.db_type=mysql
multiverse.db_driver=com.mysql.jdbc.Driver
multiverse.db_name=multiverse
multiverse.db_user=root
multiverse.db_password=test
multiverse.db_hostname=localhost
### multiverse.db_url=jdbc:dbtype://hostName/databaseName
multiverse.worldname=sampleworld
###multiverse.mvwfile=c:\\multiverse\\config\\sampleworld\\sampleworld.mvw

Copy the properties file into a new file (for example, myproperties.file) and then customize it for your world.

NOTE: You can just modify the default multiverse.properties file for your own purposes, but when you upgrade to the next release of the server, it will get over-written, so the "best practice" is to create your own properties file which will be preserved.

Proxy server host

To enable remote clients to connect to your servers, set the multiverse.proxyserver to the host name or IP address of the proxy server. For example:

multiverse.proxyserver=myserver.mycompany.com

The multiverse.proxyserver property has a special value, :same. The client interprets this value as the host name or IP address of the login server to which the client originally connected. Because it is interpreted on the client side, it works even if Network Address Translation has been performed on the server's IP address.

NOTE: As long as the proxy server and the login server are running on the same host system, this value will always work correctly. However, if you run the proxy server on a different machine than the login server, you must set multiverse.proxyserver to the IP address of the proxy server machine.

JDBC connection URL

Use the optional multiverse.db_url property to specify a JDBC URL. NOTE: This is different from the location of the JDBC JAR file; you only need to change multiverse.db_url if you want to use a database server other than MySQL.

If you do not use this property, then it defaults to the standard form based on the other property values as follows:

multiverse.db_url=jdbc:dbtype//hostName/databaseName

where:

  • dbtype = value of multiverse.db_type
  • hostName = value of multiverse.db_hostname
  • databaseName = value of multiverse.db_name

In most cases (for example, with MySQL), the default is sufficient, but some databases may require you to specify a different JDBC connection string in certain circumstances.

World file

Use the multiverse.mvwfile property to specify the exact location (with full directory path) of the World Editor file. For example:

multiverse.mvwfile=c:\\multiverse\\config\\sampleworld\\sampleworld.mvw

This example is a Windows path; On Linux/Unix, use forward slashes instead of double backslashes.

If you do not specify this property, the servers will look for the file MV_HOME/config/worldname/worldname.mvw, where MV_HOME is the value of the MV_HOME environment variable. If MV_HOME is not defined, then the servers will assume that MV_HOME is the parent directory of the directory where the startup script is being run. So, if you want to run the startup script from a directory other then MV_HOME/bin, and you do not set multiverse.mvwfile, you must set the MV_HOME environment variable.

For information on how to set environment variables, see Setting Environment Variables.

Quad tree properties

Two properties control quad tree divisions:

  • multiverse.quad_tree_node_max_objects - Maximum objects per quad tree node before dividing node. Default is 30.
  • multiverse.quad_tree_max_depth - Maximum depth of the quad tree. Default is 20.

For information on the server quadtree, see Server Scaling and Performance Tuning.

Log properties

The multiverse.log_level property sets the logging level for all server processes. The default value is 1 (debug).

The multiverse servers use the log4j framework. See Server Logging for more details.

If the multiverse.rotate_logs_on_startup property is 'true' the log files will be rotated on server start-up. The default is 'true'.

If the multiverse.delete_logs_on_startup property is 'true' the log files will be deleted on server start-up. The default is 'false'.

Plugin Dependencies

Plugin start-up dependencies are described in the properties file via multiverse.plugin_dep properties. See Configuring Agents and Plugins

Voice server properties

The following properties provide configuration for the voice server.

Voice server host

To enable clients to connect to the voice server, set the multiverse.voiceserver to the host name or IP address of the voice server. For example:

multiverse.voiceserver=myvoiceserver.mycompany.com

The voice server supports the :same construct that the proxy server also supports.

Voice server port

The voice server's listener port defaults to 5051. If you need to change the default value, change the multiverse.voiceport property. For example:

multiverse.voiceport=2222

Pre-creating voice groups

It's often convenient to have the voice server pre-create voice groups for testing purposes. To create a positional voice group with a specific group OID at voice server startup, use the multiverse.precreated_positional_voice_group property. For example:

multiverse.precreated_positional_voice_group=1

This example creates a positional voice group with a group OID of one (1).

Similarly, to create a non-positional voice group with a specific group oid at voice server startup, use the multiverse.precreated_nonpositional_voice_group property. For example:

multiverse.precreated_nonpositional_voice_group=5

This example creates a positional voice group with group OID of five (5).

Auto-creating voice groups

Another property that is useful in testing is multiverse.autocreate_referenced_voice_groups. If this property has the value true, then whenever a client tries to join a voice group, and no group with the given oid exists, the voice server will create a non-positional voice group with that number. For example:

multiverse.autocreate_referenced_voice_groups=true

Recording incoming voice channels

Another property that can aid in tracking down voice server problems is multiverse.record_voices. If this property is true, the voice server creates a file of Speex voice frames for each player sending voice frames to the server. These files have names of the form Voice-nnnn.speex, where nnnn is the user's OID. The server saves the files in the server's log directory.

For example:

multiverse.record_voices=true

Correspondence between properties and environment variables

NOTE: This information is only relevant for old server releases. The current server release does not use any of these environment variables.

The following table describes the mapping between properties in the properties file and environment variables required in beta1 and earlier server releases. If the property file does not contain a property, then the servers will read the value from the corresponding property passed in via -D option on the command line; The old-multiverse.sh script passes in the environment variable values this way.

Property Environment Variable Description Default
multiverse.msgsvr_hostname MV_MSGSVR_HOSTNAME Message server host name or IP address localhost
multiverse.msgsvr_port MV_MSGSVR_PORT Port number used by message server 20374
multiverse.worldmgrport MV_WORLDMGRPORT Port number used by world manager 5040
multiverse.proxyserver MV_PROXYSERVER Proxy server host name or IP address localhost
multiverse.proxyport MV_PROXYPORT Port number used by proxy server 5050
multiverse.db_type N/A Database type to use mysql
multiverse.db_driver N/A Class name of JDBC driver to use com.mysql.jdbc.Driver
multiverse.db_name DB_NAME Database name multiverse
multiverse.db_user DB_USER Database user name root
multiverse.db_password DB_PASSWORD Database password test
multiverse.db_hostname DB_HOST Host name of database server localhost
multiverse.db_url N/A Optional. Explicit JDBC connection URL to use jdbc:dbtype:// hostName/databaseName
multiverse.worldname MV_WORLDNAME Name of world. Determines where servers look for scripts and save log files. If MVW_FILENAME is not specified, determines where servers look for world file. sampleworld
multiverse.mvwfile MVW_FILENAME Optional. Explicit path to World Editor file. MV_HOME/config/ worldname/worldname.mvw
Personal tools