Setting up MaNGOS

来源:互联网 发布:ssh三大框架书籍知乎 编辑:程序博客网 时间:2024/05/19 04:51

 

This is a guide for setting up MaNGOS on Windows and Linux systems, and includes how to host over WAN.

Contents

  • 1 Windows
    • 1.1 Binaries and Configuration
    • 1.2 Maps, VMAPs and DBCs
    • 1.3 MySQL
    • 1.4 Linux setup

Windows

This guide is for 32-bit Windows with enUS World of Warcraft, it should work for 64-bit Windows and other World of Warcraft version, but some steps may vary.

Binaries and Configuration

After you are done compiling MaNGOS, you need to get the .conf files which hold all of the configuration. There are two .conf files, in src/mangosd/mangosd.conf.dist.in and src/realmd/realmd.conf.dist.in. When you copy this to your MaNGOS folder you need to get rid of the .dist.in on the end of both files. When you have the compiled binaries and the configuration files in the same folder, bin/win32_release, you can leave them there for easy updating of the core, or you can move them to another folder for easy access. If you are moving the server to another folder, you need to copy all the .dll, .exe and .pdb files over to the new folder long with the .conf files. 
"For Windows users The configuration files for the MaNGOS realm list and world server have been renamed and now can be found as realmd.conf.dist and mangos.conf.dist in the sources. Nothing else changed for you." -The Luda 09-22-2008

Maps, VMAPs and DBCs

Once you have these files in the desired folder, you need to get the Maps, DBCs and, if you want, Vmaps. To get the Maps and DBC you need to get the ad.exe file from /contrib/extractor. Here you will find many files, the one we need is called ad.exe. You need to copy this file to your World of Warcraft folder, commonly C:/Program Files/World of Warcraft or C:/Users/Public/Games/World of Warcraft. When the ad.exe file is in the World of Warcraft folder, execute it. It will run for a little while, usually takes under ten minutes. When its done it will automatically close, leaving two folders in the World of Warcraft folder, maps and dbc. You need to copy both of these folders to you MaNGOS folder

VMAPs are completely optional, and i would only recommend using them if you have a dedicated machine with at least 2 Gigabytes of RAM if your amount of players averages about 20 or so, higher you will need more RAM to make MaNGOS function properly with the least amount of lag. VMAPs are a special kind of map that help prevent NPCs from going through walls attacking the player. It will also check to see if the NPC can see the player before attacking. Beware however that VMAPs take a long time to extract and compile, sometimes over two hours, so I wouldn't recomend doing it on a computer with a slow CPU. To extract and compile VMAPs copy the contents of the /contrib/vmap_extract_assembler_bin to your [WOW]/Data/enUS/ folder and launch makevmaps_SIMPLE.bat. This will take a VERY long time. When its done there should be a folder called vmaps, you then need to copy this to the MaNGOS folder.

MySQL

Once done getting everything set up, we need to get a database to store the information needed by the server. For the MaNGOS MySQL is used. MySQL is a free database server that is very easy to use. First you need to download MySQL Server from here: http://dev.mysql.com/downloads/mysql/5.1.html#win32. The setup is pretty easy and straight forward.

High Population Fix for MySQL:
We have noticed that default settings in MySQL, are not sufficient for MaNGOS to run properly without crashes. Therefor we advice you to use the following settings in your my.cnf file. This file is mostly located in Linux "/etc/my.cnf" or "/etc/mysql/my.cnf". In Windows it might be in the MySQL installed folder.
Please note, that these settings are tested on a high populated server: 500 players, 8GB memory and 8 core server.


Restart your mysql and your ready for a flawless MaNGOS server !

Linux setup

I use Fedora linux so all commands will be for Fedora, use your distro's appropriate commands in place, services are usually in /etc/rc.d so check there when in doubt. Linux makes a perfect Mangos server because it was originally designed to run backend services, in addition once your server is setup you won't need to access it and can run it without X or a gui and you can setup your server (if it isn't your desktop as well) without a monitor/keyboard/mouse and just access it remote using ssh or a web interface.

After compiling and installing, the default is to install to /opt/mangos, you need to ensure that mysql is installed using what ever distro package manager and to start the mysql server. In Fedora use:

yum install mysql-gui* this will install all needed mysql tools including the client and server and sql browser and admin gui. Start a terminal and start the mysql server

service mysql start Navigate to your database scripts: mangos/sql and execute them in mysql:

mysql -u root < create_mysql.sql;
mysql -u root --database=mangos < mangos.sql;
mysql -u root --database=characters < characters.sql;
mysql -u root --database=realmd < realmd.sql

  • NOTE: Only use the --database=XXX flags if you're getting MySQL errors (i.e. "ERROR 1046 (3D000) at line 22: No database selected")

Afterwards you need to download whatever database content (UDB, Trinity, etc.) and install into

mysql -u root < world.sql (substitute with appropriate filename) Now the updates need to be installed from mangos/sql/updates, the easiest way is with this:

for sqlstatement in `ls *mangos*.sql`; do mysql -u root -D mangos < $sqlstatement; done; for sqlstatement in `ls *characters*.sql`; do mysql -u root -D characters < $sqlstatement; done; for sqlstatement in `ls *realmd*.sql`; do mysql -u root -D realmd < $sqlstatement; done;

Update your client to 3.3.2; extract the dbc and map files; insert into /opt/mangos/data or where you specify the data dir is located in the mangos.conf file. Secure your mysql databases by creating a user for your mangos server schemas. Edit your realmd.conf and mangos.conf to your liking; change the database settings to use the mangos user for mysql.

Open two terminals, start the realm server

cd /opt/mangos/bin; mangos-realmd

Start the world server in the other terminal

cd /opt/mangos/bin; mangos-worldd

 

 

原文地址: http://getmangos.com/wiki/Setting_up_MaNGOS

 

原创粉丝点击