AttorneyOnline / tsuserver3

An Attorney Online server.
GNU Affero General Public License v3.0
25 stars 51 forks source link

tsuserver3

tsuserver3 is the official Python-based server for Attorney Online.

Easy setup instructions

The server will not work out of the box. You must follow these instructions.

Install Python

Download tsuserver3

We recommend Git - it makes it very easy to update tsuserver. But we are power users and therefore inherently biased. You can instead download the latest zip of tsuserver with this link. Extract it and put it wherever you want.

Install dependencies

Configure tsuserver

Run

Advanced setup instructions

For servers that are intended to run for an extended period of time, Linux is recommended. Linux distros have a significantly more consistent and sane environment compared to Windows and macOS. These days, Microsoft is trying to cater the operating system it happened to prepackage with Candy Crush to power users by sticking a successful kernel inside its failed Win32 kernel, so you can try that abomination (or its successor) if you want. Or you can just use a darn virtual machine instead.

I will just assume from now on that you have managed to produce an object that runs Linux.

Using Docker

The easiest way to set up and start tsuserver is with the Dockerfile. You just install Docker and install Docker Compose.

Once you have everything configured, do sudo docker-compose up. It will build the image and start tsuserver up for you. If you accidentally restart the server, the container will automatically start back up. If you're not understanding why it's starting, try starting it up manually:

sudo docker run -it -d -v `pwd`/storage:/app/storage -v `pwd`/logs:/app/logs  -v `pwd`/config:/app/config -p 27018:27018 -p 27017:27017 --restart=unless-stopped tsuserver

Here is a breakdown of the command:

Docker is a nifty tool, although I admit that setting it up and understanding how to use it can be tedious.

Alternative: Using venv

venv is a tool built into Python to create a virtual Python environment to install packages in. It reduces the risk of mixing up Python versions and package versions. Sometimes, it's even necessary if pip installs require sudo privileges. (sudo pip install is highly frowned upon as it regularly causes conflicts with the system's own package manager. Don't do it, use venv instead!)

Suppose you installed tsuserver in /home/me/tsuserver (protip: this path is the same as ~me/tsuserver).

You can create a venv with the following command:

python3 -m venv /home/me/tsuserver/.venv

Then activate the venv:

source /home/me/tsuserver/.venv/bin/activate

Install requirements:

cd /home/me/tsuserver
pip install -r requirements.txt

Start the server:

python start_server.py

You will always need to activate the venv before starting the server.

Refer to "Creating Virtual Environments" in the Python documentation for more information.

To keep the server running even after closing the terminal:

Commands

Good-to-know commands are marked with a :star:.

Administration

Area

Casing

Character

Fun

Messaging

Music

Roleplay

License

This server is licensed under the AGPLv3 license. In short, if you use a modified version of tsuserver3, you must distribute its source licensed under the AGPLv3 as well, and notify your users where the modified source may be found. The main difference between the AGPL and the GPL is that for the AGPL, network use counts as distribution. If you do not accept these terms, you should use serverD, which uses GPL rather than AGPL.

See the LICENSE file for more information.