Difference between revisions of "Development:DIRTSAND"

(Removed duplicated content and added new content.)
Line 1: Line 1:
This page contains information about how to set up DirtSand, the "D'ni in Real-Time Server and Network Dæmon" by [[User:Zrax|Zrax]]. It is a server compatible with the [[CyanWorlds.com Engine]]. CWE needs a server to run at all, which makes setting up DirtSand (or a compatible server) a necessary part of any CWE setup. DirtSand currently works only on Linux operating systems.
+
[[DIRTSAND]] is developed by H'uru on [https://github.com/H-uru/dirtsand Github]. If you wish to contribute, you can fork the repository and submit pull requests with your modifications. DIRTSAND is currently quite feature complete; unavailable features such as Heek are due to intentional design decisions.
  
This tutorial assumes that you run the DirtSand server and the database it uses on the same machine, which will usually be the case. If you plan to use a dedicated database server, you probably know enough about Postgres and Linux do change the setup accordingly.
+
'''Note:''' development of DIRTSAND is currently on indefinite hold as [[Development:Wondruss|development]] of [[Wondruss]] is underway, the latter being set to eventually replace DIRTSAND.
  
==Git==
+
== Building ==
[https://github.com/H-uru/dirtsand DirtSand] uses [http://git-scm.com git] for its source control needs. If you're already familiar with git, some of these instructions may seem obvious to you. If you're not familiar with git, it is recommended that you read through some of the excellent articles in the [http://help.github.com/ GitHub help area].
+
DIRTSAND can be built from source for Linux (and possibly other *nix) OSes. Follow the [[DIRTSAND:Getting Started|getting started guide]] to build DIRTSAND for your system. You'll need Git to fetch the sources.
  
==Dependencies==
+
== Contributing ==
 +
The process for contributing to DIRTSAND is essentially the [[Development:CyanWorlds.com Engine#Contributing|same as for Plasma]].
  
You will need to install some applications and libraries before you can build DirtSand. The package names in brackets are tested on Debian, they should be called similar on other distributions.
+
== Roadmap ==
 +
DIRTSAND is set to be superseded by [[Wondruss]] eventually; whether DIRTSAND will continue to be developed remains to be seen, as it is mostly feature-complete right now. For up-to-date information, consult the [[Open Source Task List]].
  
* GCC 4.6+ (might work with other C++11 compliant compilers, but untested) [g++]
+
[[Category:Development]][[Category:DIRTSAND]]
* cmake [cmake]
+
* Postgres, server and development libraries [postgresql, libpq-dev]
+
* OpenSSL [libssl-dev]
+
* libreadline [libreadline6-dev]
+
* zlib [zlib1g-dev]
+
* git (to get the sources) [git]
+
 
+
==Building the code==
+
 
+
This tutorial assumes you are setting up a small server to run on your main box, for testing. It installs DirtSand into a folder called "dirtsand" in your home directory. If you plan to run DirtSand on a public server, you should create a dedicated user for the Shard, so that it is properly isolated from the rest of your system, for example with the following commands run as root:
+
<source lang="bash">adduser dirtsand # create user
+
su dirtsand # and switch to it</source>
+
 
+
 
+
Run the following commands to download, compile and install dirtsand:
+
<source lang="bash">cd ~ # change to home directory (you can use any other folder as base directory, of course)
+
mkdir dirtsand && cd dirtsand
+
git clone git://github.com/H-uru/dirtsand.git src # download DirtSand into the src directory
+
cd src
+
mkdir build && cd build
+
cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/dirtsand # check for installed libraries etc.
+
make # compile the server
+
make install # copies the files to $HOME/dirtsand/bin etc.</source>
+
 
+
If you run into any errors about finding libraries or headers, make sure you have the *development* versions of all of the required libraries, and that they are in your path.  You can also use the cmake-gui to help cmake locate the missing paths and files.
+
 
+
You should not continue beyond this step before completing above commands without error messages!
+
 
+
==Setting up the server==
+
 
+
Now the database server needs to be set up and DirtSand needs to be configure to work with it. The subsections work on the database, so you need to run them as a user that can use the "sudo" command to switch to the postgres user. If you set up DirtSand on your home machine, your main user will usually be able to do that. On a server, you probably created a "dirtsand" user (see above) which should not have that power. Open a second terminal and log in as root for the following commands.
+
 
+
=== Set up the postgres user ===
+
 
+
<source lang="bash">sudo -u postgres psql</source>
+
will open a postgres shell that you can type commands into. The following commands will create a user to be used by DirtSand (replace "<password>" by some random series of characters, and note it down - you will need it later):
+
CREATE USER dirtsand WITH PASSWORD '<password>';
+
CREATE DATABASE dirtsand WITH TEMPLATE = template0 ENCODING = 'UTF8';
+
ALTER DATABASE dirtsand OWNER TO dirtsand;
+
\q
+
 
+
=== Install the UUID functionality ===
+
 
+
This may be provided by your OS distribution.  In Ubuntu or Debian, simply install the postgresql-contrib package to provide the necessary libraries and installation scripts. Once the package is installed, you can import the functionality into the database (you may have to adapt the version number to your distribution):
+
<source lang="bash">sudo -u postgres psql -d dirtsand < /usr/share/postgresql/8.4/contrib/uuid-ossp.sql</source>
+
 
+
 
+
If your distribution does not provide a contrib or uuid-ossp bundle, you can get it and build it yourself from the sources provided at:  http://www.ossp.org/pkg/lib/uuid/. You can then add it to the dirtsand database by running:
+
<source lang="bash">sudo -u postgres psql -d dirtsand < /path/to/uuid-ossp.sql</source>
+
 
+
=== Set up the dirtsand database ===
+
 
+
<source lang="bash">cd ~/dirtsand/src # if you switched the user, you may have to change this to the correct path
+
sudo -u postgres psql -d dirtsand < db/dbinit.sql
+
sudo -u postgres psql -d dirtsand < db/functions.sql</source>
+
 
+
If there were no other errors, your database should be ready for DirtSand. If you had to log in as root to run "sudo", exit that shell now, it is no longer necessary.
+
 
+
=== Configure dirtsand ===
+
 
+
A sample dirtsand.ini has been provided in the root of the dirtsand sources.  We can copy this to our install directory and then edit the fields we need. If you have dirtsand installed to somewhere other than /opt/dirtsand, you will also need to point the configuration to the right paths too.
+
 
+
<source lang="bash">cd ~/dirtsand
+
sudo cp src/dirtsand.sample.ini dirtsand.ini
+
<your-favorite-editor> dirtsand.ini</source>
+
 
+
First change the database settings - usually, the line containing "Db.Password" should be the only one you need to change. It must be set to the same random series of characters that you used when creating the user in postgres.
+
 
+
DirtSand also needs to know which ages it is going to host. To do that, look for the "Paths" section, and change the age and SDL paths (replace <user> by the name of the user you are working with):
+
Sdl.Path = /home/<user>/dirtsand/SDL
+
Age.Path = /home/<user>/dirtsand/ages
+
Of course, the files also have to be put their. The complete set of age and SDL files for Uru is available [https://github.com/H-uru/moul-scripts/ in the moul-scripts repository], just download and extract them. You can remove the Python folder, and you have to rename "dat" to "ages" before moving it into the dirtsand directory.
+
 
+
To test if it all worked, you can now launch DirtSand with your settings file:
+
<source lang="bash">bin/dirtsand dirtsand.ini # start the server
+
ds-902> quit # and stop it again</source>
+
If there is only a message saying something like "[Lobby] Running on 0.0.0.0/14617", followed by a bunch of warnings about the guild pubs, the database connection was successfully established and the vault initialized. Congratulations!
+
 
+
== Done! ==
+
 
+
That's it for the actual server setup. To complete this installation to a working Shard, check the [[Minimalistic Development Shard]] tutorial.
+

Revision as of 19:18, 15 May 2012

DIRTSAND is developed by H'uru on Github. If you wish to contribute, you can fork the repository and submit pull requests with your modifications. DIRTSAND is currently quite feature complete; unavailable features such as Heek are due to intentional design decisions.

Note: development of DIRTSAND is currently on indefinite hold as development of Wondruss is underway, the latter being set to eventually replace DIRTSAND.

Building

DIRTSAND can be built from source for Linux (and possibly other *nix) OSes. Follow the getting started guide to build DIRTSAND for your system. You'll need Git to fetch the sources.

Contributing

The process for contributing to DIRTSAND is essentially the same as for Plasma.

Roadmap

DIRTSAND is set to be superseded by Wondruss eventually; whether DIRTSAND will continue to be developed remains to be seen, as it is mostly feature-complete right now. For up-to-date information, consult the Open Source Task List.