Posted on 2012-07-24 10:35
點點滴滴 閱讀(1209)
評論(0) 編輯 收藏 引用 所屬分類:
10 服務器
最近周末咸蛋,抽時間看了一下傳說中的開源WOW服務器模擬器,雖然只看了登陸認證這塊,但感觸頗多,興起隨便寫寫。
MaNGOS的介紹如下:
What is MaNGOS?
The mangos project is a full featured World of Warcraft server suite, including servers for authentication, client updates, world content serving, and battlegrounds. Additional features include tools to build and develop game content. It is compatible with client version 3.3.5a.
mangos is an educational project. This means, our primary interest is to learn and teach us and our users more about C++ project development in a large scale. Our software is not intended for running public servers, and we do not support that.
本篇所編譯的mangos版本是MaNGOS-Zero,對應的客戶端版本是1.12.1 (build 5875) ~ 1.12.2 (build 6005)。這是現在所能找到的最原始的版本,之所以選擇這個版式,因為想看看mangos“化妝前”的摸樣,從較早的版本開始看也是我的習慣。
主要的編譯過程和方法參照:http://hi.baidu.com/sunsee/blog/item/8b34f043238dd51972f05d15.html
client 1.12.1(build 5875)的下載地址是:http://thepiratebay.org/torrent/5158084/World_of_Warcraft_1.12.1_Full_Client___Patches
這里主要進行以下補充和一些注意事項的說明:
- 獲取代碼:使用git從下面給出的mangos、scripts和database三個連接里去獲取對應的代碼,沒有注冊登錄就直接用http下載可能不是最新的版本,導致程序版本和db版本對不上。“Looking for client 1.12.1 support? No need to hold your breath, there is a solution for you. mangos zero, an offspring project of mangos has your back covered. The server, the scripts, and the database are available. mangos zero has its' own forums, too”
- 檢查版本一致:下載完畢后對照/mangos-zero/src/shared/revision_sql.h文件里的三個宏:REVISION_DB_CHARACTERS、REVISION_DB_MANGOS、REVISION_DB_REALMD的值和所下載的database對應的表是否一致,分別對應:character/character_db_version、mangos/db_version、realmd/realmd_db_version
- DB版本:其實直接使用mangos-zero/sql目錄下的sql文件也是可以的,不需要單獨取database文件。
- 所需配置文件:realmd.exe、mangos.exe運行所需要的配置文件分別是mangosd.conf、realmd.conf、mods.conf、scriptdevzero.conf在mangos目錄下能找到以*.dist.in結尾的配置文件模板,拷貝并修改名字后即可使用。
- ScriptDev2:要放在src/binding目錄下,VS2010可以順利的編譯通過。VS2005要編譯Debug版沒有問題,編譯成Debug_NoPCH不能通過,不知道為什么?
- contrib:mangos/contrib目錄下是各種小工具及源碼,包括解壓maps的ad.exe,解壓vmaps的vmap_extractor。
- 解壓vmaps文件:將使用/contrib/vmap_extract_assembler_bin目錄下的所有文件拷貝到客戶端的根目錄,運行makevmaps_SIMPLE.bat即可。如果系統中存在兩個以上的WOW客戶端,則需要按照以下步驟進行:(a)使用-d參數指定目錄的位置,比如 vmapextractor3.exe -d Data 等待程序提取和分析map data;(b)然后再相同目錄下直接運行vmap_assembler.exe生成vmaps
配置文件說明:
(1)mangos.conf
- 看代碼時經常會設置斷點,為了不讓連接斷開可以將配置文件里的MaxOverspeedPings設置為0