So I have seen threads for Compiling mangos for windows but nothing for macs so i decided to make this guide to help the mac users of this forums. Also I make comments that you may not understand such as linking header files, etc if you have no idea what im talking about just ignore them and just follow the steps. Anything in code should be typed (or copied and pasted) into terminal unless otherwise told not too.
Step 1: Getting Required Dependencies
A. Use your Mac Osx Install disk to Install The Developers Tools on Your computer (ie. Xcode)
then click on optional installs folder:
double click on the xcodetools.mpkg:
and follow the directions to install Xcode:
B. Download the latest version of Mysql from this link and mount the image and double click the package labeled "mysql-X.X.XXb-x86.pkg" (the "X" means whatever version was downloaded) and follow the steps in the installer so that it successfully installs.
Now follow the instructions of the installer:
Step 2: Downloading Additional Files
A. Download and Install Mamp Which will allow for easy server startup right here
B. Mount the DMG by double clicking the the downloaded file.
C. Navigate To the mounted disk image and go inside the folder and drag the the folder called "MAMP" to you applications folder.
Step 3: Getting Mysql Set Up
A. Open Up MAMP.app in Applications->MAMP
B. Open Up Preferences -> Ports and change the Apache port to 80 and the mysql port to 3306.
C. Hit Start Servers and type in your root password if asked.
D. Open up terminal (/Applications/Utilities/Terminal.app) and type:
Code:
/Applications/MAMP/Library/bin/mysqladmin -u root -p password <New Password>
And of course change "New Password" to the password you want. (remember this password it will be needed to get your server up and running later on.)
Step 4: Downloading and Patching the Source From the SVN
A. Open up terminal (/Applications/Utilities/Terminal.app)
B. And type the following commands to download the source:
Code:
svn checkout https://mangos.svn.sourceforge.net/svnroot/mangos/trunk/ ~/source/mangos/
C. Now to change directorys to your source folder type:
D. To correctly compile mangos in Macosx you need to download the following patch by typing these commands. (Credits For the Patch to Sarina)
Code:
curl -#Of http://sarianightelf.googlepages.com/MaNGOS-r5333-OSX.diff
E. And then Patch The source:
Code:
patch -p0 < ./MaNGOS-r5333-OSX.diff
Step 5. Download and Patch Scriptdev2 Source Code:
A. Download Scriptdev2 via svn:
Code:
cd ./src/bindings/ScriptDev2
svn checkout https://scriptdev2.svn.sourceforge.net/svnroot/scriptdev2/
B. Patch Mangos So it Compiles the Scripts As Well:
Code:
patch -p0 < ./src/bindings/ScriptDev2/patches/MaNGOS-r5049-Scriptdev2.patch
Step 6. Downloading and Applying Additional Patches To Enhance Functionality:
Code:
svn checkout http://svn2.assembla.com/svn/mangarena/
Code:
patch -p0 < ./mangarena/arena.patch
(The Arena Patch is my personal favorite but additional patches can be downloaded and applied during this step as well.)
Step 7. Preparing Mysql For Compiling.
A. Include the path to mysql in your bash profile:
Code:
echo 'export PATH=:/usr/local/mysql/bin' >> ~/.bash_profile
source ~/.bash_profile
B. Create symbolic links to MySQL's header/library files:
Code:
sudo ln -s /usr/local/mysql/include/ /usr/local/include/mysql
sudo ln -s /usr/local/mysql/lib/ /usr/local/lib/mysql
sudo ln -s /usr/local/mysql/lib/ /usr/lib/mysql
Step 8. Compiling Mangos!
A. Make sure your working directory is your mangos source:
B. Build your auto config files:
Code:
autoreconf --install --force
C. Configure your source by typing (type this entire thing as one command):
Code:
./configure --prefix=/opt/mangos --enable-cli --enable-ra --datadir=/opt --sysconfdir=/opt/mangos/etc --with-debug-info LDFLAGS="-lcrypto -framework Carbon"
D. Making the Install
Your first try will fail with an error but don't panic go to: "your source folder"->mangos->src->shared and open up svn_revision.h with text edit and delete the "-h" at the top of the file and save... that should solve your problem and continue compiling
by typing:
E. Installing (it will ask for your password but you won't be able to see what you are typing so no your keyboard isn't broken just type the password and press enter):
Step 9. Downloading Map and DBC files.
A. Un-hiding your mangos folder:
Code:
defaults write com.apple.Finder AppleShowAllFiles 1
B. Download the Maps here and extract them to: "opt/mangos/"
C. Download the DBC files here
Step 10. Edit the Configuration Files found in /opt/mangos/etc/:
A. Mangosd.conf:
Open mangosd.conf with text edit and change this:
RealmID = 1
DataDir = "/opt/mangos"
LogsDir = ""
LoginDatabaseInfo = "127.0.0.1;3306;root;mangos;realmd"
WorldDatabaseInfo = "127.0.0.1;3306;root;mangos;mangos"
CharacterDatabaseInfo = "127.0.0.1;3306;root;mangos;characters"
MaxPingTime = 30
WorldServerPort = 8085
BindIP = "0.0.0.0"
to
RealmID = 1
DataDir = "/opt/mangos"
LogsDir = ""
LoginDatabaseInfo = "127.0.0.1;3306;root;
"Your Mysql Password";realmd"
WorldDatabaseInfo = "127.0.0.1;3306;root;"
"Your Mysql Password"";mangos"
CharacterDatabaseInfo = "127.0.0.1;3306;root;
"Your Mysql Password";characters"
MaxPingTime = 30
WorldServerPort = 8085
BindIP = "0.0.0.0"
That editing is the important part everthing else in the file doesn't have to be changed but if you want to change the drop rates or xp rates editing is required. It should be self explanitory just follow the comments surrounded in "#" and you should be able to figure it out.
B. Realmd.conf
Open up realmd.conf with text edit and change this:
LoginDatabaseInfo = "127.0.0.1;3306;root;mangos;realmd"
LogsDir = ""
MaxPingTime = 30
RealmServerPort = 3724
BindIP = "0.0.0.0"
PidFile = ""
LogLevel = 0
LogTime = 0
LogFile = ""
LogTimestamp = 0
LogFileLevel = 0
LogColors = ""
UseProcessors = 0
ProcessPriority = 1
RealmsStateUpdateDelay = 20
WrongPass.MaxCount = 0
WrongPass.BanTime = 600
WrongPass.BanType = 0
to
LoginDatabaseInfo = "127.0.0.1;3306;root;
"Your Mysql Password";realmd"
LogsDir = ""
MaxPingTime = 30
RealmServerPort = 3724
BindIP = "0.0.0.0"
PidFile = ""
LogLevel = 0
LogTime = 0
LogFile = ""
LogTimestamp = 0
LogFileLevel = 0
LogColors = ""
UseProcessors = 0
ProcessPriority = 1
RealmsStateUpdateDelay = 20
WrongPass.MaxCount = 0
WrongPass.BanTime = 600
WrongPass.BanType = 0
C. Scriptdev2.conf
Open scriptdev2.conf with text edit and change this:
ScriptDev2DatabaseInfo = "127.0.0.1;3306;root;mangos;scriptdev2"
to
ScriptDev2DatabaseInfo = "127.0.0.1;3306;root;
"Your Mysql Password";scriptdev2"
Step 11. Creating A Database:
A. Open the the application MAMP and click "start servers" (if both icons are green then they there started up correctly.)
A. Download navicat lite right here. and drag the application to your applications folder.
B. Open up navicat and click on "create a new connection" found in the toolbar and a button that looks like a computer with a green slash going through it. Name the connection anything you want and fill in the password field with your mysql password and click ok.
C. Double click on your connection and then go "connection" in the toolbar at the top of your screen and then click "execute batch file". Exicute the following files:
/"your source folder"/mangos/sql/characters.sql/
/"your source folder"/mangos/sql/mangos.sql/
/"your source folder"/mangos/sql/realmd/sql/
/"your source folder"/mangos/src/binding/ScriptDev2/sql/scriptdev2_structure.sql/
D. Download UDB to Your Source Folder:
Code:
svn checkout https://unifieddb.svn.sourceforge.net/svnroot/unifieddb/trunk/Full_DB/ ~/source/udb/
E. Execute the Following files by right clicking the database "mangos" and clicking execute batch file (first go to "your source folder"/udb/Full_DB/ and unpack the .rar)
/"your source folder"/udb/Full_DB/UDB_0.10.3_Core_6240_SD2_473.sql/
/"your source folder"/udb/358_corepatch_mangos_6241_to_6346.sql/
/"your source folder"/udb/358_updatepack_mangos.sql/
/"your source folder"/mangos/src/binding/ScriptDev2/sql/mangos_full_scripts.sql/
F. Execute the Following files by right clicking the database "characters" and clicking execute batch file
/"your source folder"/udb/358_corepatch_characters_6241_to_6346.sql/
Step 12. Starting Up The Server:
Navigate to /opt/mangos/bin/ and double click on "mangos-realmd" and "mangos-worldd" and if everthing goes well you should have a working mangos server... ON A MAC!!
to create an acount type in the mangos-worldd window:
Code:
create acountname password
then to allow burning crusade type:
and last to give that acount gm powers type:
Hope this guide is helpfull and if you have any issues feel free to reply and ill help as much as i can.