Mangos Development - Part 0

MaNGOS Development series

Installing a MaNGOS server on Windows

the no-pain version


This tutorial follows the steps on getMangos Wiki


Description


After a couple of hours of installing my first MaNGOS server, following the getMangos Wiki tutorial, I've decided to make another tutorial, similar, but not missing any important step
This tutorial will explain how to install MangosOne on a Windows Server OS. I will try and explain every detail so stay close

Goals


A Mangos Server that supports TBC expansion of the World of Warcraft Game that will be running on your computer's localhost address. You will be able to connect to the server from your WoW client on the same computer

Preparation


You will need:
  • Time
  • A Windows Server installed (see how)
Then, on that OS:
  • MySQL Community Server installed (see how)
  • SQLyog Community Edition installed (see how)
  • GIT installed (see how)
  • A World of Warcraft The Burning Crusade client
  • Visual Studio 2012 (see how)

Installations


Step 1 - Windows Server

  • Install your version of Windows Server. I used Windows Server 2008 R2 Standard, you can download this or this, remember to choose either x86(32-bit) or x64(64-bit) according to your system
  • Burn the ISO file to a DVD and boot from it
  • Make a partition on your disk if possible and install Windows on it
  • Write down your Windows login and password during setup
  • Update Windows by Windows Update, including installing and upgrading drivers, if any

Step 2 - MySQL, SQLyog, GIT

Once you have Windows running and rolling, it's time to fill it with some more programs

Step 3 - Database Setup

  1. Start the MySQL server and leave it running
  2. Open SQLyog and create a new connection, enter "Mangos Server" as a name for the connection and enter your SQL root password then click connect
  3. On the left, click on "root@localhost" and select "Create Database", then type "Mangos" in the name field then click "Create"
  4. Create 3 more databases named: "Characters", "Realmd" and "ScriptDev2"
  5. You can also do this in MySQL WorkBench if it is installed, but better stay with me
  6. Mangos, Characters, Realmd and ScriptDev2 are the databases containing tables that will be used my your MaNGOS server

Step 4 - Downloading the MaNGOS Source Code

  1. Create 2 new folders named "MangosSource" and "Mangos\data" in your C drive so we have C:\MangosSource and C:\Mangos\data
  2. Right click on the folder MangosSource and select "Git Bash Here" or if there is no options like that: open Git Bash and change directory to C:\MangosSource, e.g. cd C:\MangosSource
  3. In the git bash, type:
    git clone git://github.com/mangosone/server.git mangos
    cd mangos/src/bindings
    git clone git://github.com/mangosone/scripts.git scripts 
  4. Wait until cloning is finished
  5. Do not leave Git Bash

Step 5 - Downloading and Importing the Database

  1. In the directory mangos\src\bindings in Git Bash, type
    git clone git://github.com/mangosone/database.git MangosDB 
  2. Wait until cloning is finished
  3. Now change current directory to mangos/src/bindings/MangosDB/_tools and type
    make_fulldb.sh
    mysql -u root -p mangos < full_db.sql
  4. Change to diectory mangos/src/bindings/scripts/sql and type
    mysql -u root -p mangos < mangos_scriptname_clear.sql
    mysql -u root -p mangos < mangos_scriptname_full.sql
    mysql -u root -p scriptdev2 < scriptdev2_create_structure_mysql.sql
    mysql -u root -p scriptdev2 < scriptdev2_script_full.sql
  5. Go to SQLyog and check the mangos and scriptdev2 database you created whether it contains tables such as "account" etc.
  6. Click on realmd database and leave SQLyog open
  7. Open the folder C:\Mangos\sql and look for a file called realmd.sql. Open it in notepad, copy the whole content and paste it to the query window of SQLyog, then CTRL+A and click on Execute Query (F9), this will populate the realmd database, making tables like "realmlist" etc. Double check it

Step 6 - Extracting Game data

  1. Navigate to directory C:\MangosSource\contrib\extractor_binary and copy all the files to your WoW folder, eg. C:\World of Warcraft
  2. Open Windows Command prompt (click on Start menu, type "cmd" and press enter) then navigate to C:\World of Warcraft
  3. Type:
    ad.exe
    vmapExtractor.exe
    mkdir vmaps
    vmap_assembler.exe Buildings vmaps
  4. You can delete the Buildings folder or leave it like that
  5. Select folders "dbc", "maps", "vmaps" and move them to C:\Mangos\data

Step 7 - MaNGOS Compilation

  1. Go to folder C:\MangosSource\win then open file mangosVC110.sln, this will open MS Visual Studio. Wait for it to load
  2. On the toolbars, change the Run option to Release
  3. Menu -> Build -> Rebuild Solution
  4. When this is done, you will get a message in the console
    "Rebuild All: 12 succeeded, 0 failed, 0 skipped"
  5. Close MS Visual Studio
  6. Go to folder C:\MangosSource\src\bindings\scripts and open the file scriptVC110.sln, change to Release build and run Rebuild Solution like before
  7. Open folder C:\MangosSource\bin\release and copy all those files to C:\Mangos
  8. Copy these files
    C:\MangosSource\src\mangosd\mangosd.conf.dist.in
    C:\MangosSource\src\realmd\realmd.conf.dist.in
    C:\MangosSource\src\bindings\scripts\scriptdev2.conf.dist.in
    to C:\Mangos then rename those files so they don't have .dist.in

Step 8 - MaNGOS Configuration

  1. Open mangosd.conf in notepad
  2. Change these lines:
    DataDir = "."
    
    LoginDatabaseInfo = "127.0.0.1;3306;mangos;mangos;realmd"
     
    WorldDatabaseInfo = "127.0.0.1;3306;mangos;mangos;mangos"
    
    CharacterDatabaseInfo = "127.0.0.1;3306;mangos;mangos;characters"
                    
    to
    DataDir = "C:\Mangos\Data"
    
    LoginDatabaseInfo = 127.0.0.1;3306;root;=ROOTPASSWORD=;realmd"
    
    WorldDatabaseInfo = "127.0.0.1;3306;root;=ROOTPASSWORD=;mangos"
    
    CharacterDatabaseInfo = "127.0.0.1;3306;root;=ROOTPASSWORD=;characters"
    
  3. Open realmd.conf in notepad
  4. Change this line:
    LoginDatabaseInfo = "127.0.0.1;3306;mangos;mangos;realmd"
    to
    LoginDatabaseInfo = "127.0.0.1;3306;root;=ROOTPASSWORD=;realmd"
  5. Open scriptdev2.conf in notepad
  6. Change this line:
    ScriptDev2DatabaseInfo = "127.0.0.1;3306;mangos;mangos;scriptdev2"
    to
    ScriptDev2DatabaseInfo = "127.0.0.1;3306;root;=ROOTPASSWORD=;scriptdev2"
  7. Now go back to SQLyog and open the database realmd then open the " realmlist" table and change the value "MaNGOS" in the name column to "MyWow" as the name of your realm then save the database. Leave SQLyog open.
  8. Now go back to command prompt and navigate to C:\Mangos and then type realmd.exe and you will see that the server has added a realm called "MyWow"
  9. Type mangosd.exe and check for lines like
    [A] You have: --> `10973_01_mangos_game_event_mail.sql`
    
    [B] You need: --> `10998_01_mangos_spell_proc_event.sql`
  10. Now you need to update the MaNGOS database to the current version. Open folder C:\MangosSource\mangos\sql\updates and look for files as in the previous step [A] and [B]. Open the [A] file in notepad, copy the whole content and paste it to SQLyog Query window and run those queries. Do the same to the [B] file.
  11. Go back to command prompt and run "mangosd.exe", this should run without any failures. Now your server is running

Step 9 - Make some accounts

  1. In the mangosd.exe window (mangos prompt) you can type some commands
  2. Type account create myAccount myPassword, this will create an account called "myAccount" with password "myPassword"
  3. Now you have to set the expansion permission to this account
  4. Type account set addon myAccount 2, number 2 means "TBC"
  5. If you want that account to be a GM account, type account set gmlevel myAccount 3

Step 10 - Set the realmlist and test your server

  1. Open your WoW client folder and look for realmlist.wtf, open it in notepad and change
    set realmlist ...
    to
    set realmlist 127.0.0.1
    or localhost
  2. Run WoW.exe and log in with myAccount and myPassword
  3. Create a character and enter the realm
  4. If everything goes smoothly then you are done
  5. From now on, you only have to run mangosd.exe in order to start the server

Comments

Popular Posts