Skip to content

Installation and Setup

Jeremy Harton edited this page Dec 26, 2017 · 11 revisions

'Installing' the server

Windows

coming soon

Linux

Compile: javac -d ../../game -sourcepath src -cp libs/gson-2.8.2.jar src/mud/MUDServer.java
Run: java -Xms128m -Xmx1024m -cp libs/gson-2.8.2.jar:. mud.MUDServer --port 5000 --debug --enable-logging --module dnd-fr

  1. download source
  2. download google gson (jar)
  3. make a working folder, copy downloads to it, and then cd to that folder
  4. unzip source
  5. OPTIONAL?: run 'dos2unix' on all source/data files
  6. create 'libs' dir at same level as 'src' dir (mud-server-master/MUDServer/src)
  7. copy google gson into 'libs'
  8. make 'game' directory in working folder
  9. copy 'data' dir (at same level as 'src' dir) to 'game' dir
  10. copy 'libs' dir to game directory
  11. modify source file 'MUDServer.jar' so that:
    the statically defined data paths use Linux/UNIX style path separators (forward slash)
    the references to 'zones.txt' are similarly fixed
    the references to the databases folder are similarly fixed (involved in loading themes etc)
    fix path spec in load races
    fix motd path in messageOfTheDay() function [line 16848]
  12. compile code so that compiled tree ends up in 'game' [see 'javac' command above']
  13. run compiled code (DO NOT USE setup PARAMETER) [see 'java' command above]

Unfortunately due to path specifiers issues the above modifications are necessary for the server to see the files. There are also a handful of issues with the supplied world data and the path mess makes the setup parameter put things in the wrong place.

Outdated Info

In theory, to 'install' the server is super easy, just download a zip of the source code and run:

compile.cmd

That should ask Java to compile the source (to bytecode) and output .class files and then run the main class. Ideally there will be a an actual pre-built jar that you can download at some point, but no such thing currently exists.

Alternatively, if you have Eclipse (Java IDE), you can just make a new project and import the files. You should be able to run it relatively easily with the run button. It's possible you might encounter a few intial snags if the program can't find the file it needs or is unable to actually create new, clean ones (file permission issues?). Additionally, you can run the following file:

build.xml

As an Ant build and it will generate a jar file for you that can be run as described in the repository README.md. However in this case you will have to copy the data folder to the location where the jar file or the server won't be able to find the data it needs to run. It will generate some basic folders and files (hopefully enough to get started), but it might have some minor issues.

Note: The code will create the necessary folders in the same directory where you run the class files, if they don't exist.

Setup the server

Mostly, you just need to ensure the existence of certain data files, and then you should be able to run the program (post-compilation) without any trouble. If you include the setup parameter (see Running the Server) then the server will generate some basic files for you like a server MOTD template, an empty database and clean versions of several config files (without any custom data). It will also add a welcome message to the server's in-game bulletin board.

At the moment, settings have to be manually adjusted in the source code, or manually entered every time the server is restarted. This is not ideal, but will have to do for now.

Running the server

Simple. (see below)

Usage: java -jar mud_server.jar [ parameters ]

  --port  <port number> Specify the port for the server to listen on, default is 4000
  --db <database>       Specifies the database file to load (databases directory)
  --debug               Enable debugging messages
  --enable-logging      Enable logging of various things
  --theme               Use the specified theme file (theme directory)
  --setup               Run first time setup
  --telnet              Indicate that you'd like the server to handle pure telnet

* generally speaking, you will only use setup once, and can run the server with just that parameter if you just want to generate the necessary files and don't need anything else set
* telnet connections here just means a raw connection sending one character at a time

If you like the default port number, do not want debugging on, etc and have already run the server initially with the '--setup' parameter then you can safely run it at any time with no parameters. The order of the parameters in the Usage line above is not crucial.

Clone this wiki locally