Command Line Options

Executing a Command

The specifics of executing a command will depend on your operating system. The basic form of a command is:

java [-cp CLASSPATH] org.moock.unity.core.Unity COMMAND [OPTIONS] COMMAND is one of the available Unity commands.
OPTIONS is 0 to many possible options for the command.

In addition if java is not on your system's PATH then you will have to explicitly set the path. For example, use /usr/local/java1.3/bin/java. Refer back to Install Java for more info.

CLASSPATH

The CLASSPATH specifies the search path for application resources. For most commands the CLASSPATH will need to contain unity_core.jar, log4.jar, xerces.jar, xml-apis.jar and jdom.jar. On windows from the Unity root directory this woud look like:

-cp lib\unity_core.jar;lib\log4j.jar;lib\xerces.jar;lib\xml-apis.jar;lib\jdom.jar

On many unix based systems this would look like:

-cp lib/unity_core.jar:lib/log4j.jar:lib/xerces.jar:lib/xml-apis.jar:lib/jdom.jar

COMMANDS and OPTIONS

Command Options Notes
start
Starts the Server.
option 1: config file (not required) Config file option defaults to "uconfig.xml".
stop
(2 option version)
Stops the Server.
option 1: port
option 2: admin password
Assumes local IP address of "localhost".
stop
(3 option version)
Stops the Server.
option 1: IP address
option 2: port
option 3: admin password
restart
(2 option version)
Restarts the Server.
option 1: port
option 2: admin password
Assumes local IP address of "localhost".
restart
(3 option version)
Restarts the Server.
option 1: IP address
option 2: port
option 3: admin password
version
Prints out the version of Unity running.
manifest
Writes the Server manifest to an XML file.
option 1: IP address
option 2: port
option 3: admin password
option 4: file name (not required)
File name option defaults to "manifest.xml".
unban
Unbans an IP.
option 1: IP address
option 2: port
option 3: admin password
option 4: the ip address (as it appears in the banned.txt file) to unban.

Examples

To create a manifest file on the localhost IP, admin port 9101 on windows using the default file name:

java -cp lib\unity_core.jar;lib\xerces.jar;lib\xml-apis.jar;lib\log4j.jar;lib\jdom.jar org.moock.unity.core.Unity manifest localhost 9101 password

To stop the server on the localhost IP, admin port 9101 on linux:

java -cp lib/xerces.jar:lib/xml-apis.jar:lib/unity_core.jar:lib/log4j.jar:lib/jdom.jar org.moock.unity.core.Unity stop 9101 password