====== 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 FreeBSD
===== Prerequisites =====
* [[bsd;freebsd_14.2_xfce|FreeBSD 14.2 (Xfce)]]
* [[servers:bsd:mariadb|MariaDB]]
* [[games;bsd;wine;world_of_warcraft_3.3.5|World of Warcraft 3.3.5]]
===== Resources =====
* [[https://trinitycore.org/|TrinityCore]]
* [[https://trinitycore.info/|TrinityCore MMo Project Wiki]]
====== Dependencies ======
su -
pkg install git readline boost-all mariadb114-client cmake bzip2 libressl
====== Download Source ======
****
cd ~ && mkdir -p ~/'Projects' && rm -Rf ~/'Projects/TrinityCore-335/src' && git clone --branch '3.3.5' --depth '1' --recurse-submodules 'https://github.com/TrinityCore/TrinityCore.git' ~/'Projects/TrinityCore-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/TrinityCore-335/build' && mkdir -p ~/'Projects/TrinityCore-335/build' ~/'Projects/TrinityCore-335/run' && cd ~/'Projects/TrinityCore-335/build' && cmake ~/'Projects/TrinityCore-335/src' -DCMAKE_INSTALL_PREFIX=~/'Projects/TrinityCore-335/run' -DCMAKE_BUILD_TYPE='Release' -DWITHOUT_METRICS='1' -DTOOLS='1' && sync && make -j '8' install && sync
====== Update ======
* https://github.com/TrinityCore/TrinityCore/commits/3.3.5/
git -C ~/'Projects/TrinityCore-335/src' pull origin '3.3.5' && cd ~/'Projects/TrinityCore-335/build' && cmake ~/'Projects/TrinityCore-335/src' -DCMAKE_INSTALL_PREFIX=~/'Projects/TrinityCore-335/run' -DCMAKE_BUILD_TYPE='Release' -DWITHOUT_METRICS='1' -DTOOLS='1' && sync && make -j '8' install && sync
====== Content ======
* Expects [[games;bsd;wine;world_of_warcraft_3.3.5|World of Warcraft 3.3.5]]
===== DBCs, Maps, and Cameras =====
****
cp -f ~/'Projects/TrinityCore-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 -f ~/'Projects/TrinityCore-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 ====
****
cp -f ~/'Projects/TrinityCore-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 =====
* :!: Takes about 30 minutes on i5-8400H
cp -f ~/'Projects/TrinityCore-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 8 && sync
===== Move Files =====
****
cd ~/'.wine/World of Warcraft 3.3.5/drive_c/Program Files/World of Warcraft 3.3.5a.12340'*'/' && mv -f 'dbc' 'maps' 'Cameras' 'vmaps' 'mmaps' ~/'Projects/TrinityCore-335/run/bin' && rm -f 'mapextractor' 'vmap4extractor' 'vmap4assembler' 'mmaps_generator' && cd ~ && sync
==== Check Files ====
* ''~/Projects/TrinityCore-335/run/bin'' needs ''Cameras'', ''dbc'', ''maps'', ''mmaps'', and ''vmaps'' folders
ls -d ~/'Projects/TrinityCore-335/run/bin/dbc' ~/'Projects/TrinityCore-335/run/bin/maps' ~/'Projects/TrinityCore-335/run/bin/Cameras' ~/'Projects/TrinityCore-335/run/bin/vmaps' ~/'Projects/TrinityCore-335/run/bin/mmaps'
gio open ~/'Projects/TrinityCore-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
cd ~/'.wine/World of Warcraft 3.3.5/drive_c/Program Files/World of Warcraft 3.3.5a.12340'*'/' && rm -Rf 'dbc' 'maps' 'Cameras' 'vmaps' 'mmaps' && 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.24111_2024_11_22.7z'' in ''~/Downloads''
rm -Rf ~/'Projects/TrinityCore-335/run/bin/TDB_full_world_335.'*'.sql' && cd ~/'Projects/TrinityCore-335/run/bin' && 7zz x ~/'Downloads/TDB_full_world_335.'*'.7z' && cd ~ && ls ~/'Projects/TrinityCore-335/run/bin/TDB_full_world_335.'*'.sql'
====== Settings ======
===== authserver =====
==== Initial Defaults Copy ====
****
cp -v ~/'Projects/TrinityCore-335/run/etc/authserver.conf.dist' ~/'Projects/TrinityCore-335/run/etc/authserver.conf'
==== localhost ====
* 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]])
mkdir -p ~/'Projects/TrinityCore-335/authserver.conf.d' && ee ~/'Projects/TrinityCore-335/authserver.conf.d/localhost-authserver.conf'
[authserver]
LoginDatabaseInfo = ".;/var/run/mysql/mysql.sock;authserver;x;authserver"
Updates.EnableDatabases = 1
===== worldserver =====
==== Initial Defaults Copy ====
****
cp -v ~/'Projects/TrinityCore-335/run/etc/worldserver.conf.dist' ~/'Projects/TrinityCore-335/run/etc/worldserver.conf'
==== localhost ====
* Last commit: [[https://github.com/TrinityCore/TrinityCore/commit/65e2474ff264e40f579ce2aa29921e9d72c75c6f|Nov 29, 2024]] ''65e2474''
* [[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]])
mkdir -p ~/'Projects/TrinityCore-335/worldserver.conf.d' && ee ~/'Projects/TrinityCore-335/worldserver.conf.d/localhost-worldserver.conf'
[worldserver]
LoginDatabaseInfo = ".;/var/run/mysql/mysql.sock;authserver;x;authserver"
WorldDatabaseInfo = ".;/var/run/mysql/mysql.sock;worldserver;x;worldserver"
CharacterDatabaseInfo = ".;/var/run/mysql/mysql.sock;characters;x;characters"
Quests.LowLevelHideDiff = -1
Quests.HighLevelHideDiff = -1
Motd = "Welcome to your localhost server!"
Server.LoginInfo = 1
====== Launch ======
* Two separate Terminal windows for ''authserver'' and ''worldserver''
cd ~/'Projects/TrinityCore-335/run/bin' && ~/'Projects/TrinityCore-335/run/bin/authserver' --config-dir ~/'Projects/TrinityCore-335/authserver.conf.d'
cd ~/'Projects/TrinityCore-335/run/bin' && ~/'Projects/TrinityCore-335/run/bin/worldserver' --config-dir ~/'Projects/TrinityCore-335/worldserver.conf.d'
===== Script =====
* [[games:bsd:wine:world_of_warcraft_3.3.5#desktop_launcher|WoW 3.3.5 Desktop Action Server]]
mkdir -p ~/'Projects/TrinityCore-335/scripts' && ee ~/'Projects/TrinityCore-335/scripts/localhost-server-start.sh' && chmod +x ~/'Projects/TrinityCore-335/scripts/localhost-server-start.sh'
#!/bin/sh
cd ~/'Projects/TrinityCore-335/run/bin'
xfce4-terminal -T 'WoW — authserver' -I ~/'.local/share/icons/hicolor/48x48/apps/WBE5_Wow.0.png' -e "./'authserver' --config-dir ../../'authserver.conf.d'" &
xfce4-terminal -T 'WoW — worldserver' -I ~/'.local/share/icons/hicolor/48x48/apps/WBE5_Wow.0.png' -e "./'worldserver' --config-dir ../../'worldserver.conf.d'"
# End
~/'Projects/TrinityCore-335/scripts/localhost-server-start.sh'
====== Create GM Account ======
* ''worldserver''
* Change ''x'' to password
account create Espionage724 x
account set gmlevel Espionage724 3 -1
server shutdown 1
====== Database Data ======
===== Backup =====
==== Commands ====
* Dumps ''authserver'' and ''characters'' 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'
==== Script ====
* [[games:bsd:wine:world_of_warcraft_3.3.5#desktop_launcher|WoW 3.3.5 Desktop Action Saves]]
mkdir -p ~/'Projects/TrinityCore-335/scripts' && ee ~/'Projects/TrinityCore-335/scripts/localhost-databases-backup.sh' && chmod +x ~/'Projects/TrinityCore-335/scripts/localhost-databases-backup.sh'
#!/bin/sh
cd ~/'Downloads'
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
notify-send -i ~/'.local/share/icons/hicolor/48x48/apps/WBE5_Wow.0.png' 'WoW 3.3.5 Databases Backed-up Successfully to Downloads'
# End
~/'Projects/TrinityCore-335/scripts/localhost-databases-backup.sh'
===== Restore =====
==== authserver ====
* ''x'' is path to ''localserver-authserver-database-*.sql''
mariadb -u 'root' -p -f 'authserver' < x
==== characters ====
* ''x'' is path to ''localserver-characters-database-*.sql''
mariadb -u 'root' -p -f 'characters' < x
==== Reapply Permissions ====
mariadb -u 'root' -p
GRANT ALL PRIVILEGES ON authserver.* to authserver@localhost;
GRANT ALL PRIVILEGES ON characters.* to 'characters'@'localhost';
FLUSH PRIVILEGES;
EXIT