====== 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.1_xfce|FreeBSD 14.1 (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 -l
pkg install git-lite readline boost-all mariadb1011-client cmake bzip2 libressl
====== Download Source ======
****
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' && 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_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/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_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/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 -f ~/'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 ====
****
cp -f ~/'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 =====
****
cp -f ~/'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 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/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 -d ~/'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
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.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' && 7zz x ~/'Downloads/TDB_full_world_335.'*'.7z' && cd ~
====== Settings ======
===== authserver =====
****
cp -v ~/'Projects/trinity-335/run/etc/authserver.conf.dist' ~/'Projects/trinity-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]])
* Last updated: 2024/09/17
mkdir -p ~/'Projects/trinity-335/authserver.conf.d' && ee ~/'Projects/trinity-335/authserver.conf.d/localhost-authserver.conf'
[authserver]
LoginDatabaseInfo = ".;/var/run/mysql/mysql.sock;authserver;x;authserver"
Updates.EnableDatabases = 1
===== worldserver =====
****
cp -v ~/'Projects/trinity-335/run/etc/worldserver.conf.dist' ~/'Projects/trinity-335/run/etc/worldserver.conf'
==== localhost ====
* 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]])
* Last updated: 2024/09/17
mkdir -p ~/'Projects/trinity-335/worldserver.conf.d' && ee ~/'Projects/trinity-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''
* Ctrl + C to exit
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'
===== Script =====
* This is attached to the [[games;bsd;wine;world_of_warcraft_3.3.5#desktop_launcher|WoW 3.3.5 desktop launcher]] Server action
mkdir -p ~/'Projects/trinity-335/scripts' && ee ~/'Projects/trinity-335/scripts/tc-335-server-start.sh' && chmod +x ~/'Projects/trinity-335/scripts/tc-335-server-start.sh'
#!/bin/sh
cd ~/'Projects/trinity-335/run/bin'
xfce4-terminal --title='WoW 3.3.5 localhost authserver' -e "./'authserver' --config-dir ../../'authserver.conf.d'" &
xfce4-terminal --title='WoW 3.3.5 localhost worldserver' -e "./'worldserver' --config-dir ../../'worldserver.conf.d'"
# End
~/'Projects/trinity-335/scripts/tc-335-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 ====
* This is attached to the [[games:bsd:wine:world_of_warcraft_3.3.5#desktop_launcher|WoW 3.3.5 desktop launcher]] Saves action
mkdir -p ~/'Projects/trinity-335/scripts' && ee ~/'Projects/trinity-335/scripts/tc-335-save-backup.sh' && chmod +x ~/'Projects/trinity-335/scripts/tc-335-save-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 'WoW localhost databases have been backed-up to Downloads.'
gio open ~/'Downloads'
# End
===== Restore =====
==== authserver ====
* ''x'' is path to ''localserver-authserver-database-*.sql''
mariadb -u 'root' -p
DROP DATABASE authserver;
CREATE DATABASE authserver;
EXIT
mariadb -u 'root' -p -f 'authserver' < x
==== characters ====
* ''x'' is path to ''localserver-characters-database-*.sql''
mariadb -u 'root' -p
DROP DATABASE characters;
CREATE DATABASE characters;
EXIT
mariadb -u 'root' -p -f 'characters' < x
==== Reapply Permissions ====
mariadb -u 'root' -p
CREATE USER 'authserver'@'localhost' IDENTIFIED BY 'x';
CREATE USER 'characters'@'localhost' IDENTIFIED BY 'x';
GRANT ALL PRIVILEGES ON authserver.* to authserver@localhost;
GRANT ALL PRIVILEGES ON characters.* to 'characters'@'localhost';
FLUSH PRIVILEGES;
EXIT