Both sides previous revisionPrevious revisionNext revision | Previous revision |
servers:games:cmangos_tbc_localhost [2024/03/31 04:25] – Sean Rhone | servers:games:cmangos_tbc_localhost [2024/03/31 11:36] (current) – Abandon; hard to source proper 2.4.3 client Sean Rhone |
---|
====== Information ====== | |
| |
* CMaNGOS ((https://cmangos.net/)) | |
* TBC ((https://github.com/cmangos/mangos-tbc)) | |
* master ((https://github.com/cmangos/mangos-tbc/tree/master)) | |
| |
* These notes provide a local singleplayer server | |
| |
* :!: 2024/03/31: WIP | |
| |
===== Prerequisites ===== | |
| |
* [[distros:fedora_workstation_gnome|Fedora Workstation]] | |
* [[servers:mariadb|MariaDB]] | |
* [[games:wine:world_of_warcraft_2.4.3|World of Warcraft (2.4.3)]] | |
| |
====== Dependencies ====== | |
| |
**** | |
| |
sudo dnf install bzip2-devel gcc-c++ cmake git mariadb-devel boost boost-static boost-devel readline-devel | |
| |
====== Download Source ====== | |
| |
**** | |
| |
cd ~ && mkdir -p ~/'Projects' && rm -Rf ~/'Projects/cmangos-tbc/src' && git clone --branch 'master' --depth '1' --recurse-submodules 'https://github.com/cmangos/mangos-tbc.git' ~/'Projects/cmangos-tbc/src' && sync | |
| |
====== Databases ====== | |
| |
* This creates the ''authserver'', ''characters'', and ''worldserver'' databases | |
| |
sudo mariadb | |
| |
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 | |
| |
====== Compile ====== | |
| |
**** | |
| |
rm -Rf ~/'Projects/cmangos-tbc/build' ~/'Projects/cmangos-tbc/run' && mkdir -p ~/'Projects/cmangos-tbc/build' ~/'Projects/cmangos-tbc/run' && cd ~/'Projects/cmangos-tbc/build' && cmake ~/'Projects/cmangos-tbc/src' -DCMAKE_INSTALL_PREFIX=~/'Projects/cmangos-tbc/run' -DDEBUG='0' -DBUILD_PLAYERBOTS='1' -DBUILD_EXTRACTORS='1' && sync && make --jobs=$(nproc) install && sync | |
| |
====== Content ====== | |
| |
* :!: WoW Clients from sources other than [[https://wowdl.net/files/clients#wrath-of-the-lich-king|wowdl.net]] or known-authentic sources could come modified in ways that fail with certain server emulator checks ((2022/09/22: [[https://www.warmane.com/download|Warmane's Wrath of the Lich King client]] fails ''StrictVersionCheck=1'' and shouldn't be used)) | |
| |
===== DBCs, Maps, and Cameras ===== | |
| |
* Expects [[games:wine:world_of_warcraft_3.3.5|World of Warcraft 3.3.5]] | |
* 2024/03/06: Takes about 30 seconds on i5-8400H | |
| |
ln --symbolic --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' && ln --symbolic --relative --force 'dbc' 'maps' 'Cameras' ~/'Projects/trinity-335/run/bin' && rm -f 'mapextractor' && cd ~ && sync | |
| |
===== VMaps ===== | |
| |
==== Extract ==== | |
| |
* Expects [[games:wine:world_of_warcraft_3.3.5|World of Warcraft 3.3.5]] | |
* 2024/03/06: Takes about 45 seconds on i5-8400H | |
| |
ln --symbolic --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 && rm -f 'vmap4extractor' && cd ~ && sync | |
| |
==== Assemble ==== | |
| |
* Expects [[games:wine:world_of_warcraft_3.3.5|World of Warcraft 3.3.5]] | |
* 2024/03/06: Takes about 11 seconds on i5-8400H | |
| |
ln --symbolic --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' && ln --symbolic --relative --force 'vmaps' ~/'Projects/trinity-335/run/bin' && rm -Rf 'Buildings' 'vmap4assembler' && cd ~ && sync | |
| |
===== MMaps ===== | |
| |
* Expects [[games:wine:world_of_warcraft_3.3.5|World of Warcraft 3.3.5]] | |
* :!: 2024/03/06: Takes about 43 minutes on i5-8400H | |
| |
ln --symbolic --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) && ln --symbolic --relative --force 'mmaps' ~/'Projects/trinity-335/run/bin' && rm -f 'mmaps_generator' && cd ~ && sync | |
| |
===== TDB ===== | |
| |
* :!: Check https://github.com/TrinityCore/TrinityCore/releases for updates and update the URL as-needed | |
* :!: Make certain the database is ''335'', and not ''927'' or etc | |
| |
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.24011/TDB_full_world_335.24011_2024_01_21.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 | |
| |
====== Settings ====== | |
| |
===== authserver.conf ===== | |
| |
* See [[notes:trinitycore_confs#authserverconf|authserver.conf]] | |
| |
===== worldserver.conf ===== | |
| |
* See [[notes:trinitycore_confs#worldserverconf|worldserver.conf]] | |
| |
====== Realm ====== | |
| |
===== authserver ===== | |
| |
* ''authserver'' needs started at least once to create the tables and to start ''worldserver'' for account creation | |
* Ctrl + C to exit | |
| |
cd ~/'Projects/trinity-335/run/bin' && ~/'Projects/trinity-335/run/bin/authserver' | |
| |
===== Realm ===== | |
| |
**** | |
| |
sudo mariadb --execute="UPDATE authserver.realmlist SET name = 'localhost', address = 'localhost' WHERE realmlist.id = 1" | |
| |
====== Create GM Account ====== | |
| |
* Change ''x'' to password | |
| |
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 | |
| |
====== Launch ====== | |
| |
===== Desktop Launcher ===== | |
| |
* See [[games:wine:world_of_warcraft_3.3.5#desktop_launcher|Desktop Launcher]] | |
* :!: Expects GNOME Terminal ((other Terminals and non-GNOME desktop environments untested)) | |
| |
===== Commands ===== | |
| |
==== authserver ==== | |
| |
**** | |
| |
cd ~/'Projects/trinity-335/run/bin' && ~/'Projects/trinity-335/run/bin/authserver' | |
| |
==== worldserver ==== | |
| |
**** | |
| |
cd ~/'Projects/trinity-335/run/bin' && ~/'Projects/trinity-335/run/bin/worldserver' | |
| |
====== Character Data ====== | |
| |
===== Backup ===== | |
| |
* Dumps ''authserver'' and ''characters'' MariaDB databases as ''.sql'' in ''~/Downloads'' | |
| |
==== Desktop Launcher ==== | |
| |
* See [[games:wine:world_of_warcraft_3.3.5#desktop_launcher|Desktop Launcher]] | |
* :!: Expects GNOME Terminal ((other Terminals and non-GNOME desktop environments untested)) | |
| |
==== authserver ==== | |
| |
**** | |
| |
cd ~/'Downloads' && sudo mariadb-dump --databases 'authserver' --result-file='localserver-authserver-database-'$(date +%Y-%m-%d-%s)'.sql' && sudo chown $USER:$USER ~/'Downloads/localserver-authserver-database-'*'.sql' && sync | |
| |
==== characters ==== | |
| |
**** | |
| |
cd ~/'Downloads' && sudo mariadb-dump --databases 'characters' --result-file='localserver-characters-database-'$(date +%Y-%m-%d-%s)'.sql' && sudo chown $USER:$USER ~/'Downloads/localserver-characters-database-'*'.sql' && sync | |
| |
===== Restore ===== | |
| |
* :!: This deletes the existing ''authserver'' and ''characters'' databases before restoring from backup | |
* :!: Only have a single ''authserver'' and ''worldserver'' ''.sql'' in ''~/Downloads'' ((more than 1 makes ''mariadb'' throw ''ambiguous redirect'')) ((TODO: See if there's a way to select a newer file either via timestamp or filename as ''%s'' should always increase?)) | |
| |
==== authserver ==== | |
| |
**** | |
| |
ls ~/'Downloads/localserver-authserver-database-'*'.sql' && sudo mariadb --execute='DROP DATABASE authserver' && sudo mariadb --execute='CREATE DATABASE authserver' && sudo mariadb 'authserver' < ~/'Downloads/localserver-authserver-database-'*'.sql' && sync | |
| |
==== characters ==== | |
| |
**** | |
| |
ls ~/'Downloads/localserver-characters-database-'*'.sql' && sudo mariadb --execute='DROP DATABASE characters' && sudo mariadb --execute='CREATE DATABASE characters' && sudo mariadb 'characters' < ~/'Downloads/localserver-characters-database-'*'.sql' && sync | |
| |
==== Reapply Permissions ==== | |
| |
sudo mariadb | |
| |
GRANT ALL PRIVILEGES ON authserver.* to 'authserver'@'localhost' IDENTIFIED BY 'x'; | |
| |
GRANT ALL PRIVILEGES ON characters.* to 'characters'@'localhost' IDENTIFIED BY 'x'; | |
| |
FLUSH PRIVILEGES; | |
| |
EXIT | |
| |