### Example 1: Basic Logging Setup Source: https://www.azerothcore.org/wiki/logging-configuration Sets up console and file appenders for logging. The console logs errors with type and level prefixes, while the file logs errors with timestamp, type, and level prefixes. ```config Appender.Console=1,2,6 Appender.Server=2,2,7,Server.log,w Logger.root=2,Console Server ``` -------------------------------- ### Run AzerothCore World Server Source: https://www.azerothcore.org/wiki/ac-dashboard-core-installation Use this command to start the AzerothCore world server. The first startup will install the database. ```bash ./acore.sh run-worldserver ``` -------------------------------- ### Install AzerothCore Source: https://www.azerothcore.org/wiki/freebsd Installs the compiled AzerothCore server files to the specified installation directory. ```bash make install ``` -------------------------------- ### Run AzerothCore Authserver with startup-scripts Source: https://www.azerothcore.org/wiki/how-to-restart-and-debug Use this command to start the authserver with the new unified startup scripts engine. Ensure you have the scripts installed and configured. ```bash ./acore.sh run-authserver ``` -------------------------------- ### Creature Formation Group Setup Source: https://www.azerothcore.org/wiki/creature_formations This example demonstrates the required entries in the creature_formations table to establish a group. The leader's GUID must be present as both leader and member, with subsequent entries for each group member. ```sql leaderGUID | memberGUID ---|--- 1 | 1 1 | 2 1 | 3 ``` -------------------------------- ### Run AzerothCore Worldserver with startup-scripts Source: https://www.azerothcore.org/wiki/how-to-restart-and-debug Use this command to start the worldserver with the new unified startup scripts engine. Ensure you have the scripts installed and configured. ```bash ./acore.sh run-worldserver ``` -------------------------------- ### Install Key Libraries and Applications Source: https://www.azerothcore.org/wiki/digital-ocean-video-tutorial Installs essential libraries and tools required for AzerothCore. Ensure you have enough disk space for the installations. ```bash sudo apt-get update && sudo apt-get install git make gcc g++ clang default-libmysqlclient-dev libssl1.0-dev libbz2-dev libreadline-dev libncurses-dev mysql-server libace-6.* libace-dev g++-7 ``` ```bash sudo apt-get update ``` ```bash sudo apt-get install screen ``` ```bash sudo apt install curl ``` ```bash sudo apt install unzip ``` ```bash sudo apt install ``` -------------------------------- ### Enable AzerothCore Servers to Start on Boot Source: https://www.azerothcore.org/wiki/linux-core-installation Configure the systemd services for the authserver and worldserver to automatically start when the system boots up. ```bash sudo systemctl enable ac-authserver sudo systemctl enable ac-worldserver ``` -------------------------------- ### Install Xcode Command Line Tools Source: https://www.azerothcore.org/wiki/macos-requirements Install XCode using the App Store, then open the terminal and type this command to install the command line tools. ```bash xcode-select --install ``` -------------------------------- ### Install MySQL Server and Client Libraries Source: https://www.azerothcore.org/wiki/debian12-install-guide Downloads, verifies, and installs the MySQL APT repository configuration and the MySQL server with development libraries. It ensures non-interactive installation and cleans up downloaded files. ```bash # Version MYSQL_APT_CONFIG_VERSION=0.8.36-1 # # # # # mkdir -p ~/mysqlpackages && cd ~/mysqlpackages # Download wget "https://dev.mysql.com/get/mysql-apt-config_${MYSQL_APT_CONFIG_VERSION}_all.deb" wget "https://dev.mysql.com/downloads/gpg/?file=mysql-apt-config_${MYSQL_APT_CONFIG_VERSION}_all.deb&p=37" -O mysql-apt-config_${MYSQL_APT_CONFIG_VERSION}_all.deb.asc # Verify gpg --keyserver keyserver.ubuntu.com --recv-keys A8D3785C gpg --verify mysql-apt-config_${MYSQL_APT_CONFIG_VERSION}_all.deb.asc mysql-apt-config_${MYSQL_APT_CONFIG_VERSION}_all.deb # Install sudo DEBIAN_FRONTEND="noninteractive" dpkg -i ./mysql-apt-config_${MYSQL_APT_CONFIG_VERSION}_all.deb sudo apt update sudo DEBIAN_FRONTEND="noninteractive" apt install -y mysql-server libmysqlclient-dev # Cleanup rm -v mysql-apt-config_${MYSQL_APT_CONFIG_VERSION}_all* && unset MYSQL_APT_CONFIG_VERSION ``` -------------------------------- ### Start AzerothCore Application Containers Source: https://www.azerothcore.org/wiki/Install-with-Docker Starts the AzerothCore application containers. This command brings up the necessary services for the server to run. ```bash ./acore.sh docker start:app ``` -------------------------------- ### Instance Script Example Source: https://www.azerothcore.org/wiki/core-scripts Example of an InstanceScript class and its registration within the AddSC function. ```cpp // instance.cpp class instance_instance_script : public InstanceScript { public: instance_instance_script(Map* map) : InstanceScript(map) { } void SomeFunction(uint32 /*var*/) { /* Some code */ } } void AddSC_instance() { /* RegisterInstanceScript(script_name, mapId); */ RegisterInstanceScript(instance_instance_script, 533); } ``` -------------------------------- ### Remove Existing CMake Installation Source: https://www.azerothcore.org/wiki/digital-ocean-video-tutorial Removes any pre-existing CMake installations to ensure a clean setup. This is a prerequisite for installing a specific version. ```bash sudo apt remove --purge --auto-remove cmake ``` -------------------------------- ### Automated AzerothCore Build and Install Script Source: https://www.azerothcore.org/wiki/linux-core-installation A bash script that automates the process of setting the build core count, configuring with CMake, compiling, and installing AzerothCore. This script is useful for repetitive updates or initial setup. ```bash #!/bin/bash BUILD_CORES=`nproc | awk '{print $1 - 1}'` cmake ../ -DCMAKE_INSTALL_PREFIX=$AC_CODE_DIR/env/dist/ -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DWITH_WARNINGS=1 -DTOOLS_BUILD=all -DSCRIPTS=static -DMODULES=static && make -j$BUILD_CORES && make install ``` -------------------------------- ### Example Upgrade Instructions Source: https://www.azerothcore.org/wiki/how-to-use-changelog Provides an example of the 'How to upgrade' section, detailing necessary steps for developers to adapt their code to recent changes. This is crucial for module authors. ```markdown ### How to upgrade - The hook OnCheck of the Achievement script class now returns a boolean instead of a void. Add `return true` to your methods if you don't want to change the original behaviour. ``` -------------------------------- ### Empty String Table Error Source: https://www.azerothcore.org/wiki/common-errors Occurs when the 'acore_string' database table is empty, meaning the database has not been imported. Refer to the Database Installation guide. ```text > Loaded 0 acore strings. DB table `acore_string` is empty. ``` -------------------------------- ### Build and Install AzerothCore Source: https://www.azerothcore.org/wiki/macos-core-installation After configuring with CMake, use these commands to build and install the AzerothCore server. The `make -j` command utilizes multiple processor cores for faster compilation. ```bash make -j `nproc` make install ``` -------------------------------- ### Missing libmysql.dll Error Source: https://www.azerothcore.org/wiki/common-errors This error means the necessary .dll files were not copied to the binaries directory. Consult the Core Installation guide for required files. ```text The code execution cannot proceed because libmysql.dll was not found. Reinstalling the program may fix this problem. Or similar error. ``` -------------------------------- ### Configuration File Examples Source: https://www.azerothcore.org/wiki/windows-core-installation These are the distribution files for the server configuration. You will need to copy and rename them to '.conf' files and edit them to match your server's settings. ```text authserver.conf.dist worldserver.conf.dist ``` -------------------------------- ### Practical Example: Copy Custom Configuration Source: https://www.azerothcore.org/wiki/hooks-bash A practical example demonstrating how to copy a custom configuration file to the build output directory using a hook. The `$BINPATH` variable represents the build output directory. ```bash function copy_custom_config() { cp /path/to/myconfig.conf "$BINPATH/" echo "Custom config copied to $BINPATH" } registerHooks "ON_AFTER_BUILD" copy_custom_config ``` -------------------------------- ### Spell Area Configuration Example Source: https://www.azerothcore.org/wiki/spell_area This SQL statement inserts a new entry into the spell_area table, configuring a spell to be automatically applied upon entering an area based on quest start and end statuses. ```sql INSERT INTO `spell_area` (`spell`, `area`, `quest_start`, `quest_end`, `autocast`, `quest_start_status`, `quest_end_status`) VALUES (92237, 257, 28725, 28727, 1, 74, 11); ``` -------------------------------- ### Start AzerothCore Server Source: https://www.azerothcore.org/wiki/final-server-steps Run the authserver and worldserver executables from your build folder to start the AzerothCore server. Ensure you have configured a restarter and debugger if needed. ```bash Run authserver and worldserver in your build folder. ``` -------------------------------- ### Setup Firewall with UFW Source: https://www.azerothcore.org/wiki/debian12-install-guide Installs and configures the Uncomplicated Firewall (UFW) to deny incoming traffic by default, allow outgoing traffic, and explicitly permit SSH (port 55022), AzerothCore's game port (3724), and a web port (8085). ```bash sudo apt install ufw sudo ufw default deny incoming sudo ufw default allow outgoing sudo ufw allow 55022 sudo ufw allow 3724 sudo ufw allow 8085 sudo ufw enable ``` -------------------------------- ### Install node-dbc-reader Source: https://www.azerothcore.org/wiki/how-to-import-dbc-data-in-db Install the node-dbc-reader package using npm. Ensure you have Node.js installed. ```bash npm install ``` -------------------------------- ### Check Docker Installation Source: https://www.azerothcore.org/wiki/Install-with-Docker Verify that Docker is installed on your system. This command checks the installed Docker version. ```bash docker --version ``` -------------------------------- ### Install and Configure Uncomplicated Firewall (UFW) Source: https://www.azerothcore.org/wiki/digital-ocean-video-tutorial Installs UFW, sets default policies to deny incoming and allow outgoing traffic, and opens specific ports for SSH, MariaDB, and AzerothCore services. ```bash sudo apt update ``` ```bash sudo apt install ufw ``` ```bash sudo ufw default deny incoming ``` ```bash sudo ufw default allow outgoing ``` ```bash sudo ufw allow ssh ``` ```bash sudo ufw allow 3306 ``` ```bash sudo ufw allow 3724 ``` ```bash sudo ufw allow 8085 ``` ```bash sudo ufw enable ``` -------------------------------- ### Verify Python and Pip Installation Source: https://www.azerothcore.org/wiki/aws-tutorial Check if Python and its package installer, pip, are correctly installed and accessible in your system's PATH. ```bash python --version && pip --version ``` -------------------------------- ### Create Build Directory for AzerothCore Source: https://www.azerothcore.org/wiki/linux-core-installation Navigate to the AzerothCore installation directory and create a separate 'build' directory. This is a recommended practice to avoid issues with updates and source builds. ```bash cd $AC_CODE_DIR mkdir build cd build ``` -------------------------------- ### Check Docker Compose Installation Source: https://www.azerothcore.org/wiki/Install-with-Docker Verify that the Docker Compose plugin is installed. This command checks the installed Docker Compose version. ```bash docker compose version ``` -------------------------------- ### Install Git Dependencies on Debian/Ubuntu Source: https://www.azerothcore.org/wiki/ac-dashboard-core-installation Installs git, curl, unzip, and sudo on Debian/Ubuntu-based systems. These are required for the AzerothCore installation process. ```bash apt update && apt install git curl unzip sudo ``` -------------------------------- ### Setup SQL Database for AzerothCore Source: https://www.azerothcore.org/wiki/debian12-install-guide Creates the necessary databases and a dedicated user for AzerothCore with full privileges. Ensure you replace 'acore' with your desired username and password if not using defaults. ```sql sudo mysql <<'EOF' DROP USER IF EXISTS 'acore'@'localhost'; CREATE USER 'acore'@'localhost' IDENTIFIED BY 'acore' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0; CREATE DATABASE IF NOT EXISTS `acore_world` DEFAULT CHARACTER SET UTF8MB4 COLLATE utf8mb4_unicode_ci; CREATE DATABASE IF NOT EXISTS `acore_characters` DEFAULT CHARACTER SET UTF8MB4 COLLATE utf8mb4_unicode_ci; CREATE DATABASE IF NOT EXISTS `acore_auth` DEFAULT CHARACTER SET UTF8MB4 COLLATE utf8mb4_unicode_ci; GRANT ALL PRIVILEGES ON `acore_world`.* TO 'acore'@'localhost' WITH GRANT OPTION; GRANT ALL PRIVILEGES ON `acore_characters`.* TO 'acore'@'localhost' WITH GRANT OPTION; GRANT ALL PRIVILEGES ON `acore_auth`.* TO 'acore'@'localhost' WITH GRANT OPTION; EOF ``` -------------------------------- ### Start AzerothCore Authserver with Screen Source: https://www.azerothcore.org/wiki/digital-ocean-video-tutorial Use this command to start the authentication server in a detached screen session. Label the screen 'auth' for easy management. ```bash screen -AmdS auth ./authserver ``` -------------------------------- ### Launch AzerothCore Servers with PM2 Source: https://www.azerothcore.org/wiki/debian12-install-guide Starts the authserver and worldserver using PM2 process manager, configures PM2 startup, saves the current process list, and attaches to the worldserver console. ```bash pm2 start $HOME/server/bin/authserver --name authserver -- -c $HOME/server/etc/authserver.conf pm2 start $HOME/server/bin/worldserver --name worldserver -- -c $HOME/server/etc/worldserver.conf eval "$(pm2 startup | grep sudo)" pm2 save pm2 attach $(pm2 id worldserver | tr -d '[][:space:]') ``` -------------------------------- ### Install base-devel and git on Arch Linux Source: https://www.azerothcore.org/wiki/arch-linux Installs essential development tools required for building AUR packages. Use this command before attempting to install AzerothCore from AUR. ```bash $ sudo pacman -S base-devel git ```