Note: Linux support is currently very limited as we don’t have anyone available to maintain it, issues are expected.
The purpose of this document is to:
Walk users through how to build TSWoW from source
Document important details and common issues
We currently run all our tests on Ubuntu 22.04, and the commands listed here assume you are using this version.
Simply run these commands in a terminal. Before anything else, run sudo apt-get update
. You should install dependencies in the order listed here, since they sometimes depend on each others.
sudo apt-get install curl
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
source ~/.bashrc
nvm install 18
nvm use 18
sudo apt-get install git
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null
sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ jammy main'
sudo apt update
sudo apt install cmake
sudo apt-get update
sudo apt-get install git clang cmake make gcc g++ libmysqlclient-dev libssl-dev libbz2-dev libreadline-dev libncurses-dev libboost-all-dev mysql-server p7zip
sudo update-alternatives --install /usr/bin/cc cc /usr/bin/clang 100
sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang 100
When building TSWoW from source, we are concerned about three directories:
The source
directory is the root directory containing all source code used to build TSWoW.
The build
directory contains all intermediate files and build configurations
The install
directory is where we install TSWoW
The source, build and install directories should all be separate. Do not place any of them inside any of the others. The recommended setup is to have a tswow-root
containing all three folders.
git clone https://github.com/tswow/tswow.git --recurse
source
directory, called “tswow”.Copy source/build.default.yaml
to source/build.yaml
and open it. Here you can configure where tswow should place build
and install
directories.
install
to point at your normal TSWoW installation unless you know what you’re doing, it will frequently flush out all your settings and modules!In the source
directory, run the command npm i
In the source
directory, run the command npm run build-interactive
(for building everything with a single command, just run npm run build
).
You should now have entered the main TSWoW build program. You can now build any components you want
All TypeScript for TSWoW and the transpiler is compiled automatically as long as the build program is running
We currently have a bug where the prompt doesn’t allow you to enter anything. Restarting the build script seems to fix this for now.
To get a fully working TSWoW installation, you can run the build full
command, which will compile TrinityCore and all other components necessary.
build trinitycore-relwithdebinfo
If you haven’t already set up mysql on your machine, you need to create a user account that can access it.
You may need to first start the mysql service:
sudo service mysql start
Run the following command to create a new mysql user (replacing ‘tswow’ and ‘password’ with your own values):
sudo mysql -u root -e "CREATE USER 'tswow' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON *.* TO 'tswow';"
Inside your install
directory, open node.conf
and replace all instances of “tswow;password” with your own username/password created above. Database.WorldSource
, Database.WorldDest
, Database.Auth
and Database.Characters
should all be changed.
build release
doesn’t work with a normal install
directory. To build a release, you must run turn off the build script, change the install directory to an empty/non-existing directory in source/build.yaml
and start the build script again.