Table of Contents

Information

Notes

Prerequisites

Create Group and User

sudo groupadd 'trinity' && sudo useradd -c 'TrinityCore system account' -d '/var/lib/trinity' -g 'trinity' -m -r 'trinity'

Dependencies

Packages

sudo dnf install bzip2-devel clang cmake git mariadb-devel boost-devel readline-devel

Firewall

sudo firewall-cmd --add-port='3724'/'tcp' --permanent && sudo firewall-cmd --reload
sudo firewall-cmd --add-port='8085'/'tcp' --permanent && sudo firewall-cmd --reload
sudo firewall-cmd --add-port='3443'/'tcp' --permanent && sudo firewall-cmd --reload
sudo firewall-cmd --add-port='7878'/'tcp' --permanent && sudo firewall-cmd --reload

Download Source

sudo su 'trinity' -s '/usr/bin/bash'
cd ~ && mkdir -p ~/'Projects' && rm -Rf ~/'Projects/trinity-335/src' && git clone --branch '3.3.5' --depth '1' --recurse-submodules 'https://github.com/TrinityCore/TrinityCore.git' ~/'Projects/trinity-335/src' && sync
exit

Databases

Initial

sudo mysql
CREATE DATABASE authserver;
GRANT ALL PRIVILEGES ON authserver.* to 'authserver'@'localhost' IDENTIFIED BY 'x';
CREATE DATABASE characters;
GRANT ALL PRIVILEGES ON characters.* to 'characters'@'localhost' IDENTIFIED BY 'x';
CREATE DATABASE worldserver;
GRANT ALL PRIVILEGES ON worldserver.* to 'worldserver'@'localhost' IDENTIFIED BY 'x';
FLUSH PRIVILEGES;
EXIT

TDB

sudo su 'trinity' -s '/usr/bin/bash'
rm -Rf '/tmp/TDB' '/tmp/TDB/TDB335.7z' && mkdir -p '/tmp/TDB' && cd ~ && wget -O '/tmp/TDB/TDB335.7z' 'https://github.com/TrinityCore/TrinityCore/releases/download/TDB335.23061/TDB_full_world_335.23061_2023_06_14.7z' && 7za x '/tmp/TDB/TDB335.7z' -o'/tmp/TDB' && mv '/tmp/TDB/TDB_full_world_335'*'.sql' ~/'Projects/trinity-335/run/bin' && rm -Rf '/tmp/TDB' && sync

Compile

sudo su 'trinity' -s '/usr/bin/bash'
rm -Rf ~/'Projects/trinity-335/build' ~/'Projects/trinity-335/run' && mkdir -p ~/'Projects/trinity-335/build' ~/'Projects/trinity-335/run' && cd ~/'Projects/trinity-335/build' && CC='/usr/bin/clang' CXX='/usr/bin/clang++' cmake ~/'Projects/trinity-335/src' -DCMAKE_INSTALL_PREFIX=~/'Projects/trinity-335/run' -DTOOLS='1' && sync && make --jobs=$(nproc) install && sync
exit

Extractors

mkdir -p '/tmp/trinity-extractors' && sudo cp '/var/lib/trinity/Projects/trinity-335/run/bin/mapextractor' '/var/lib/trinity/Projects/trinity-335/run/bin/vmap4extractor' '/var/lib/trinity/Projects/trinity-335/run/bin/vmap4assembler' '/var/lib/trinity/Projects/trinity-335/run/bin/mmaps_generator' '/tmp/trinity-extractors' && sudo chown -R $USER:$USER '/tmp/trinity-extractors' && sync

Content

Transfer Extractors to Client

mkdir -p '/tmp/trinity-extractors' && scp espionage724@192.168.1.152:'/tmp/trinity-extractors/'* '/tmp/trinity-extractors' && mv '/tmp/trinity-extractors/'* ~/'.wine/World of Warcraft 3.3.5/drive_c/Program Files/World of Warcraft 3.3.5a.12340'*'/' && sync

Dependencies

sudo dnf install 'boost'

Extract and Generate Content

DBCs, Maps, and Cameras

cd ~/'.wine/World of Warcraft 3.3.5/drive_c/Program Files/World of Warcraft 3.3.5a.12340'*'/' && ./'mapextractor' -f '0'  && sync

VMaps

Extract

cd ~/'.wine/World of Warcraft 3.3.5/drive_c/Program Files/World of Warcraft 3.3.5a.12340'*'/' && ./'vmap4extractor' -l && sync

Assemble

cd ~/'.wine/World of Warcraft 3.3.5/drive_c/Program Files/World of Warcraft 3.3.5a.12340'*'/' && mkdir -p 'vmaps' && ./'vmap4assembler' 'Buildings' 'vmaps' && sync

MMaps

cd ~/'.wine/World of Warcraft 3.3.5/drive_c/Program Files/World of Warcraft 3.3.5a.12340'*'/' && mkdir -p 'mmaps' && ./'mmaps_generator' --bigBaseUnit 'true' --threads $(nproc) && sync

Transfer Content to Server

cd ~/'.wine/World of Warcraft 3.3.5/drive_c/Program Files/World of Warcraft 3.3.5a.12340'*'/' && scp -r 'dbc' 'maps' 'vmaps' 'mmaps' 'Cameras' espionage724@192.168.1.152:~

Cleanup on Client

cd ~/'.wine/World of Warcraft 3.3.5/drive_c/Program Files/World of Warcraft 3.3.5a.12340'*'/' && rm -Rf 'Buildings' 'Cameras' 'dbc' 'maps' 'vmaps' 'mmaps' && cd ~/'Downloads' && rm -f 'mapextractor' 'vmap4extractor' 'vmap4assembler' 'mmaps_generator' && sync

Move Content on Server

ls ~/'dbc' ~/'maps' ~/'vmaps' ~/'mmaps' ~/'Cameras' > '/dev/null' && sudo rm -Rf '/var/lib/trinity/Projects/trinity-335/run/bin/dbc' '/var/lib/trinity/Projects/trinity-335/run/bin/maps' '/var/lib/trinity/Projects/trinity-335/run/bin/vmaps' '/var/lib/trinity/Projects/trinity-335/run/bin/mmaps' '/var/lib/trinity/Projects/trinity-335/run/bin/Cameras' && cd ~ && sudo mv 'dbc' 'maps' 'vmaps' 'mmaps' 'Cameras' '/var/lib/trinity/Projects/trinity-335/run/bin' && sudo chown -R 'trinity':'trinity' '/var/lib/trinity/Projects/trinity-335/run/bin/dbc' '/var/lib/trinity/Projects/trinity-335/run/bin/maps' '/var/lib/trinity/Projects/trinity-335/run/bin/vmaps' '/var/lib/trinity/Projects/trinity-335/run/bin/mmaps' '/var/lib/trinity/Projects/trinity-335/run/bin/Cameras' && sync
sudo restorecon -F -I -R '/var/lib/trinity/Projects/trinity-335' && sync

SELinux

sudo semanage fcontext --add --type 'bin_t' '/var/lib/trinity/Projects/trinity-335/run/bin/authserver' && sudo restorecon -F -I -R '/var/lib/trinity/Projects/trinity-335/run/bin/authserver'
sudo semanage fcontext --add --type 'bin_t' '/var/lib/trinity/Projects/trinity-335/run/bin/worldserver' && sudo restorecon -F -I -R '/var/lib/trinity/Projects/trinity-335/run/bin/worldserver'

Settings

authserver

nano ~/'Projects/trinity-335/run/etc/authserver.conf'
LoginDatabaseInfo = ".;/var/lib/mysql/mysql.sock;authserver;x;authserver"

worldserver

nano ~/'Projects/trinity-335/run/etc/worldserver.conf'
LoginDatabaseInfo     = ".;/var/lib/mysql/mysql.sock;authserver;x;authserver"
WorldDatabaseInfo     = ".;/var/lib/mysql/mysql.sock;worldserver;x;worldserver"
CharacterDatabaseInfo = ".;/var/lib/mysql/mysql.sock;characters;x;characters"
Quests.LowLevelHideDiff = -1
Motd = "Welcome to the Realm of Espionage World of Warcraft server!"
Server.LoginInfo = 1
BirthdayTime = 1170471600

TODO Settings

# Distance
Visibility.Distance.Continents = 533
Visibility.Distance.Instances = 533
Visibility.Notify.Period.OnContinents = 250
Visibility.Notify.Period.InInstances = 250

Create GM Account

sudo su 'trinity' -s '/usr/bin/bash'
cd ~/'Projects/trinity-335/run/bin' && ~/'Projects/trinity-335/run/bin/authserver'
cd ~/'Projects/trinity-335/run/bin' && ~/'Projects/trinity-335/run/bin/worldserver'
account create Espionage724 x
account set gmlevel Espionage724 3 -1
server shutdown 1

Other Settings

Disable Console

Config

sudo su 'trinity' -s '/usr/bin/bash'
nano ~/'Projects/trinity-335/run/etc/worldserver.conf'
Console.Enable = 0

telnet

telnet '192.168.1.152' '3443'
server shutdown 1

Realm Information

sudo mysql
UPDATE `authserver`.`realmlist` SET `name` = 'RoE (WotLK)', `address` = 'wow.realmofespionage.xyz' WHERE `realmlist`.`id` = 1;

Two-Factor Authentication

sudo mysql
UPDATE `authserver`.`account` SET `token_key` = 'x' WHERE `account`.`id` = 1

SOAP

Services

authserver

sudo -e '/etc/systemd/system/tc-335-auth.service' && sudo systemctl daemon-reload && sudo systemctl enable 'tc-335-auth' --now
[Unit]
Description=TrinityCore 3.3.5 authserver
Wants=network-online.target
After=network-online.target mysqld.service

[Service]
Type=simple
User=trinity
Group=trinity
WorkingDirectory=/var/lib/trinity/Projects/trinity-335/run/bin
ExecStart='/var/lib/trinity/Projects/trinity-335/run/bin/authserver' -c '/var/lib/trinity/Projects/trinity-335/run/etc/authserver.conf'
Restart=always
RestartSec=5

[Install]
WantedBy=multi-user.target
sudo systemctl status 'tc-335-auth' -l

worldserver

sudo -e '/etc/systemd/system/tc-335-world.service' && sudo systemctl daemon-reload && sudo systemctl enable 'tc-335-world'
[Unit]
Description=TrinityCore 3.3.5 worldserver
Wants=network-online.target
After=network-online.target mysqld.service

[Service]
Type=simple
User=trinity
Group=trinity
WorkingDirectory=/var/lib/trinity/Projects/trinity-335/run/bin
ExecStart='/var/lib/trinity/Projects/trinity-335/run/bin/worldserver' -c '/var/lib/trinity/Projects/trinity-335/run/etc/worldserver.conf'
Restart=always
RestartSec=5

[Install]
WantedBy=multi-user.target
sudo systemctl status 'tc-335-world' -l

Information

  1. Pull-in updated sources and compile TC (1:00)
  2. Stop TC auth and world services (3:00)
  3. Install updated-compiled TC (3:02:30)
  4. Start TC auth and world services (3:05)

Updater

Service

sudo -e '/etc/systemd/system/tc-335-up.service'
[Service]
User=trinity
Group=trinity
Type=oneshot
WorkingDirectory=/var/lib/trinity/Projects/trinity-335/build
Environment='CC=/usr/bin/clang'
Environment='CXX=/usr/bin/clang++'
ExecStartPre='/usr/bin/make' clean
ExecStartPre='/usr/bin/git' -C '/var/lib/trinity/Projects/trinity-335/src' pull origin '3.3.5'
ExecStartPre='/usr/bin/sync'
ExecStart='/usr/bin/cmake' '/var/lib/trinity/Projects/trinity-335/src' -DCMAKE_INSTALL_PREFIX='/var/lib/trinity/Projects/trinity-335/run' -DTOOLS='1'
ExecStart='/usr/bin/make' --jobs='2'
ExecStartPost='/usr/bin/sync'

Timer

sudo -e '/etc/systemd/system/tc-335-up.timer' && sudo systemctl daemon-reload && sudo systemctl enable 'tc-335-up.timer' --now
[Unit]
Description=TrinityCore 3.3.5 Git Updater and Compiler
Wants=network-online.target
After=network-online.target

[Timer]
OnCalendar=*-*-* 01:00:00
Persistent=true

[Install]
WantedBy=timers.target

Stopper

Service

sudo -e '/etc/systemd/system/tc-335-stop.service'
[Service]
Type=oneshot
ExecStart='/usr/bin/systemctl' stop 'tc-335-auth'
ExecStart='/usr/bin/systemctl' stop 'tc-335-world'
ExecStartPost='/usr/bin/sync'

Timer

sudo -e '/etc/systemd/system/tc-335-stop.timer' && sudo systemctl daemon-reload && sudo systemctl enable 'tc-335-stop.timer' --now
[Unit]
Description=TrinityCore 3.3.5 Services Stopper
Wants=network-online.target mysqld.service
After=network-online.target

[Timer]
OnCalendar=*-*-* 03:00:00
Persistent=true

[Install]
WantedBy=timers.target

Post-updater

Service

sudo -e '/etc/systemd/system/tc-335-up-post.service'
[Service]
User=trinity
Group=trinity
Type=oneshot
WorkingDirectory=/var/lib/trinity/Projects/trinity-335/build
ExecStart='/usr/bin/make' install
ExecStartPost='/usr/bin/sync'

Timer

sudo -e '/etc/systemd/system/tc-335-up-post.timer' && sudo systemctl daemon-reload && sudo systemctl enable 'tc-335-up-post.timer' --now
[Unit]
Description=TrinityCore 3.3.5 Post-Updater
Wants=network-online.target
After=network-online.target

[Timer]
OnCalendar=*-*-* 03:02:30
Persistent=true

[Install]
WantedBy=timers.target

Restarter

Service

sudo -e '/etc/systemd/system/tc-335-restart.service'
[Service]
Type=oneshot
ExecStart='/usr/bin/systemctl' start 'tc-335-auth'
ExecStart='/usr/bin/systemctl' start 'tc-335-world'
ExecStartPost='/usr/bin/sync'

Timer

sudo -e '/etc/systemd/system/tc-335-restart.timer' && sudo systemctl daemon-reload && sudo systemctl enable 'tc-335-restart.timer' --now
[Unit]
Description=TrinityCore 3.3.5 Services Restarter
Wants=network-online.target mysqld.service
After=network-online.target

[Timer]
OnCalendar=*-*-* 03:05:00
Persistent=true

[Install]
WantedBy=timers.target

Database Backup

authserver

Database Auth

sudo -H -u 'mysql' -e '/var/lib/mysql/auth/authserver' && sudo chmod '600' '/var/lib/mysql/auth/authserver'
[mysqldump]
user=authserver
password=x

Service

mkdir -p ~/'backups' && sudo -H -u 'mysql' mkdir -p '/var/lib/mysql/tmp' && sudo -e '/etc/systemd/system/authserver-db.service' && sudo sed -i 's/'CHANGEME'/'$USER'/g' '/etc/systemd/system/authserver-db.service'
[Service]
Type=oneshot
WorkingDirectory=/var/lib/mysql/tmp
ExecStartPre='/usr/bin/mysqldump' --defaults-extra-file='/var/lib/mysql/auth/authserver' --single-transaction 'authserver' -r '/var/lib/mysql/tmp/authserver.sql'
ExecStart='/usr/bin/gzip' -f '/var/lib/mysql/tmp/authserver.sql'
ExecStart='/usr/bin/bash' -c '"/usr/bin/mv" "/var/lib/mysql/tmp/authserver.sql.gz" "/home/CHANGEME/backups/authserver-database-auto-"$$(date +%%Y-%%m-%%d)".sql.gz"'
ExecStartPost='/usr/bin/sync'

Timer

sudo -e '/etc/systemd/system/authserver-db.timer' && sudo systemctl daemon-reload && sudo systemctl enable 'authserver-db.timer' --now && sudo systemctl start 'authserver-db' && sudo systemctl status 'authserver-db' -l
[Unit]
Description=TrinityCore (authserver) Database Backup
After=mysqld.service

[Timer]
OnCalendar=*-*-* 03:40:00
Persistent=true

[Install]
WantedBy=timers.target

characters

Database Auth

sudo -H -u 'mysql' -e '/var/lib/mysql/auth/characters' && sudo chmod '600' '/var/lib/mysql/auth/characters'
[mysqldump]
user=characters
password=x

Service

mkdir -p ~/'backups' && sudo -H -u 'mysql' mkdir -p '/var/lib/mysql/tmp' && sudo -e '/etc/systemd/system/characters-db.service' && sudo sed -i 's/'CHANGEME'/'$USER'/g' '/etc/systemd/system/characters-db.service'
[Service]
Type=oneshot
WorkingDirectory=/var/lib/mysql/tmp
ExecStartPre='/usr/bin/mysqldump' --defaults-extra-file='/var/lib/mysql/auth/characters' --single-transaction 'characters' -r '/var/lib/mysql/tmp/characters.sql'
ExecStart='/usr/bin/gzip' -f '/var/lib/mysql/tmp/characters.sql'
ExecStart='/usr/bin/bash' -c '"/usr/bin/mv" "/var/lib/mysql/tmp/characters.sql.gz" "/home/CHANGEME/backups/characters-database-auto-"$$(date +%%Y-%%m-%%d)".sql.gz"'
ExecStartPost='/usr/bin/sync'

Timer

sudo -e '/etc/systemd/system/characters-db.timer' && sudo systemctl daemon-reload && sudo systemctl enable 'characters-db.timer' --now && sudo systemctl start 'characters-db' && sudo systemctl status 'characters-db' -l
[Unit]
Description=TrinityCore (characters) Database Backup
After=mysqld.service

[Timer]
OnCalendar=*-*-* 03:41:00
Persistent=true

[Install]
WantedBy=timers.target

Backup

Server

Stop Services

sudo systemctl stop authserver worldserver

Backup Database

sudo mysqldump --defaults-extra-file='/var/lib/mysql/auth/authserver' --single-transaction 'authserver' -r ~/'authserver-database-manual-'$(date +%Y-%m-%d)'.sql' && sync
sudo mysqldump --defaults-extra-file='/var/lib/mysql/auth/characters' --single-transaction 'characters' -r ~/'characters-database-manual-'$(date +%Y-%m-%d)'.sql' && sync

Start Services

sudo systemctl start authserver worldserver

Client

Transfer Files To Client

scp espionage724@192.168.1.152:~/'authserver-database-'*'.sql' espionage724@192.168.1.152:~/'characters-database-'*'.sql' ~/'Downloads' && sync

Restore

Client

Uncompress Database

gunzip ~/'Downloads/authserver-database-'*'.sql.gz'
gunzip ~/'Downloads/characters-database-'*'.sql.gz'

Transfer Files To Server

scp ~/'Downloads/authserver-database-'*'.sql' ~/'Downloads/characters-database-'*'.sql' espionage724@192.168.1.152:~

Remove Files

rm -f ~/'Downloads/authserver-database-'*'.sql' ~/'Downloads/characters-database-'*'.sql' && sync

Server

Stop Services

sudo systemctl stop authserver worldserver

Drop Previous Database

sudo mysql
DROP DATABASE authserver;
DROP DATABASE characters;
FLUSH TABLES;

Re-create Databases

sudo mysql
CREATE DATABASE authserver;
CREATE DATABASE characters;

Restore Database

sudo mysql 'authserver' < ~/'authserver-database-'*'.sql' && sync
sudo mysql 'characters' < ~/'characters-database-'*'.sql' && sync

Reapply Permissions

sudo mysql
GRANT ALL PRIVILEGES ON authserver.* to 'authserver'@'localhost' IDENTIFIED BY 'x';
GRANT ALL PRIVILEGES ON characters.* to 'characters'@'localhost' IDENTIFIED BY 'x';
FLUSH PRIVILEGES;

Start Services

sudo systemctl start authserver worldserver

Remove Backups

rm ~/'authserver-database-'*'.sql' ~/'characters-database-'*'.sql' && sync
3)
WoW realmlist.wtf
4)
required for content extraction, and since the core and tools are compiled on Linux the extraction tools also require Linux
5)
the compile command below wipes out the run folder if it exists before compiling
6)
can use LD_LIBRARY_PATH=. for all the extraction commands, and copy the requested .so library files from downloaded packages into the WoW folder
7)
in other words, token_key requires a 16-character Base32 string
8)
manual doesn't gzip