Skip to content

Instantly share code, notes, and snippets.

@toast254
Created July 8, 2018 16:23
Show Gist options
  • Save toast254/418313e84803a7776a274962b6aae0ef to your computer and use it in GitHub Desktop.
Save toast254/418313e84803a7776a274962b6aae0ef to your computer and use it in GitHub Desktop.
# FROM debian:stable
# Install dependencies
apt-get update
apt-get install build-essential gcc g++ automake git-core autoconf make patch cmake libmysql++-dev mysql-server libtool libssl-dev binutils zlibc libc6 libbz2-dev subversion libboost-all-dev
# Create mangos user
useradd -m -d /home/mangos -c "MANGoS" -U mangos
su - mangos
cd ~
# Server repo
# Classic:
# git clone git://github.com/cmangos/mangos-classic.git mangos
# The Burning Crusade:
# git clone git://github.com/cmangos/mangos-tbc.git mangos
# Wrath of the Litch King:
# git clone git://github.com/cmangos/mangos-wotlk.git mangos
git clone git://github.com/cmangos/mangos-wotlk.git mangos
# Database repo
# Classic-DB
# git clone git://github.com/cmangos/classic-db.git
# TBC-DB
# git clone git://github.com/cmangos/tbc-db.git
# WotLK-DB
# git clone git://github.com/cmangos/wotlk-db.git
git clone git://github.com/cmangos/wotlk-db.git
# Compile server
mkdir -p run build
cd ~/build
cmake ~/mangos -DCMAKE_INSTALL_PREFIX=\/home/mangos/run -DPCH=1 -DDEBUG=0 -DBUILD_EXTRACTORS=ON -DBUILD_PLAYERBOT=ON
make
make install
cd ~
# Edit configuration files
# nano /home/mangos/mangos/run/*.conf
# Extract and copy maps, dbc and vmaps (optionally mmaps ) to /home/mangos/mangos/run
# cp maps dbc vmaps mmaps /home/mangos/mangos/run/
# Create Mangos database
mysql -uroot -p < ~/mangos/sql/create/db_create_mysql.sql
# Initialize Mangos database
mysql -uroot -p mangos < ~/mangos/sql/base/mangos.sql
# Initialize DBC data
# mysql -uroot -p mangos < ~/mangos/sql/base/dbc/*.sql
for sql_file in ls ~/mangos/sql/base/dbc/original_data/*.sql; do mysql -uroot -p --database=mangos < $sql_file ; done
for sql_file in ls ~/mangos/sql/base/dbc/cmangos_fixes/*.sql; do mysql -uroot -p --database=mangos < $sql_file ; done
# Initialize characters database:
mysql -uroot -p characters < ~/mangos/sql/base/characters.sql
# Initialize realmd database:
mysql -uroot -p realmd < ~/mangos/sql/base/realmd.sql
# Fill world database:
# cd classic-db, cd tbc-db OR cd wotlk-db (choose the one appliciaple to your situation)
cd ~/wotlk-db
./InstallFullDB.sh
nano ./InstallFullDB.config # Edit InstallFullDB.config : set CORE_PATH="/home/mangos/mangos"
./InstallFullDB.sh # if error : verify SCRIPT_FILE="./InstallFullDB.sh" and CONFIG_FILE="./InstallFullDB.config"
cd ~
# optionnal database
# mysql -uroot -p mangos < ~/mangos/sql/scriptdev2/scriptdev2.sql
# Update realm ip
# DELETE FROM realmlist WHERE id=1;
# INSERT INTO realmlist (id, name, address, port, icon, realmflags, timezone, allowedSecurityLevel)
# VALUES ('1', 'MaNGOS', '127.0.0.1', '8085', '1', '0', '1', '0');
# Configure WoW client : edit C:\World Of Warcraft\Data\enEN\realmlist.wtf
# set realmlist 127.0.0.1
# Run server
/home/mangos/mangos/run/bin/mangosd -c /home/mangos/mangos/run/etc/mangosd.conf -a /home/mangos/mangos/run/etc/ahbot.conf
/home/mangos/mangos/run/bin/realmd -c /home/mangos/mangos/run/etc/realmd.conf
# optionnal : start server at boot
# create file /home/mangos/cmangos-launcher.sh
# exec screen -dmS mangosd /home/mangos/mangos/run/bin/mangosd -c /home/mangos/mangos/run/etc/mangosd.conf -a /home/mangos/mangos/run/etc/ahbot.conf
# exec screen -dmS realmd /home/mangos/mangos/run/bin/realmd -c /home/mangos/mangos/run/etc/realmd.conf
# define a cron task
# @reboot /bin/bash /home/mangos/cmangos-launcher.sh
# Create account
account create [username] [password]
# Configure expansions of an user
account set addon [username] [0 to 3]
# Configure GM level of an user
account set gmlevel [username] [0 to 3]
# Shutdown server
.server shutdown [delay]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment