====== Information ======
* TrinityCore ((https://www.trinitycore.org))
* 3.3.5 ((https://github.com/TrinityCore/TrinityCore/tree/3.3.5))
* These notes provide a local singleplayer server for World of Warcraft 3.3.5 on Linux
* For a traditional dedicated server see [[servers:linux:games:trinitycore_3.3.5|these notes]]
* 2024/10/28: Clang, Mold (linker), MariaDB
===== Media =====
* [[https://www.youtube.com/watch?v=NaEoXA53tYM|localhost Server and Desktop Launcher Presentation Video]]
* [[https://www.facebook.com/media/set/?set=a.1088786449282242|Progress Photo Album]]
===== Resources =====
* [[https://trinitycore.org/|TrinityCore]]
* [[https://trinitycore.info/|TrinityCore MMo Project Wiki]]
===== Prerequisites =====
* [[linux;distros;fedora_workstation_gnome|Fedora Workstation]]
* [[servers:linux:mariadb|MariaDB]]
* [[games;linux;wine;world_of_warcraft_3.3.5|World of Warcraft 3.3.5]]
====== Dependencies ======
****
sudo dnf install bzip2-devel gcc-c++ clang cmake git-core boost boost-devel readline-devel zlib-ng-compat-devel openssl-devel mariadb-devel
===== Mold Linker =====
* https://github.com/rui314/mold
* Can be verified with [[#troubleshooting|readelf]]
sudo dnf install 'mold'
sudo update-alternatives --config 'ld'
ls -la '/etc/alternatives/ld'
====== Download Source ======
* https://github.com/TrinityCore/TrinityCore/tree/3.3.5/
* https://github.com/TrinityCore/TrinityCore/commits/3.3.5/
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
====== Databases ======
mariadb -u 'root' -p
CREATE DATABASE authserver;
CREATE DATABASE characters;
CREATE DATABASE worldserver;
CREATE USER 'authserver'@'localhost' IDENTIFIED BY 'x';
CREATE USER 'characters'@'localhost' IDENTIFIED BY 'x';
CREATE USER 'worldserver'@'localhost' IDENTIFIED BY 'x';
GRANT ALL PRIVILEGES ON authserver.* to 'authserver'@'localhost';
GRANT ALL PRIVILEGES ON characters.* to 'characters'@'localhost';
GRANT ALL PRIVILEGES ON worldserver.* to 'worldserver'@'localhost';
FLUSH PRIVILEGES;
EXIT
====== Initial Compile ======
****
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' && cmake ~/'Projects/trinity-335/src' -DCMAKE_INSTALL_PREFIX=~/'Projects/trinity-335/run' -DCMAKE_C_COMPILER='clang' -DCMAKE_CXX_COMPILER='clang++' -DCMAKE_BUILD_TYPE='Release' -DWITHOUT_METRICS='1' -DTOOLS='1' && sync && make --jobs=$(nproc) install && sync
====== Update ======
* https://github.com/TrinityCore/TrinityCore/commits/3.3.5/
git -C ~/'Projects/trinity-335/src' pull origin '3.3.5' && cd ~/'Projects/trinity-335/build' && cmake ~/'Projects/trinity-335/src' -DCMAKE_INSTALL_PREFIX=~/'Projects/trinity-335/run' -DCMAKE_C_COMPILER='clang' -DCMAKE_CXX_COMPILER='clang++' -DCMAKE_BUILD_TYPE='Release' -DWITHOUT_METRICS='1' -DTOOLS='1' && sync && make --jobs=$(nproc) install && cp -v --remove-destination ~/'Projects/trinity-335/run/etc/authserver.conf.dist' ~/'Projects/trinity-335/run/etc/authserver.conf' && cp -v --remove-destination ~/'Projects/trinity-335/run/etc/worldserver.conf.dist' ~/'Projects/trinity-335/run/etc/worldserver.conf' && sync
===== Clean Compile =====
****
rm -Rf ~/'Projects/trinity-335/build' && mkdir -p ~/'Projects/trinity-335/build'
====== Content ======
* Expects [[games;linux;wine;world_of_warcraft_3.3.5|World of Warcraft 3.3.5]]
===== DBCs, Maps, and Cameras =====
* Sizes ((''dbc'' folder ''247''/90.3 MB, ''maps'' folder ''5744''/557.6 MB, ''Cameras'' folder ''14''/34.8 KB))
cp --force ~/'Projects/trinity-335/run/bin/mapextractor' ~/'.wine/World of Warcraft 3.3.5/drive_c/Program Files/World of Warcraft 3.3.5a.12340'*'/' && cd ~/'.wine/World of Warcraft 3.3.5/drive_c/Program Files/World of Warcraft 3.3.5a.12340'*'/' && rm -Rf 'dbc' 'maps' 'Cameras' && ./'mapextractor' -f '0' && sync
===== VMaps =====
==== Extract ====
****
cp --force ~/'Projects/trinity-335/run/bin/vmap4extractor' ~/'.wine/World of Warcraft 3.3.5/drive_c/Program Files/World of Warcraft 3.3.5a.12340'*'/' && cd ~/'.wine/World of Warcraft 3.3.5/drive_c/Program Files/World of Warcraft 3.3.5a.12340'*'/' && rm -Rf 'Buildings' && ./'vmap4extractor' -l && sync
==== Assemble ====
* Size ((''vmaps'' folder ''12501''/1.3 GB))
cp --force ~/'Projects/trinity-335/run/bin/vmap4assembler' ~/'.wine/World of Warcraft 3.3.5/drive_c/Program Files/World of Warcraft 3.3.5a.12340'*'/' && cd ~/'.wine/World of Warcraft 3.3.5/drive_c/Program Files/World of Warcraft 3.3.5a.12340'*'/' && rm -Rf 'vmaps' && mkdir -p 'vmaps' && ./'vmap4assembler' 'Buildings' 'vmaps' && sync
===== MMaps =====
* Size ((''mmaps'' folder ''3635''/1.6 GB))
* :!: Takes 30+ minutes on i5-8400H
cp --force ~/'Projects/trinity-335/run/bin/mmaps_generator' ~/'.wine/World of Warcraft 3.3.5/drive_c/Program Files/World of Warcraft 3.3.5a.12340'*'/' && cd ~/'.wine/World of Warcraft 3.3.5/drive_c/Program Files/World of Warcraft 3.3.5a.12340'*'/' && rm -Rf 'mmaps' && mkdir -p 'mmaps' && ./'mmaps_generator' --bigBaseUnit 'true' --threads $(nproc) && sync
===== Move Files =====
****
cd ~/'.wine/World of Warcraft 3.3.5/drive_c/Program Files/World of Warcraft 3.3.5a.12340'*'/' && mv --force 'dbc' 'maps' 'Cameras' 'vmaps' 'mmaps' ~/'Projects/trinity-335/run/bin' && rm -f 'mapextractor' 'vmap4extractor' 'vmap4assembler' 'mmaps_generator' && cd ~ && sync
==== Check Files ====
* ''~/Projects/trinity-335/run/bin'' needs ''Cameras'', ''dbc'', ''maps'', ''mmaps'', and ''vmaps'' folders
ls --directory ~/'Projects/trinity-335/run/bin/dbc' ~/'Projects/trinity-335/run/bin/maps' ~/'Projects/trinity-335/run/bin/Cameras' ~/'Projects/trinity-335/run/bin/vmaps' ~/'Projects/trinity-335/run/bin/mmaps'
gio open ~/'Projects/trinity-335/run/bin/'
===== Clean-up =====
cd ~/'.wine/World of Warcraft 3.3.5/drive_c/Program Files/World of Warcraft 3.3.5a.12340'*'/' && rm -Rf 'Buildings' 'mapextractor' 'vmap4extractor' 'vmap4assembler' 'mmaps_generator' 'WoWDL.lnk' && cd ~ && sync
gio open ~/'.wine/World of Warcraft 3.3.5/drive_c/Program Files/World of Warcraft 3.3.5a.12340'*'/'
===== World Database =====
==== TDB ====
* https://github.com/TrinityCore/TrinityCore/releases
* Download the latest ''TDB 335'' ''.7z'' with a web browser
* Expects something like ''TDB_full_world_335.24081_2024_08_17.7z'' in ''~/Downloads''
rm -Rf ~/'Projects/trinity-335/run/bin/TDB_full_world_335.'*'.sql' && cd ~/'Projects/trinity-335/run/bin' && 7za x ~/'Downloads/TDB_full_world_335.'*'.7z' && cd ~
====== Settings ======
===== authserver =====
* Last commit: [[https://github.com/TrinityCore/TrinityCore/commit/68bf7e6d12e1689d688db32c05066b8832922c67|Jul 28, 2021]] ''68bf7e6''
* [[https://github.com/TrinityCore/TrinityCore/commits/3.3.5/src/server/authserver/authserver.conf.dist|New commits check]]
* [[https://github.com/TrinityCore/TrinityCore/blob/3.3.5/src/server/authserver/authserver.conf.dist|Upstream authserver.conf.dist]] ([[https://raw.githubusercontent.com/TrinityCore/TrinityCore/3.3.5/src/server/authserver/authserver.conf.dist|raw]])
cp ~/'Projects/trinity-335/run/etc/authserver.conf.dist' ~/'Projects/trinity-335/run/etc/authserver.conf'
mkdir -p ~/'Projects/trinity-335/authserver.conf.d' && nano ~/'Projects/trinity-335/authserver.conf.d/localhost-authserver.conf'
[authserver]
# Connection
BindIP = "127.0.0.1"
LoginDatabaseInfo = ".;/var/lib/mysql/mysql.sock;authserver;x;authserver"
AllowLoggingIPAddressesInDatabase = 0
# Etc
RealmsStateUpdateDelay = 0
Updates.EnableDatabases = 1
Updates.CleanDeadRefMaxCount = -1
# End
===== worldserver =====
* Last commit: [[https://github.com/TrinityCore/TrinityCore/commit/e11613eeb5dcad16f5908c9c7dd8109baabe9272|Feb 16, 2023]] ''e11613e''
* [[https://github.com/TrinityCore/TrinityCore/commits/3.3.5/src/server/worldserver/worldserver.conf.dist|New commits check]]
* [[https://github.com/TrinityCore/TrinityCore/blob/3.3.5/src/server/worldserver/worldserver.conf.dist|Upstream worldserver.conf.dist]] ([[https://raw.githubusercontent.com/TrinityCore/TrinityCore/3.3.5/src/server/worldserver/worldserver.conf.dist|raw]])
cp ~/'Projects/trinity-335/run/etc/worldserver.conf.dist' ~/'Projects/trinity-335/run/etc/worldserver.conf'
mkdir -p ~/'Projects/trinity-335/worldserver.conf.d' && nano ~/'Projects/trinity-335/worldserver.conf.d/localhost-worldserver.conf'
[worldserver]
# Connection
BindIP = "127.0.0.1"
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"
AllowLoggingIPAddressesInDatabase = 0
# Server
HotSwap.Enabled = 0
HotSwap.EnableReCompiler = 0
FlashAtStart = 0
Server.LoginInfo = 1
Motd = "Welcome to your localhost server!"
AllowTickets = 0
Updates.CleanDeadRefMaxCount = -1
# Quests
Quests.LowLevelHideDiff = -1
Quests.HighLevelHideDiff = -1
# Character
GM.LoginState = 0
CharDelete.Method = 1
CharDelete.KeepDays = 0
# Protections
MaxOverspeedPings = 0
PacketSpoof.Policy = 0
ChatFakeMessagePreventing = 0
ChatFlood.MessageCount = 0
# End
====== Launch ======
* 2 separate Terminal windows
cd ~/'Projects/trinity-335/run/bin' && ~/'Projects/trinity-335/run/bin/authserver' --config-dir ~/'Projects/trinity-335/authserver.conf.d'
cd ~/'Projects/trinity-335/run/bin' && ~/'Projects/trinity-335/run/bin/worldserver' --config-dir ~/'Projects/trinity-335/worldserver.conf.d'
====== Create GM Account ======
* ''worldserver''
* Change ''x'' to password
account create Espionage724 x
account set gmlevel Espionage724 3 -1
server shutdown 1
====== Scripts ======
===== Server Start =====
* [[games:linux:wine:world_of_warcraft_3.3.5#desktop_launcher|Desktop Action Server]]
mkdir -p ~/'Projects/trinity-335/scripts' && nano ~/'Projects/trinity-335/scripts/tc-335-server-start.sh' && chmod +x ~/'Projects/trinity-335/scripts/tc-335-server-start.sh'
#!/bin/bash
cd ~/'Projects/trinity-335/run/bin'
ptyxis --standalone --title='WoW 3.3.5 localhost authserver — ' -- ~/'Projects/trinity-335/run/bin/authserver' --config-dir ~/'Projects/trinity-335/authserver.conf.d' &
ptyxis --standalone --title='WoW 3.3.5 localhost worldserver — ' -- ~/'Projects/trinity-335/run/bin/worldserver' --config-dir ~/'Projects/trinity-335/worldserver.conf.d'
# End
~/'Projects/trinity-335/scripts/tc-335-server-start.sh'
===== Update =====
* [[games:linux:wine:world_of_warcraft_3.3.5#desktop_launcher|Desktop Action Update]]
mkdir -p ~/'Projects/trinity-335/scripts' && nano ~/'Projects/trinity-335/scripts/tc-335-server-update.sh' && chmod +x ~/'Projects/trinity-335/scripts/tc-335-server-update.sh'
#!/bin/bash
git -C ~/'Projects/trinity-335/src' pull origin '3.3.5'
cd ~/'Projects/trinity-335/build'
cmake ~/'Projects/trinity-335/src' -DCMAKE_INSTALL_PREFIX=~/'Projects/trinity-335/run' -DCMAKE_C_COMPILER='clang' -DCMAKE_CXX_COMPILER='clang++' -DCMAKE_BUILD_TYPE='Release' -DWITHOUT_METRICS='1' -DTOOLS='1'
make --jobs=$(nproc) install
cp -v --remove-destination ~/'Projects/trinity-335/run/etc/authserver.conf.dist' ~/'Projects/trinity-335/run/etc/authserver.conf'
cp -v --remove-destination ~/'Projects/trinity-335/run/etc/worldserver.conf.dist' ~/'Projects/trinity-335/run/etc/worldserver.conf'
sync
echo ''
read -n '1' -s -r -p 'WoW 3.3.5 localserver has been updated. Press any key to exit.'
# End
~/'Projects/trinity-335/scripts/tc-335-server-update.sh'
===== Database Back-up =====
* [[games:linux:wine:world_of_warcraft_3.3.5#desktop_launcher|Desktop Action Saves]]
mkdir -p ~/'Projects/trinity-335/scripts' && nano ~/'Projects/trinity-335/scripts/tc-335-save-backup.sh' && chmod +x ~/'Projects/trinity-335/scripts/tc-335-save-backup.sh'
#!/bin/bash
cd ~/'Downloads'
echo 'Root MariaDB user password prompts:'
echo ''
mariadb-dump -u 'root' -p --opt -r 'localserver-authserver-database-'$(date +%Y-%m-%d-%s)'.sql' 'authserver'
mariadb-dump -u 'root' -p --opt -r 'localserver-characters-database-'$(date +%Y-%m-%d-%s)'.sql' 'characters'
sync
read -n '1' -s -r -p 'localserver databases have been dumped to Downloads. Press any key to exit.'
# End
~/'Projects/trinity-335/scripts/tc-335-save-backup.sh'
====== Character Data ======
===== Backup =====
* Dumps ''authserver'' and ''characters'' MySQL databases as ''.sql'' in ''~/Downloads''
cd ~/'Downloads' && mariadb-dump -u 'root' -p --opt -r 'localserver-authserver-database-'$(date +%Y-%m-%d-%s)'.sql' 'authserver'
cd ~/'Downloads' && mariadb-dump -u 'root' -p --opt -r 'localserver-characters-database-'$(date +%Y-%m-%d-%s)'.sql' 'characters'
===== Restore =====
==== authserver ====
* ''x'' is path to a ''authserver'' ''.sql'' database dump
mariadb --user='root' --password --execute='DROP DATABASE authserver'
mariadb --user='root' --password --execute='CREATE DATABASE authserver'
mariadb --user='root' --password 'authserver' < x
==== characters ====
* ''x'' is path to a ''characters'' ''.sql'' database dump
mariadb --user='root' --password --execute='DROP DATABASE characters'
mariadb --user='root' --password --execute='CREATE DATABASE characters'
mariadb --user='root' --password 'characters' < x
==== Reapply Permissions ====
* [[#databases|Initial Databases Set-up]]
mariadb -u 'root' -p
GRANT ALL PRIVILEGES ON authserver.* to 'authserver'@'localhost';
GRANT ALL PRIVILEGES ON characters.* to 'characters'@'localhost';
FLUSH PRIVILEGES;
EXIT
====== Troubleshooting ======
ldd ~/'Projects/trinity-335/run/bin/worldserver'
readelf --string-dump='.comment' ~/'Projects/trinity-335/run/bin/worldserver'