锘??xml version="1.0" encoding="utf-8" standalone="yes"?>
鏇存柊錛?/p>
鏇存柊鏂瑰紡錛?nbsp;
1.涓嬭澆setup.bat鏂囦歡鐩存帴鏇挎崲鍘熸枃浠訛紝鐒跺悗榪愯涓嬈etup.bat:
setup.bat涓嬭澆錛?nbsp;
閾炬帴錛?a target="_blank" style="text-decoration: none; box-sizing: border-box; color: #0c89cf;">http://pan.baidu.com/s/1mhPED6K
瀵嗙爜錛?6sx
2.涓嬭澆瀹屾暣vscode鍖咃細
瀹屾暣vscode涓嬭澆錛?nbsp;
鐧懼害浜戜笅杞介摼鎺ワ細http://pan.baidu.com/s/1dFt6uoL
瀵嗙爜錛歩s83
榪欐槸VSCode緙栧啓璋冭瘯c/cpp紼嬪簭鐨勪究鎼哄紡鑷姩閰嶇疆鐜銆?/p>
棣栨浣跨敤鍙屽嚮setup.bat榪涜鑷姩閰嶇疆錛屼互鍚庢瘡嬈℃墦寮VSCode.bat鍗沖彲銆?/strong>
setup.bat浼氬悜褰撳墠鐢ㄦ埛鐨勬枃浠跺す鍐呮嫹璐濅竴浜涙枃浠訛紙cpptool錛夌敤浜庨厤緗紝璇風‘淇濇嫢鏈夎凍澶熸潈闄愩?/p>
鍐呯疆鐨凱roject鏂囦歡澶逛負榛樿鐨勯」鐩枃浠跺す錛屽叾涓緗簡涓涓猦elloworld嫻嬭瘯紼嬪簭銆?/p>
鏈夌枒闂鑱旂郴Blackkitty
鐧懼害浜戜笅杞介摼鎺ワ細http://pan.baidu.com/s/1dFt6uoL
瀵嗙爜錛歩s83
閫昏緫灞傦細 綾籛orld瀹炵幇浜唚ow鐨刉orld錛屾墍鏈夌殑閫昏緫澶勭悊
銆銆MaNGOS 涓嬭澆錛岀紪璇戯紝閰嶇疆鍜岃繍琛岀殑鍩烘湰姝ラ 涓嬭澆鍜屽畨瑁卪sysgit錛岀敤浜庝唬鐮佺鐞嗘垜浣跨敤鐨勬槸Git-1.6.5.1-preview20091022.exe
銆銆涓嬭澆鍜屽畨瑁卼ortoisegit錛岀敤浜庝唬鐮佺鐞嗘垜浣跨敤鐨勬槸TortoiseGit-1.3.2.0-32bit.msi
銆銆浣跨敤git://github.com/mangos/mangos.git錛屼粠github鎻愬彇mangos浠g爜
銆銆閲囩敤Git GUI宸ュ叿鐨凜lone Existing Repository錛屽緱鍒?mangos浠g爜錛堟垜鐨勬槸9560錛屽畨瑁匲DB鍙傝冭繖錛?nbsp;
銆銆浣跨敤git://github.com/scriptdev2/scriptdev2.git錛屼粠github鎻愬彇scriptdev2浠g爜
銆銆閲囩敤Git GUI宸ュ叿鐨凜lone Existing Repository錛屽緱鍒?scriptdev2浠g爜.
銆銆緙栬瘧mangos鎴戠敤鐨勬槸VC9,鎵撳紑mangoswinmangosdVC90.sln榪涜鏋勯狅紝鏋勯犲畬鎴愬悗錛屼細寰楀埌mangosbinWin32_Debug鏂囦歡澶?nbsp;
銆銆緙栬瘧scriptdev2鎴戠敤鐨勬槸VC9,鎵撳紑mangoswinscriptdev2VC90.sln榪涜鏋勯狅紝鏋勯犲畬鎴愬悗錛屼細寰楀埌scriptdev2binWin32_Debug鏂囦歡澶逛篃鍙弬鑰?nbsp;
銆銆pandore
銆銆鎷瘋礉mangossrcmangosd鐩綍涓嬬殑mangosd.conf.dist.in涓簃angosbinWin32_Debugmangosd.conf
銆銆鎷瘋礉mangossrcrealmd鐩綍涓嬬殑realmd.conf.dist.in涓簃angosbinWin32_Debugrealmd.conf
銆銆浠巋ttp://www.wowtaiwan.com.tw/涓嬭澆鍜屽畨瑁呭彴鏈峎OW錛屽茍鍗囩駭鍒版渶鏂扮増鏈垜浣跨敤鐨勬槸鍙版湇WOW 3.3.2 build 11403
銆銆錛岄噰鐢∕aNGOS鐨勫伐鍏穉d浠巜ow鐨凪PQ涓娊鍙杕ap錛屽緱鍒扮殑鎵鏈夌殑map鏁版嵁鏂囦歡錛屾枃浠跺懡鍚嶈鑼冧負map_id錛?浣嶏級 tileY錛?浣嶏級 tileX錛?浣嶏級.map錛屽鏂囦歡鍚嶄負0002035.map錛屼唬琛ㄧ殑鏄疉zeroth(鍦板浘id涓?00錛宼ile鍧愭爣涓?35,20). 娉細WOW瀹㈡埛绔殑Tile瀵瑰簲mangos涓殑grid錛學OW瀹㈡埛绔殑Chunk瀵瑰簲mangos涓殑cell(1cell = 4 chunk)
銆銆鎸夌収甯歌嫻佺▼錛堝寘鎷緩绔嬫暟鎹簱鍜岄厤緗湇鍔″櫒錛夋妸鏈嶅姟鍣ㄨ窇璧鋒潵錛屼嬌鐢╝ccount create zzh1234567 zzh1234567 鍒涘緩涓涓處鍙鳳紝浣跨敤account set gmlevel zzh1234567 3璁劇疆涓鴻秴綰х敤鎴?nbsp;
銆銆閰嶇疆濂藉鎴風鍚庯紝榪愯WOW錛岄『鍒╃櫥闄嗭紝鍛靛懙
銆銆閫氳繃瀹夎UDB鏉ヤ赴瀵屽満鏅疐ULL DB 9560 : HERE錛屽弬鑰冭繖錛屽湪鎴戝畨瑁匘B9560鐨勬椂鍊欙紝鍙戠幇Mangos鍦↙oadCreatureAddons鐨勬椂鍊欙紝鍔犺澆creature template addons鍑洪敊錛孧angos鍙姹俢reature template addons鏈?涓瓧孌碉紝鑰宑reature template addons鏈?涓瓧孌墊垜鐜板湪鍙槸綆鍗曞湴璺寵繃LoadCreatureAddons鐨勮皟鐢?nbsp;
銆銆
榪愯Mangos 錛堣繍琛孧angos涓鑺傝繃鏈燂紝鏄互鍓嶆垜閽堝鍥芥湇3.1.3鐗堟湰榪涜鐨勫畨瑁呴厤緗級 錛岄噰鐢∕aNGOS鐨勫伐鍏穉d浠巜ow鐨凪PQ涓娊鍙杕ap錛屽緱鍒扮殑鎵鏈夌殑map鏁版嵁鏂囦歡錛屾枃浠跺懡鍚嶈鑼冧負map_id錛?浣嶏級 tileY錛?浣嶏級 tileX錛?浣嶏級.map錛屽鏂囦歡鍚嶄負0002035.map錛屼唬琛ㄧ殑鏄疉zeroth(鍦板浘id涓?00錛宼ile鍧愭爣涓?35,20). 娉細WOW瀹㈡埛绔殑Tile瀵瑰簲mangos涓殑grid錛學OW瀹㈡埛绔殑Chunk瀵瑰簲mangos涓殑cell(1cell = 4 chunk)
銆銆閰嶇疆濂藉鎴風鍚庯紝榪愯WOW錛岄『鍒╃櫥闄嗭紝鍛靛懙
銆銆
Mangos浠g爜闃呰
銆銆Mangos鏈?3涓伐紼?nbsp;
銆銆浣跨敤浜?涓閮ㄥ伐鍏峰簱錛屽垎鍒槸錛?璺ㄥ鉤鍙扮殑緗戠粶閫氳妗嗘灦The ADAPTIVE Communication Environment (ACE)
銆銆鍘嬬緝搴搝lib
銆銆Socket閫氫俊搴?C++ Sockets Library (浣跨敤鍦╮ealmd宸ョ▼涓紝鍜屼嬌鐢ㄥ湪Mangosd宸ョ▼涓殑RASocket錛岃礋璐e鐞哛emote Administration鍏朵粬鍦版柟娌℃湁浣跨敤鍒拌繖涓狢++ Sockets Library 錛夊彂鐜板湪C++ Sockets Library鐨凾cpSocket::Open涓瓨鍦ㄤ竴涓棶棰橈紝鍦╪ = connect(s, ad, ad);璇彞鎵ц鍚庯紝濡傛灉n=-1錛孋++ Sockets Library浼氭嫻嬫槸鍚RR涓篧SAEWOULDBLOCK錛屽惁鍒欒〃紺烘垚鍔燂紝浣嗗湪鍔ㄦ佸簱涓嬌鐢═cpSocket鐨勬椂鍊欙紝鎴戝彂鐜皀 = connect(s, ad, ad);璇彞鎵ц鍚庯紝n=-1錛孍RR浼氫負0錛岃繖涓椂鍊欒繛鎺ヤ篃鏄垚鍔熶簡錛屼絾TcpSocket::Open浼氬綋鍋氫笉鎴愬姛澶勭悊鎴戝彂鐜拌繖涓棶棰橈紝浣嗘病鏈夋椂闂村幓鎺㈢┒鍘熷洜錛屼篃璁稿茍涓嶆槸涓涓棶棰?nbsp;
銆銆C++鐨勫茍琛岀紪紼嬫ā鏉垮簱Threading Building Blocks 錛坱bb 鍜?tbbmalloc錛?nbsp;
銆銆Mangos鐨勫疄鐜板垎涓猴細鐧誨綍鏈嶅姟鍣紙realmd錛夊拰涓栫晫鏈嶅姟鍣紙mangosd+game錛塺ealmd鍜宮angos鍏辯敤浜哅angos鍏叡搴擄紙shared錛?nbsp;
銆銆宸ョ▼shared
銆銆鎻愪緵浜嗛氱敤鍔熻兘錛屽寘鎷簡鏁版嵁搴撶殑灝佽綾伙紝瀹炵幇浜嗗MySql鐨勮闂紝鍚屾牱錛屾垜浠彲浠ョ紪鍐欐淳鐢熺被鏉ユ敮鎸佸叾浠栫殑鏁版嵁搴?nbsp;
銆銆宸ョ▼script
銆銆鎻愪緵浜嗚剼鏈帴鍙o紝騫跺疄鐜頒簡綆鍗曠殑鍑犱釜鑴氭湰錛屽皝瑁呬負DLL錛屾彁渚涚粰game浣跨敤錛屽叿浣撳彲鍙傝冿細MaNGOS鑴氭湰鎺ュ彛
銆銆閫氳繃浣跨敤涓嶅悓鐨勮剼鏈珼LL鏉ユ浛鎹hare鐨勮繖涓狣LL,鍙互璁ゞame鍏鋒湁鏇村己鐨凙IScriptDev2 灝辨槸涓涓繖鏍風殑搴揝criptDev2 is a replacement for the Script Library that comes with MaNGOS( http://www.getmangos.com ) written in C++ and is compatible with Windows and Linux. It provides scripts for NPCs, Boss events, and Items currently. On
銆銆
宸ョ▼mangosd
銆銆mangos鏄笘鐣屾湇鍔″櫒鐨勭鐞嗗櫒錛岃礋璐e垵濮嬪寲宸ヤ綔鍜屽惎鍔ㄤ笘鐣屾湇鍔″櫒鍚勫眰鐨勭嚎紼嬶紝榪欎簺宸ヤ綔涓昏鏄敱綾籑aster鏉ュ疄鐜板叿浣撴槸錛?浣跨敤涓変釜鏁版嵁搴撳璞orldDatabase鍜孋haracterDatabase鍜宭oginDatabase錛屽垵濮嬪寲涓夊ぇ鏁版嵁搴擄細World Database鍜孋haracter Database鍜宭ogin Database錛屽茍涓烘瘡涓暟鎹簱鐨勮闂兘鍚姩涓涓狣B delay threads鍏蜂綋鐨勬暟鎹簱鎿嶄綔鍔熻兘閮芥槸鐢盡angos鍏叡搴搒hared鏉ユ彁渚?nbsp;
銆銆璋冪敤sWorld.SetInitialWorldSettings錛屽World榪涜鍒濆鍖栵紝鍖呮嫭鍔犺澆鎵鏈夌殑娓告垙鏁版嵁鍜屽垵濮嬪寲鍚勭鏇存柊瀹氭椂鍣ㄥ拰閭歡瀹氭椂鍣紝榪樻湁浜涘叾浠栫殑鍒濆鍖栧伐浣滅被World鐨勬垚鍛樺嚱鏁癝etInitialWorldSettings璋冪敤鎴愬憳鍑芥暟LoadConfigSettings瑙f瀽mangosd.conf錛岃В鏋愬悗鍐呭鏀懼叆uint32 m_configs[CONFIG_VALUE_COUNT]涓?nbsp;
銆銆鍔犺澆鐨勬父鎴忔暟鎹湁錛?nbsp;
銆銆DBC鏁版嵁
銆銆Objects鏁版嵁
銆銆Spells鏁版嵁
銆銆Pooling鏁版嵁
銆銆Game Event鏁版嵁
銆銆loot鏁版嵁
銆銆鎶鑳芥暟鎹?nbsp;
銆銆鎵鏈夊叾浠栫殑娓告垙鏁版嵁錛屽寘鎷琖aypoints鍜孴rainers絳夌瓑絳?nbsp;
銆銆鑴氭湰鏁版嵁
銆銆鍏朵粬鐨勫垵濮嬪寲宸ヤ綔鏈?
銆銆鍒濆鍖朚apManager錛屽惎鍔∕ap System
銆銆鍒濆鍖朆attlegrounds錛屽惎鍔˙attleGround System
銆銆鍒濆鍖朌ailyQuestResetTime
銆銆鍒濆鍖杝GameEventMgr錛孲tarting Game Event system
銆銆綾籑aster鍚姩WorldRunnable錛屽紑濮嬫父鎴忛昏緫Heartbeat for the World錛岀敱Master鍒涘緩錛屽茍璁劇疆綰跨▼涓烘渶楂樹紭鍏堢駭
銆銆綾籑aster鍚姩CliRunnable錛欳ommand Line Interface handling thread錛岀敱Master鍒涘緩CliRunnable榪愯鏃跺欎細鐢熸垚涓涓猈orldDatabase綰跨▼錛屽湪鎺ユ敹鍒拌緭鍏ュ悗浼氳皟鐢╯World.QueueCliCommand鎶奀md鏀懼叆鍒癢orld::cliCmdQueue涓?nbsp;
銆銆mangosd鐨勭嚎紼嬫誨叡鏈夛紙1+3+1+1+1+2 +1 =10錛?0涓嚎紼?涓葷嚎紼婱aster
銆銆2涓綉緇滅嚎紼婻eactorRunnable錛堝彲閰嶇疆鏁扮洰錛夛紙緗戠粶灞傦級
銆銆涓涓猈orld綰跨▼錛堥昏緫灞傦級
銆銆涓変釜DB綰跨▼錛堟暟鎹眰錛?nbsp;
銆銆涓涓狢LI綰跨▼錛堣緭鍏ュ眰錛夛紝榪愯鏃跺欎細鐢熸垚涓涓猈orldDatabase綰跨▼
銆銆涓涓猂A綰跨▼錛堢鐞嗗眰錛?nbsp;
銆銆涓涓猣reeze catcher 綰跨▼錛堝彲閫夛級
銆銆宸ョ▼g3dlite錛氭父鎴忛昏緫灞傜殑搴曞眰搴?nbsp;
銆銆宸ョ▼framework錛氱郴緇熸鏋?nbsp;
銆銆宸ョ▼realm
銆銆璐熻矗鐧婚檰鍜岄夋嫨娓告垙鏈嶅姟鍣紝榪涜璐熻澆鍧囪 鐢ㄥ埌浜咰++ Sockets Library榪涜鐧誨綍澶勭悊錛岄噰鐢╯elect I/O妯″瀷瀹炵幇浜哤ow, Mangos鐧誨綍鏃剁殑SRP6璁よ瘉瀹㈡埛绔綔涓哄畠鐨刢lient榪炴帴鍒皉ealm server璁よ瘉鍜岄夋嫨浜唌angos server灝辨柇寮 鑰宮angos server鍜宺ealm server鍒欎笉榪涜榪炴帴錛屽彧鏄氳繃鏁版嵁搴撲氦浜掓暟鎹細mangos server鎶婅嚜宸辯殑鐘舵佸拰鎷ユ湁鐨勮鑹叉暟鏀懼叆搴撲腑realm server浼氳鍙栨暟鎹簱涓殑榪欎簺淇℃伅鏉ヨ幏鐭angos server鐨勭姸鎬?鏁版嵁搴搑ealm鐨剅ealmlist琛ㄤ繚瀛樹簡realm鐨勫垪琛?nbsp;
銆銆realm閫氳繃濡備笅浜嬩歡澶勭悊鍑芥暟鏉ヨ礋璐g櫥闄嗗拰閫夋嫨娓告垙鏈嶅姟鍣?nbsp;
銆銆const AuthHandler table[] =
銆銆{
銆銆{ AUTH_LOGON_CHALLENGE, STATUS_CONNECTED, &AuthSocket::_HandleLogonChallenge },
銆銆{ AUTH_LOGON_PROOF, STATUS_CONNECTED, &AuthSocket::_HandleLogonProof },
銆銆{ AUTH_RECONNECT_CHALLENGE, STATUS_CONNECTED, &AuthSocket::_HandleReconnectChallenge},
銆銆{ AUTH_RECONNECT_PROOF, STATUS_CONNECTED, &AuthSocket::_HandleReconnectProof },
銆銆{ REALM_LIST, STATUS_AUTHED, &AuthSocket::_HandleRealmList },
銆銆{ XFER_ACCEPT, STATUS_CONNECTED, &AuthSocket::_HandleXferAccept },
銆銆{ XFER_RESUME, STATUS_CONNECTED, &AuthSocket::_HandleXferResume },
銆銆{ XFER_CANCEL, STATUS_CONNECTED, &AuthSocket::_HandleXferCancel }
銆銆}; 鐧誨綍澶勭悊錛?nbsp;
銆銆user鐧誨綍鍒皉ealm server榪涜韜喚璁よ瘉錛屽茍閫夋嫨鐧誨綍涓婂摢涓猰angos serveruser鐧誨綍鍒癿angos server鍚庯紝灝嗕笉鍐嶅拰realm server浜や簰
銆銆鍙傝冿細 Wow 鏈嶅姟鍣ㄨВ鏋?nbsp;
銆銆宸ョ▼game
銆銆game錛氭槸Mangos鐨勬牳蹇冧唬鐮侊紝緗戠粶灞傚拰閫昏緫灞備唬鐮?閲囩敤浜咥CE鍙嶅簲鍣?Reactor)妯″紡錛?nbsp;
銆銆緗戠粶灞傦細 WorldSocket 錛氳礋璐g綉緇淚O,鑰岀被WorldSession璐熻矗閫昏緫澶勭悊WorldSocket鍜學orldSession鍒嗗埆鍦ㄧ嫭绔嬬殑綰跨▼ReactorRunnable鍜學orldRunnable涓繍琛岋紝浣跨敤WorldSession涓殑娑堟伅闃熷垪_recvQueue鏉ヨ繘琛屾暟鎹紦鍐插湪WorldSocket鎺ユ敹鍒扮綉鍜緭鍏ュ悗錛屼細璋冪敤m_Session->QueuePacket (new_pct);鎶婄綉緇滃寘鏀懼叆WorldSession鐨刜recvQueue鎵浠ワ紝鍙互鐪嬪埌WorldSocket 鏄疢angos game鐨勭綉緇滃眰錛岃學orldSession鏄昏緫澶勭悊灞俉orldSocketMgr鏄綉緇滃眰鐨勪竴涓鐞嗗櫒錛屽畠璐熻矗鎸囨淳WorldSocket褰掑摢涓猂eactorRunnable綆$悊錛圡angos鍙垱寤哄涓猂eactorRunnable錛岀己鐪佹槸2涓級
銆銆WorldSocketMgr錛圡anages all sockets connected to peers and network threads錛夌鐞嗘墍鏈夌殑榪炴帴WorldSocketWorldSocketMgr鐨刉orldSocketMgr::StartNetwork瀵?085錛堢己鐪侊級绔彛榪涜渚﹀惉閫昏緫澶勭悊鐨勫驚鐜槸鍦╓orld::Update涓驚鐜鐞嗗寘鎷細
銆銆鍒鋒柊鏇存柊瀹氭椂鍣?nbsp;
銆銆鍒鋒柊娓告垙瀹氭椂鍣ㄥ拰澶勭悊娓告垙鍏抽棴
銆銆澶勭悊鏃ュ父浠誨姟
銆銆澶勭悊鎷嶅崠
銆銆鍒鋒柊SessionsWorld::UpdateSessions浼氳皟鐢ㄦ墍鏈塛orldSession鐨刉orldSession::Update鍦╓orldSession::Update涓繘琛岄昏緫澶勭悊
銆銆澶勭悊澶╂皵
銆銆鍒鋒柊uptime table
銆銆鍒鋒柊Objects錛屽寘鎷琺aps錛宼ransport錛宑reatures錛岋紝錛岋紝
銆銆鍒鋒柊鎵鏈塺unning battlegrounds
銆銆鍒鋒柊SqlResultQueue, 閫昏緫灞傚拰鏁版嵁灞傛槸閫氳繃Queue鏉ヨ繘琛屽紓姝ユ搷浣滅殑錛堢敤浜咥syncPQuery鍜孲qlResultQueue錛?nbsp;
銆銆澶勭悊灝鎬綋縐婚櫎
銆銆澶勭悊娓告垙浜嬩歡
銆銆澶勭悊 Move all creatures with "delayed move" and remove and delete all objects with "delayed remove"
銆銆澶勭悊InstanceSaveManager鐨勫埛鏂?nbsp;
銆銆璋冪敤World::ProcessCliCommands錛屽鐞咰LI浠巆liCmdQueue鍙栧緱cmd榪涜瑙f瀽鎵ц鎵鏈夋湁鏁堢殑Cmd錛岄兘鍙互鍦–hatHandler::getCommandTable涓壘鍒?nbsp;
銆銆綾籛orldSession錛?綾籛orldSession璐熻矗閫昏緫澶勭悊
銆銆void WorldSession::SendPacket(WorldPacket const* packet) 璐熻矗鍙戝寘緇欏鎴風錛岀洿鎺ュ彂鍖咃紝娌℃湁杈撳嚭緙撳啿闃熷垪
銆銆鍦╓orldSession::Update涓繘琛岄昏緫澶勭悊World::UpdateSessions浼氳皟鐢ㄦ墍鏈塛orldSession鐨刉orldSession::Update
銆銆鎵ц璇彞OpcodeHandler& opHandle = opcodeTable[packet->GetOpcode()];寰楀埌opHandle
銆銆鏍規嵁寰楀埌鐨刼pHandle錛屾墽琛?this->*opHandle.handler)(*packet);
銆銆WorldSession::HandlePlayerLogin澶勭悊鐜╁鐧婚檰娓告垙
銆銆鏋勫緩Player
銆銆Player::LoadFromDB浠庢暟鎹簱涓姞杞界帺瀹舵暟鎹湪Player::LoadFromDB涓細璋冪敤SetMap(MapManager::Instance().CreateMap(GetMapId() , this));鍔犺澆褰撳墠player鎵鍦ㄧ殑map
銆銆Player::SetPosition鍦≒layer榪愬姩鐨勬椂鍊欙紝鏀瑰彉浣嶇疆錛屼繚瀛樺鐞嗗じ鍖?nbsp;
銆銆綾籑ap瀹炵幇浜嗕竴涓猻tate machine錛岄噰鐢╯tate pattern緇勭粐浜咷id鐨?涓猻tate object錛欼nvalidState錛汚ctiveState錛汭dleState錛汻emovalState
銆銆game涓殑綆$悊鍣ㄦ湁錛?ObjectMgr
銆銆mMangosStringLocaleMap 鍏寵仈鍒癿angos_string table
銆銆m_scriptNames 鍏寵仈鍒皌ables: creature_template;gameobject_template;item_templat e;areatrigger_scripts;instance_template
銆銆mCreatureLocaleMap 鍏寵仈鍒發ocales_creature table
銆銆mGameObjectLocaleMap鍏寵仈鍒發ocales_gameobject table
銆銆mItemLocaleMap鍏寵仈鍒發ocales_item table
銆銆mQuestLocaleMap –> locales_quest
銆銆mNpcTextLocaleMap –> locales_npc_text
銆銆mPageTextLocaleMap –> locales_page_text
銆銆mGossipMenuItemsLocaleMap –> locales_gossip_menu_option
銆銆mPointOfInterestLocaleMap –> locales_points_of_interest
銆銆…
銆銆瀵硅薄綾誨眰嬈?nbsp;
銆銆瀵硅薄鐨勭被灞傛濡備笅錛屾墍鏈夌殑Object閮界敱ObjectMgr榪涜綆$悊ObjectMgr浠UID鏂瑰紡錛岀鐞嗕簡characters錛宑reature錛宨tem_instance錛実ameobject錛宎uctionhouse錛宮ail錛宨tem_text錛宑orpse錛宎rena_team錛宑haracter_equipmentsets
銆銆
銆銆
銆銆
銆銆
銆銆
Player鐘舵?nbsp;
銆銆/// Player state
銆銆enum SessionStatus
銆銆{
銆銆STATUS_AUTHED = 0, ///< Player authenticated (_player==NULL, m_playerRecentlyLogout = false or will be reset before handler call, m_GUID have garbage)
銆銆STATUS_LOGGEDIN, ///< Player in game (_player!=NULL, m_GUID == _player->GetGUID(), inWorld())
銆銆STATUS_TRANSFER, ///< Player transferring to another map (_player!=NULL, m_GUID == _player->GetGUID(), !inWorld())
銆銆STATUS_LOGGEDIN_OR_RECENTLY_LOGGOUT, ///< _player!= NULL or _player==NULL && m_playerRecentlyLogout, m_GUID store last _player guid)
銆銆STATUS_NEVER ///< Opcode not accepted from client (deprecated or server side on
銆銆};
銆銆鐢熺墿鐘舵?nbsp;
銆銆enum DeathState
銆銆{
銆銆ALIVE = 0,
銆銆JUST_DIED = 1,
銆銆CORPSE = 2,
銆銆DEAD = 3,
銆銆JUST_ALIVED = 4,
銆銆DEAD_FALLING= 5
銆銆};
銆銆鐜╁鐧婚檰
銆銆鏈嶅姟鍣ㄧ鍦ㄨ繛鎺ユ墦寮鍚庯紝浼氬彂SMSG_AUTH_CHALLENGE鍒板鎴風瀹㈡埛绔粠鏈嶅姟鍣ㄧ鍙戦佸洖鏉ョ殑縐嶅瓙鍜?SRP6 鏁版嵁涓駭鐢熼殢鏈虹瀛愶紝鐢熸垚 SHA1 瀛楃涓詫紝鐢ㄨ繖浜涙暟鎹敓鎴?CMSG_AUITH_SESSION 鏁版嵁鍖咃紝鍙戦佺粰鏈嶅姟绔繖涓繃紼嬫槸娌℃湁緇忚繃鍔犲瘑鐨?nbsp;
銆銆
銆銆瀹㈡埛绔彂閫丼MSG_AUTH_SESSION鍒版湇鍔″櫒
銆銆鏈嶅姟鍣ㄥ鐞哠MSG_AUTH_SESSION
銆銆鏈嶅姟鍣ㄥ彂閫丼MSG_AUTH_RESPONSE緇欏鎴風
銆銆鏈嶅姟鍣ㄥ彂閫丼MSG_ADDON_INFO緇欏鎴風
銆銆鏈嶅姟鍣ㄥ彂閫丼MSG_CLIENTCACHE_VERSION緇欏鎴風
銆銆鏈嶅姟鍣ㄥ彂閫丼MSG_TUTORIAL_FLAGS緇欏鎴風
銆銆packet緇撴瀯 SMSG_AUTH_SESSION 鏄痗lient packet鏈変竴涓ご閮紙ClientPktHeader錛夛紝鍚庨潰鏄暟鎹潡
銆銆SMSG_AUTH_RESPONSE 鏄痵erver packet鏈変竴涓ご閮紙ServicePktHeader錛夛紝鍚庨潰鏄暟鎹潡
銆銆SMSG_AUTH_RESPONSE 鐨勫寘緇勭粐
銆銆SMSG_AUTH_RESPONSE 鐨刼pcode鏄?1EE錛孊yteBuffer澶у皬涓? + 4 + 1 + 4 + 1=11涓涓猄MSG_AUTH_RESPONSE 鐨勬暟鎹涓嬶細 鍦ㄦ瀯閫犱簡SMSG_AUTH_RESPONSE packet鍚庯紝WorldSocket::SendPacket浼氭牴鎹甋MSG_AUTH_RESPONSE packet鏋勯犲嚭涓涓猄erverPktHeader錛屽茍瀵筍erverPktHeader涓殑鏁版嵁header榪涜鍔犲瘑鍙戦佸姞瀵嗛噰鐢╩_Crypt.EncryptSend ((uint8*)header.header, header.getHeaderLength()); WorldSocket::handle_input_header浼氬浠庡鎴風鎺ユ敹鏉ョ殑鏁版嵁榪涜瑙e瘑錛岃В瀵嗛噰鐢╩_Crypt.DecryptRecv ((uint8*) m_Header.rd_ptr (), sizeof (ClientPktHeader));
銆銆瑙掕壊鏋氫婦 鐜╁鐧諱笂鏈嶅姟鍣ㄥ悗錛屼粠瀹㈡埛绔彂閫丼MSG_CHAR_ENUM鍒版湇鍔″櫒
銆銆鍦ㄦ湇鍔″櫒绔?nbsp;
銆銆鏍規嵁{ "CMSG_CHAR_ENUM", STATUS_AUTHED, &WorldSession::HandleCharEnumOpcode }錛屾湇鍔″櫒浼氳皟鐢╓orldSession::HandleCharEnumOpcode
銆銆WorldSession::HandleCharEnumOpcode浼氳皟鐢–haracterDatabase.AsyncPQuery錛岃繘琛屽紓姝ユ煡璇㈠悗錛岃皟鐢–haracterHandler::HandleCharEnumCallback
銆銆CharacterHandler::HandleCharEnumCallback浼氬洖澶磋皟鐢╯ession->HandleCharEnum(result);
銆銆WorldSession::HandleCharEnum鏍規嵁characters鏁版嵁搴撶殑鏌ヨ緇撴灉錛岃皟鐢≒layer::BuildEnumData錛屽姞杞借鑹叉暟鎹紝鏋勯燬MSG_CHAR_ENUM榪斿洖鍖咃紝鐒跺悗鍙戦佸洖瀹㈡埛绔?nbsp;
銆銆
銆銆瑙掕壊鍒涘緩
銆銆
銆銆瑙掕壊鐨勫垵濮嬪寲瑁呭鍦–harStartOutfit.dbc
銆銆瑙掕壊鐨勫垱寤哄拰閫夋嫨鐨勮緗兘鍦?ChrRaces.dbc
銆銆瑙掕壊鐨勫垱寤哄睘鎬ч兘鍦≒layercreateinfo錛屽寘鎷嚭鐢熷湴鍜屽嚭鐢熷睘鎬?nbsp;
銆銆playercreateinfo_item琛ㄦ槸鍒涘緩涓涓柊浜虹墿鏃訛紝浜虹墿榛樿甯︾殑鎵鏈塈tem鐨勮〃
銆銆playercreateinfo_spell琛ㄦ槸鍒涘緩涓涓柊浜虹墿鏃訛紝浜虹墿榛樿甯︾殑鎵鏈塖pell鐨勮〃
瑙掕壊鍒犻櫎
銆銆
# MaNGOS Configuration file 鏈嶅姟鍣ㄩ厤緗枃浠朵腑鏂囪鏄?br style="box-sizing: border-box;" />ConfVersion=2007071001 # RealmID must match the realmlist (鍥藉害ID 蹇呯墥鍑?鏀樻枩鐮濋敥濞村崡鍠? RealmID = 1 # 0 NORMAL 1 PVP 4 NORMAL 6 RP 8 RPPVP(鏈嶅姟鍣ㄧ被鍨? GameType = 1 # 鎵╁睍鏌氭瘡 ?# 0 涓嶆鏌ユ墿灞曞湴鍥?涓嶅厑璁稿垱寤烘柊縐嶆棌,蹇界暐璐﹀彿鐨勬墿灞曡緗? # 榛樿: 1 (濡傛灉瀹㈡埛绔敮鎸佹墿灞曚笖璐﹀彿鎷ユ湁鎵╁睍鏉冮檺,鍗沖厑璁鎬嬌鐢ㄦ柊縐嶆棌鍙婅闂柊鍦板浘.) Expansion = 1 #==================================鏈嶅姟绔坊鍔犵殑鍙傛暟=========================================================================== #涓栫晫鑱婂ぉ娑堣垂(榛樿鏄?G/嬈? sjxf=10000 #鍒濆浜虹墿閲戝竵錛屼互鍒嗕負鍗曚綅. # 榛樿: 8 mymoney = 1000000 # 鑷姩鍏憡鏃墮棿闂撮殧 1=1縐?br style="box-sizing: border-box;" />AutoBroadcastInterval=10 #鍒濆鎬墿灝鎬綋鍋滅暀鏃墮棿 #鍗曚綅/縐?nbsp; # 榛樿: 60 MyCropseDelay = 60 #浜虹墿澶嶆椿铏氬急鏃墮棿 #榛樿: 1000 Playerdietime = 1000 #鍒濆鍑虹敓浜虹墿絳夌駭 # 榛樿: 1 LevelFirst = 1 #鍔犺鎶鑳芥不鐤楀嶆暟 aurahealing = 5 #娉曟湳鎶鑳戒激瀹沖嶆暟 tmpDamage = 5 #鐗╃悊鎶鑳戒激瀹沖嶆暟(鏁板瓧鍒敼鐨勫お澶т簡) pdaDamage = 2 #鐚庝漢闂伩鐜囪緗?鏁板瓧瓚婂ぇ闂伩鐜囪秺浣? Rate.Hunter_Max.Dodge=31.4 #鐩楄醇闂伩鐜囪緗?鏁板瓧瓚婂ぇ闂伩鐜囪秺浣? Rate.Roguer_Max.Dodge=19.5 #鍏朵粬鑱屼笟闂伩鐜囪緗?鏁板瓧瓚婂ぇ闂伩鐜囪秺浣? Rate.Else_Max.Dodge=27 #==================================鏈嶅姟绔坊鍔犵殑鍙傛暟=========================================================================== # 鏁版嵁鐩綍璁劇疆銆?br style="box-sizing: border-box;" /># 閲嶈璇存槑錛氭暟鎹洰褰曢渶瑕佹斁鍦ㄥ紩鍙烽噷闈紝鍥犱負瀛楃涓插彲鑳藉寘鍚┖鏍?br style="box-sizing: border-box;" /># DataDir = "@MANGOSD_DATA@" //榪欎釜鏄粯璁ょ洰褰?br style="box-sizing: border-box;" />DataDir = "./" # Logs directory setting. # Important: Logs dir must exists, or all logs be disable # Default: "" - no log directory prefix, if used log names isn't absolute path then logs will be stored in current directory for run program. LogsDir = "" # 涓栫晫鏈嶅姟鍣ㄧ殑鏁版嵁搴撹繛鎺ヨ緗?br style="box-sizing: border-box;" /># 鏍煎紡錛氫富鏈哄湴鍧(鍩熷悕鎴朓P錛?绔彛;鐢ㄦ埛鍚?瀵嗙爜;鏁版嵁搴撳悕縐?br style="box-sizing: border-box;" /># .;somenumber;username;password;database - use named pipes at Windows # Named pipes: mySQL required adding "enable-named-pipe" to [mysqld] section my.ini # .;/path/to/unix_socket;username;password;database - use Unix sockets at Unix/Linux # Unix sockets: experimental, not tested LoginDatabaseInfo = "127.0.0.1;3306;root;netspace;realmd" WorldDatabaseInfo = "127.0.0.1;3306;root;netspace;mangos" # 璁劇疆鏈楂榩ing鏁版嵁搴撶殑鏃墮棿闂撮殧(鍒嗛挓) MaxPingTime = 30 # DBC 璇█璁劇疆 #8 鑻辮 #4 闊╄ #3 娉曡 #3 寰瘋 #4 涓枃 #5 鍙版咕綣佷綋 #6 瑗跨彮鐗欒 #7 淇勮 #8 鏈煡 # 8 = Unknown # 9 = Unknown # 10 = Unknown # 11 = Unknown # 12 = Unknown # 13 = Unknown # 14 = Unknown # 15 = Unknown # 255 = 鑷姩媯嫻?(榛樿) DBC.Locale = 255 # 鍚敤GM鍛戒護璁板綍-鎵鏈夌殑SQL浠g爜閮藉皢琚褰曞湪鏃ヨ鏂囦歡涓?br style="box-sizing: border-box;" /># All commands are written to a file: YYYY-MM-DD_logSQL.sql # If a new day starts (00:00:00) then a new file is created - the old # file will not be deleted. # 0 - 涓嶈褰?br style="box-sizing: border-box;" /># 1 - 璁板綍 LogSQL = 1 # 鏈嶅姟鍣ㄦ帶鍒跺彴璁板綍鏄劇ず鐨勭駭鍒?br style="box-sizing: border-box;" /># 0 = 鏈灝? 1 = 鍩虹鍜岄敊璇? 2 = 璇︾粏; 3 = 瀹屽叏鎴栦睛閿?br style="box-sizing: border-box;" /># 榛樿: 0 # 鎺ㄨ崘: 1 LogLevel = 0 # 璁板綍鏂囦歡 鐨勫悕瀛?br style="box-sizing: border-box;" /># 鏂囦歡鍚嶄負絀?鍒欎笉鍒涘緩璁板綍鏂囦歡,濡? LogFile = # 榛樿: "" LogFile = "Server.log" # Logfile with timestamp of server start in name # Default: 0 - no timestamp in name # 1 - add timestamp in name in form Logname_YYYY-MM-DD_HH-MM-SS.Ext for Logname.Ext LogTimestamp = 0 # 璁板綍鏂囦歡鐨勮褰曠駭鍒?br style="box-sizing: border-box;" /># 0 = 鏈灝? 1 = 鍩虹鍜岄敊璇? 2 = 璇︾粏; 3 = 瀹屽叏鎴栦睛閿?br style="box-sizing: border-box;" /># 榛樿: 0 LogFileLevel = 0 # Log filters # 0 (default) - include in log if log level permit, 1 - not include with any log level LogFilter_TransportMoves = 0 LogFilter_CreatureMoves = 0 LogFilter_VisibilityChanges = 0 # 鎺у埗鍙頒俊鎭殑棰滆壊 (鏍煎紡: "姝e父棰滆壊 璇︽儏棰滆壊 debug棰滆壊 閿欒棰滆壊) # 棰滆壊: 0-榛戣壊, 1-綰? 2-緇? 3-媯? 4-钃? 5-鍝佺孩, 6-闈掔豢, 7-鐏拌壊, # 8-榛? 9-娣$孩, 10-娣$豢, 11-娣¤摑, 12-娣″搧綰? 13-娣¢潚緇? 14-鐧借壊 # 榛樿: "" 鏃犻鑹?鐧借壊) # 渚嬪: "13 7 11 9" LogColors = "13 7 11 9" # Packet logging file for the worldserver. # Default: "" WorldLogFile = "world.log" # 璁板綍鏁版嵁搴撻敊璇殑鏂囦歡鍚?br style="box-sizing: border-box;" /># 榛樿: "" DBErrorLogFile = "DBErrors.log" # 璁板綍GM鍛戒護浣跨敤鎯呭喌鐨?璁板綍鏂囦歡鍚?br style="box-sizing: border-box;" /># 榛樿: "" (紱佹) 鍏佽鏃?渚嬪: "GMcommand.log" GmLogFile = "" # Log file of RA commands, "" for disable # Default: "Ra.log" RaLogFile = "" # 鍦ㄥ綰跨▼緋葷粺 浣跨敤綰跨▼MASK(鍙湪Windows緋葷粺涓嬩嬌鐢? # 榛樿: 0 (鎿嶄綔緋葷粺鏉ラ夋嫨) # 涓句緥: 鏁板瓧 UseProcessors = 80 # 榪涚▼浼樺厛鏉冭緗?鍙湪Windows緋葷粺涓嬩嬌鐢? # 0 (姝e父浼樺厛鏉? # 榛樿: 1 (楂樹紭鍏? ProcessPriority = 1 #鍙戦佸埌瀹㈡埛绔殑鏇存柊鏁版嵁鍖呯殑鍘嬬緝綰у埆(1鍒?) # 榛樿: 1 (閫熷害蹇?涓嶅帇緙? # 9 (鏈濂界殑鍘嬬緝) Compression = 1 # 闄M涔嬪 娓告垙鏈澶у湪綰跨帺瀹舵暟闄愬埗 # 榛樿: 100 PlayerLimit = 100 # 鐜╁鑾峰緱緇忛獙鑳藉崌鍒扮殑鏈楂樼瓑綰?蹇呴』鍦?1 鍒?255). # 涓嶅緩璁慨鏀?寤鴻鐢ㄩ粯璁ょ殑 60 瓚呰繃60 鍙兘褰卞搷娓告垙騫寵 # 榛樿: 60 MaxPlayerLevel = 70 # 澶╂皵緋葷粺寮鍏?br style="box-sizing: border-box;" /># 榛樿: 1 (寮) # 0 (鍏? ActivateWeather = 1 # 鏄惁蹇界暐榪涘叆鍓湰鐨勭瓑綰ч渶瑕?br style="box-sizing: border-box;" /># 1 (true) # 榛樿: 0 (鍚? IgnoreATLevelRequirement = 0 # 鐜╁鏈澶氬彲浠ュ鐨?鍟嗕笟鎶鑳?br style="box-sizing: border-box;" /># 榛樿: 2 # 鏈澶? 9 MaxPrimaryTradeSkill = 2 # 寤虹珛鍏細鎵闇鐨勬渶灝戠帺瀹剁鍚嶄釜鏁?(0..9). # 榛樿: 9 MinPetitionSigns = 9 # 灝忛槦鎴愬憳鍦ㄧ敓鐗╂浜?鑾峰緱緇忛獙鐨?鏈澶ц窛紱?鍚屾墿鐨勮窛紱? # 榛樿: 74 MaxGroupXPDistance = 74 # 灝忛槦鎴愬憳鍦ㄧ敓鐗╂浜?鑾峰緱緇忛獙鐨?鏈澶х瓑綰у樊(鍚屾墿鐨勭瓑綰? # 榛樿: 10 MaxGroupXPLevelDiff = 10 # 鏄惁榪愯鍚?涓笎鍙?寤虹珛涓?涓笉鍚岄樀钀ョ殑瑙掕壊 GM鍙蜂負濮嬬粓涓?鍏佽 # 榛樿: 0 (涓嶅厑璁? # 1 (鍏佽) AllowTwoSide.Accounts = 0 # 鏄惁鍏佽 涓嶅悓闃佃惀闂寸殑 鑱婂ぉ 棰戦亾鑱婂ぉ 緇勯槦 浜ゆ槗 # 榛樿: 0 (涓嶅厑璁? # 1 (鍏佽) AllowTwoSide.Interaction.Chat = 0 AllowTwoSide.Interaction.Channel = 0 AllowTwoSide.Interaction.Group = 0 AllowTwoSide.Interaction.Guild = 0 AllowTwoSide.Interaction.Trade = 0 # 鏄惁鍦?鍦ㄧ嚎鐜╁鍒楄〃 閲屾樉紺烘晫瀵歸樀钀ョ帺瀹?br style="box-sizing: border-box;" /># 榛樿: 0 (涓嶅厑璁? # 1 (鍏佽) AllowTwoSide.WhoList = 0 # 闃插埛灞忓紑鍏?澶氬皯鏉¤繚瑙勪俊鎭縺媧諱繚鎶?br style="box-sizing: border-box;" /># 0 (涓哄叧闂槻鍒峰睆) # 榛樿: 10 ChatFlood.MessageCount = 10 # 闃插埛灞忓紑鍏?澶氬皯縐掗棿闅斿紑濮嬭綆椾負榪濊淇℃伅 # 榛樿: 1 (縐? ChatFlood.MessageDelay = 1 # 闃插埛灞忓紑鍏?紱佽█鏃墮棿. # 榛樿: 10 (縐? ChatFlood.MuteTime = 10 # GM榛樿鏄惁鎺ュ彈鐜╁鐨勬倓鎮勮瘽. # 榛樿: 0 (false) # 1 (true) GM.WhisperingTo = 0 # 褰揋M璁劇疆涓哄彲瑙佹椂 鏄惁鍦ㄧ帺瀹跺垪琛ㄦ樉紺篏M. # 榛樿: 0 (false) # 1 (true) GM.InGMList = 0 # 鏄惁鏄劇ずGM鍚嶅崟 (if visible). # 榛樿: 0 (false) # 1 (true) GM.InWhoList = 0 # GM妯″紡鍦ㄧ櫥闄嗘椂鐘舵?br style="box-sizing: border-box;" /># 0 (鎬繪槸鍏? # 1 (鎬繪槸寮) # 榛樿: 2 (涓婃紱誨紑鏃剁姸鎬? GM.LoginState = 2 # 濡傛灉鎵撳紑 鍒欏湪GM LOG閲岃褰旼M鐨勪氦鏄撳拰浜ゆ槗淇℃伅 # 0 (涓嶈褰? # 榛樿: 1 (璁板綍) GM.LogTrade = 1 # 鍥㈤槦鍙妯″紡 # 榛樿: 0-鏍囧噯璁劇疆錛氬彧鏈夊悓涓涓洟闃熺殑闃熷弸鎵嶅彲浠?00%渚︽祴闅愬艦鐜╁ # 1-鍙湁鍚屼竴涓皬闃熺殑闃熷弸鎵嶅彲浠?00%渚︽祴闅愬艦鐜╁ # 2-鍚屼竴闃佃惀鐨勯槦鍙嬪彲浠?00%渚︽祴闅愬艦鐜╁ Visibility.GroupMode = 0 # 涓嶅悓鐨勬父鎴忕墿浣撲箣闂寸殑鍙搴?nbsp; # 鏈澶ц緗? ~ 166 # 鏈灝忚緗互鐗╀綋涓哄噯 # 榛樿: 66 (鍗曞厓) # # Min limit is max aggro radius (45) * Rate.Creature.Aggro Visibility.Distance.Creature = 66 Visibility.Distance.Player = 66 # gameobject, dynobject, bodies, corpses, bones # Min limit is iteraction distance (5) Visibility.Distance.Object = 66 # visible distance for player in flight # Min limit is 0 (not show any objects) Visibility.Distance.InFlight = 66 # Visibility grey distance for creatures/players (fast changing obects) # addition to appropriate object type Visibility.Distance.* use in case visibility removing to object (except corpse around distences) # If ?is distance and G is grey distance then object make visible if distance to it <= D but make non visible if distance > D+G # Default: 1 yard Visibility.Distance.Grey.Unit = 1 # Visibility grey distance for dynobjects/gameobjects/corpses/creature bodies # # Default: 10 yards Visibility.Distance.Grey.Object = 10 # 濡傛灉閭瘎鐗╁搧寤舵椂澶氫箙鏀跺埌錛燂紵 # 榛樿: 3600 縐?(1 hour) MailDeliveryDelay = 3600 # 姣忔棩娑堟伅銆傚綋鐜╁榪涘叆娓告垙鐨勬椂鍊欐樉紺哄湪鑱婂ぉ紿楀彛鐨勪俊鎭?br style="box-sizing: border-box;" />Motd = "Welcome to the Massive Network Game Object Server." # Health and power regeneration and rage income from damage. Rate.Health = 1; Rate.Mana = 1; Rate.Rage.Income = 1; Rate.Rage.Loss = 1; Rate.Focus = 1; # 鐗╁搧鐨勬帀鐜囧嶆暟 #poor,鐧借壊錛?br style="box-sizing: border-box;" />#common,鏅氾紱 #uncommon,緗曡鐨? #rare,璐甸噸鐨勶紱 #Epic,鍙茶瘲; #Legendary,浼犺; #uest,浠誨姟> # 榛樿: 1 # Rate.Drop.Items = 1 Rate.Drop.Items.Quality.Poor = 1 Rate.Drop.Items.Quality.Common = 1 Rate.Drop.Items.Quality.Uncommon = 1 Rate.Drop.Items.Quality.Rare = 1 Rate.Drop.Items.Quality.Epic = 1 Rate.Drop.Items.Quality.Legendary = 1 Rate.Drop.Items.Quest = 1 Rate.Drop.Money = 1 # 鏉鎬?浠誨姟,鎺㈢儲鍦板浘 鑾峰緱緇忛獙 涔樹互鐨勫嶆暟 # 榛樿: 1 Rate.XP.Kill = 20 Rate.XP.Quest = 30 Rate.XP.Explore = 10 # 鏅?綺捐嫳,紼鏈夌簿鑻?BOSS,紼鏈夋櫘閫氭?鐨勪激瀹?涔樹互鐨勫嶆暟 # 渚嬪: 1.4 灝辨槸 澧炲姞0.4鍊嶆敾鍑諱激瀹?br style="box-sizing: border-box;" />Rate.Creature.Normal.Damage = 1 Rate.Creature.Elite.Elite.Damage = 1 Rate.Creature.Elite.RAREELITE.Damage = 1 Rate.Creature.Elite.WORLDBOSS.Damage = 1 Rate.Creature.Elite.RARE.Damage = 1 # 鏅?綺捐嫳,紼鏈夌簿鑻?BOSS,紼鏈夋櫘閫氭?鐨勮閲?涔樹互鐨勫嶆暟 # 渚嬪: 1.4 灝辨槸 澧炲姞0.4鍊嶆敾鍑昏閲?br style="box-sizing: border-box;" />Rate.Creature.Normal.HP = 1 Rate.Creature.Elite.Elite.HP = 1 Rate.Creature.Elite.RAREELITE.HP = 1 Rate.Creature.Elite.WORLDBOSS.HP = 1 Rate.Creature.Elite.RARE.HP = 1 #浠囨仺緋繪暟錛岄粯璁?.1f錛屽嵆鏈夎秴榪囩涓浠囨仺鑰呴犳垚浼ゅ110%鑰呭氨杞彉鏀誨嚮瀵硅薄銆?br style="box-sizing: border-box;" />#娉ㄦ剰錛佸繀欏葷簿紜埌灝忔暟鐐瑰悗1浣?br style="box-sizing: border-box;" /># 榛樿: 1.1f AggroThreat = 1.1f # 綺懼姏鏉″闀垮嶆暟 (1 - normal, 2 - double rate, 0.5 - half rate, etc) from standard values # 娓告垙涓?br style="box-sizing: border-box;" />Rate.Rest.InGame = 1 # 鍦ㄦ梾棣嗕笅綰挎椂 Rate.Rest.Offline.InTavernOrCity = 1 # 鍦ㄩ噹澶栦笅綰挎椂 Rate.Rest.Offline.InWilderness = 1 # 絀轟腑璺岃惤浼ゅ鍊嶆暟 Rate.Damage.Fall = 1 # 鎷嶅崠 鍊嶆暟 # Rate.Auction.Time (鎷嶅崠鏃墮棿鍊嶇巼),Rate.Auction.Deposit(鎷嶅崠鎶奸噾),Rate.Auction.Cut(鎷嶅崠涓婇檺) Rate.Auction.Time = 1 Rate.Auction.Deposit = 1 Rate.Auction.Cut = 1 # 鐭跨墿 鍊嶆暟 #Rate.Mining.Next (閲囩熆鐨勫嚑鐜囧嶆暟),Rate.Mining.Amount (浜х敓鐭挎渶澶ф渶灝忕殑鍊嶆暟) Rate.Mining.Amount = 1 Rate.Mining.Next = 1 # 澶╄祴鐐圭殑鍗囩駭鍊嶇巼 # 榛樿: 1 Rate.Talent = 1 # 淇濆瓨鍒鋒柊鏃墮棿 褰撶敓鐗╂ 褰撶墿浣撹鎵撳紑鎴栦嬌鐢?br style="box-sizing: border-box;" /># 0 (淇濆瓨浜?鐗╀綋鐨勫埛鏂版椂闂村湪緗戞牸鍗歌澆鐨勬椂鍊? # 榛樿: 1 (涓嶅湪緗戞牸鍗歌澆鐨勬椂鍊欎繚瀛樹漢/鐗╀綋鐨勫埛鏂版椂闂? SaveRespawnTimeImmediately = 1 # 鎶鑳界啛緇冨害鎻愬崌鍑犵巼(0..100) # 榛樿: 100-75-25-0 SkillChance.Orange = 100 SkillChance.Yellow = 75 SkillChance.Green = 25 SkillChance.Grey = 0 # 鎬墿鑷姩鏀誨嚮鐨勮寖鍥翠箻浠ョ殑鍊嶆暟 鎴栬?鍏抽棴鑷姩鏀誨嚮 # 0 - 鍏抽棴(0%) # 榛樿: 1 - 涔樹互100% # 1.5 - 涔樹互150% Rate.Creature.Aggro = 1 # 鎺у埗鍙板紑鍏?br style="box-sizing: border-box;" /># 0 - 鍏?br style="box-sizing: border-box;" /># 榛樿: 1 - 寮 Console.Enable = 1 # 榪滅▼鎺у埗鍙板紑鍏?br style="box-sizing: border-box;" /># 榛樿: 0 - 鍏?br style="box-sizing: border-box;" /># 1 - 寮 Ra.Enable = 0 # 榛樿榪滅▼鎺у埗IP鍦板潃,0.0.0.0涓烘墍鏈塈P鐨嗗彲. Ra.IP = 0.0.0.0 # 榛樿榪滅▼鎺у埗鍙扮鍙?br style="box-sizing: border-box;" />Ra.Port = 3443 # 榪滅▼鎺у埗鍙拌繛鎺ュ埌鏈嶅姟鍣ㄦ墍闇瑕佺殑GM絳夌駭錛岄粯璁や負3錛堢鐞嗗憳錛?br style="box-sizing: border-box;" />Ra.MinLevel = 3 # 韙㈠嚭鐢ㄦ埛錛屽鏋滀粬杈撳叆浜嗛敊璇殑瀵嗙爜 錛堜粎闄愯繙紼嬫帶鍒跺彴錛?br style="box-sizing: border-box;" />Ra.Secure = 1 # 鏈澶ч熷害闄愬埗鍊嶇巼 # 榛樿: 2 濡傛灉涓?鍒欏叧闂鏌ュ姞閫?br style="box-sizing: border-box;" />MaxOverspeedPings = 2 # 鍗歌澆Grids (濡傛灉閲岀殑鍐呭瓨澶熷ぇ,鍙互紱佺敤,鎻愰珮鐜╁絎簩嬈$粡榪囨柊Grids鏃跺欑殑閫熷害) # P.S: Grids灝辨槸鍦板浘涓婂埛鍑烘潵鐨勪笢瑗?鐜╁緇忚繃涓涓湴鏂?灝變細鍔犺澆璇ュ湴鏂圭殑鐜,紱誨紑鐨勬椂鍊?灝卞嵏杞借鍦版柟鐨勭幆澧?br style="box-sizing: border-box;" /># 榛樿: 1 ( 鍗歌澆 grids) 0 ( 涓嶅嵏杞?grids) GridUnload = 1; # 浠ヤ笅鎵鏈夌殑鏃墮棿璁劇疆閮戒互姣涓哄崟浣嶃?br style="box-sizing: border-box;" /># 榛樿绔彛閫夋嫨鏃墮棿 SocketSelectTime = 10000 # 榛樿鍦板浘緗戞牸娓呯悊寤惰繜 GridCleanUpDelay = 300000 # 榛樿鍦板浘鏇存柊闂撮殧 MapUpdateInterval = 100 # 榛樿澶╂皵鏇存柊闂撮殧 ChangeWeatherInterval = 600000 # 榛樿鐜╁鏁版嵁淇濆瓨闂撮殧 PlayerSaveInterval = 900000 # 榛樿涓栫晫鏈嶅姟鍣ㄧ鍙?mangosd.exe 鐨勭鍙o級 WorldServerPort = 8085 # 鍦╩angos鍚姩瀹屾瘯鍚庤渹楦d竴澹?閫氬父鍙湪Unix nux緋葷粺涓嬪伐浣? # 榛樿: 1 BeepAtStart = 1 # 鎵撳紑/鍏抽棴 VMmap 瀵硅綰垮拰楂樺害鐨勬帹綆楁敮鎸?br style="box-sizing: border-box;" /># Default: 1 (true) # : 0 (false) vmap.enableLOS = 1 vmap.enableHeight = 1 # 涓嶄嬌鐢?VMap鍔熻兘鐨勫湴鍥綢D # 鍦板浘ID涔嬮棿鐢?','鍒嗗壊 # 濡傛灉鏈夊涓湴鍥綢D浣跨敤 "鍙峰寘鍚?br style="box-sizing: border-box;" />#vmap.ignoreMapIds = "369,0,1,530" #DeeprunTram 娌℃湁鍖呭惈鍦ㄥ湴鍥句腑 vmap.ignoreMapIds = "369" # 涓嶈繘琛岃綰挎帹綆楃殑鎶鑳?br style="box-sizing: border-box;" /># 鎶鑳戒箣闂翠嬌鐢?','鍒嗗壊 vmap.ignoreSpellIds = "7720" |
The navigation mesh query is the most important class to understand since most navigation clients will interact with the query rather than the navigation mesh itself. The mesh contains the data, but the query provides almost all of the features necessary for pathfinding.
鐢ㄦ埛鍜宯avigation mesh query(Navmesh鏌ヨ鍣?鎵撲氦閬撶殑嬈℃暟姣擭avmes鏈韓澶氱殑澶氥傜綉鏍煎寘鍚暟鎹紝浣嗘槸鏌ヨ鍣ㄦ彁渚涗簡鍑犱箮鍏ㄩ儴鐨勫璺壒鎬с?/p>
Core Class: NavmeshQuery
鏍稿績綾伙細NavmeshQuery
Query features fall into two general categories: Pathfinding and local search.
鏌ヨ鍣ㄧ殑鐗規у寘鎷袱涓ぇ鐨勬柟闈細瀵昏礬鍜屽眬閮ㄦ悳绱€?/span>
Pathfinding involves standard A* and Dijkstra searches that find the best path(s) between two points. Paths are made up of a list polygon references that represent a polygon corridor from the start to the end position. Path straightening is used to convert the path into a list of waypoints. (I.e. String pulling.)
瀵昏礬浣跨敤鏍囧噯鐨凙*鍜孌ijkstra綆楁硶錛岀敤浜庢壘鍑轟袱鐐逛箣闂存渶濂界殑璺緞(鍙兘涓嶆涓鏉?銆侾ath(璺緞)鏄敱涓緇凱olygon鐨勫紩鐢?1)緇勬垚鏁版嵁錛屼粠寮濮嬬偣鍒扮粨鏉熺偣銆傝礬寰勭煫姝f槸灝嗕竴涓狿ath鏁版嵁杞負涓緇勮礬鐐規暟鎹?鍗砈tring pulling(緇沖瓙鎷夌洿))(2)銆?/span>
The local search features offer various methods for locating polygons and points on polygons, and for querying the local environment. I.e. Raycasting, finding the distance to the nearest wall, etc.
灞閮ㄦ悳绱㈠姛鑳芥彁渚涘縐嶆柟寮忚繘琛屽杈瑰艦鍜屽杈瑰艦涓婄殑鐐圭殑瀹氫綅錛屼互鍙婃煡璇㈠眬閮ㄧ殑涓浜涚幆澧冧俊鎭傛瘮濡傚皠綰挎煡璇€佽綆楃鏈榪戠殑澧欑殑璺濈涔嬬被鐨勩?/span>
Many of the query methods require a NavmeshQueryFilter. Filters define area traversal costs as well as flags used for including/excluding polygons and off-mesh connections from results.
璁稿鏌ヨ鏂規硶瑕佹眰涓涓狽avmeshQueryFilter(鏌ヨ榪囨護鍣?銆傝繃婊ゅ櫒瀹氫箟浜哖olygon鍜宱ff-mesh connections鐨勭┛瓚婁唬浠鳳紝浠d環鍊煎彲浠ュ弬涓庡惎鍙戝紡鐨勮綆楋紝鐢ㄦ潵鍐沖畾鏄惁鍦ㄦ渶緇堣礬寰勯噷鍖呭惈/鎺掗櫎鏌愪釜Polygon鎴杘ff-mesh connections銆?/span>
The best way to understand the query class is to play around with it. The Sample Pack includes the Query Explorer demo that permits experimentation with all of the main query features.
鐞嗚В鏌ヨ鍣ㄧ殑鏈濂藉姙娉曞氨鏄敤涓鐢ㄣ傘怱ample Pack(紺轟緥鍖?銆戦噷鐨勩怮uery Explorer(鏌ヨ婕旂ず)銆慸emo灞曠ず浜嗘煡璇㈠櫒涓浜涗富瑕佺殑鐗規с?/span>
Common Operations
閫氱敤鎿嶄綔
This section contains some simple examples of common query operations.
Finding a Point in the Navigation Mesh
You can't do much without first getting a valid point on the navigation mesh. So the first step is to find one.
GetNearestPoint(Vector3, Vector3, NavmeshQueryFilter, NavmeshPoint)
鏈妭鏄緥瀛?/span>
鏌ヨ涓涓湪Navmesh涓婄殑鐐?/span>
濡傛灉浣犳病鏈変竴涓狽avmesh涓婄殑璧峰鐐圭殑璇濓紝浣犺兘鍋氱殑涓嶅銆傛墍浠ョ涓閮ㄥ氨鏄壘涓涓偣銆?/span>
GetNearestPoint(Vector3, Vector3, NavmeshQueryFilter, NavmeshPoint)鍑芥暟鎻愪緵姝ゅ姛鑳姐?/span>
CopyC#
// Where 'query' is a NavmeshQuery object and 'filter' is a NavmeshQueryFilter object.
// 'position' is a Vector3 indicating the world position of the client.
// 'query'鏄竴涓?NavmeshQuery瀵硅薄錛?filter'鏄竴涓狽avmeshQueryFilter瀵硅薄銆?/span>
// 'position' 鏄竴涓猇ector3瀵硅薄錛屽間負瑙掕壊鐨勪笘鐣屽潗鏍囥?/span>
NavmeshPoint result;
Vector3 extents = new Vector3(1, 1, 1); // Keep this to the minimum extents practical. // 鑼冨洿瓚婂皬瓚婂ソ銆?/span>
NavStatus status = query.GetNearestPoly(position, extents, filter
, out result);
if (result.polyRef == Navmesh.NullPoly)
{
// Handle error. Could not find a result.
// The status can be checked to see if there was an error. If not, then
// the cause is that the search extents did not overlap any polygons.
// 閿欒澶勭悊銆傛壘涓嶅埌緇撴灉銆?/span>
// 鍙互媯鏌ョ姸鎬佺湅鐪嬫槸浠涔堥棶棰樸傚鏋滄病鏈夐棶棰橈紝璇存槑鎸囧畾鑼冨洿閲屼笉鍖呭惈澶氳竟褰€?/span>
}
// Use the result point, which includes a vector point and the reference of
// the polygon that contains the point.
//浣跨敤緇撴灉鐐廣傚寘鎷竴涓猇ector3鐨勭偣鍜屽寘鍚繖涓偣鐨凱olygon鐨勫紩鐢ㄣ?/span>
Basic Pathfinding
Even if you are planning to use PathCorridor or CrowdManager, you'll always need to do long distance planning using the basic NavmeshQuery features. First, get a path, then optionally straighten it.
鍩虹鐨勫寰?/span>
鍗充嬌浣犳墦綆椾嬌鐢╬athcorridor鎴朿rowdmanager,浣犱篃浼氶渶瑕丯avmeshQuery鐨勫姛鑳芥潵瀹屾垚涓浜涢暱璺濈璺緞瑙勫垝銆傜涓錛岃幏鍙栦竴鏉¤礬寰勶紝鐒跺悗閫夋嫨鎬х殑寮勭洿瀹?3)銆?/span>
CopyC#
// Where 'query' is a NavmeshQuery object and 'filter' is a NavmeshQueryFilter object.
// 'start' and 'end' are NavmeshPoints known to be on the navigation mesh.
// 'query'鏄竴涓?NavmeshQuery瀵硅薄錛?filter'鏄竴涓狽avmeshQueryFilter瀵硅薄;
// 'start' 鍜?'end' 鏄凡鐭ョ殑鍦∟avmesh涓婄殑鐐?
int pathCount;
// The path will be a list of polygon references.
// path鏄竴緇刾olygon鐨勫紩鐢?
uint[] path = new uint[100]; // Size for maximum allowed path length. // 璺緞鐨勬渶澶ч暱搴?
NavStatus status;
if (start.polyRef == end.polyRef)
{
// No need to do any planning.
// 寮濮嬬偣鍜岀粨鏉熺偣鍦ㄥ悓涓涓杈瑰艦鍐咃紝涓嶉渶瑕佽繘琛岃礬寰勮鍒?
pathCount = 1;
path[0] = start.polyRef;
}
else
{
status = query.FindPath(start, end, filter, path
, out pathCount);
if (NavUtil.Failed(status) || path.pathCount == 0)
{
// Handle pathfinding failure.
// 澶勭悊瀵昏礬澶辮觸;
}
else if (end.polyRef != path[pathCount - 1])
{
// Handle a partial path.
// The query either could not reach the end point,
// or the path buffer was too small to hold the
// entire path. (A check of 'status' will reveal if
// the buffer was too small.)
// 澶勭悊鍙湁涓閮ㄥ垎璺緞鐨勬儏鍐?
// 鍙兘鏄粨鏉熺偣涓嶅彲杈?
// 鎴栬呰礬寰勭殑buffer闀垮害澶皬錛岃涓嶄笅鏁存潯璺緞;
// 濡傛灉鏄痓uffer澶皬錛屽彲浠ユ鏌tate;
}
}
// If you need to straighten the path...
// 濡傛灉浣犻渶瑕佹媺鐩磋礬寰?
const int MaxStraightPath = 4; // Just getting the first 4 waypoints. // 鍙鐞嗗墠4涓礬鐐?
int wpCount;
// The waypoints.
// 璺偣鍒楄〃;
Vector3[] wpPoints = new Vecotr3[MaxStraightPath];
// A list of polygon references. (The polygon being entered at each waypoint.)
// 涓涓杈瑰艦寮曠敤鍒楄〃;(璺偣鏄杈瑰艦鐨勫叆鍙g偣)
uint[] wpPath = new uint[MaxStraightPath];
// The type of each waypoint. (Start, end, off-mesh connection.)
// 姣忎竴涓礬鐐圭殑綾誨瀷淇℃伅.(寮濮嬬偣錛岀粨鏉熺偣, 榪炴帴);
WaypointFlag[] wpFlags = new WaypointFlag[MaxStraightPath];
status = query.GetStraightPath(start.point
, goal.point
, path
, 0 // The index of the start of the path. // 璺緞鐨勫紑濮嬬偣;
, pathCount // The length of the path. // 璺緞鐨勯暱搴?
, wpPoints
, wpFlags
, wpPath
, out wpCount);
if (NavUtil.Failed(status) || wpCount == 0)
{
// Handle the failure. There should always be at least one waypoint
// (the goal) for a valid point/path combination,
// 澶勭悊澶辮觸銆傚簲璇ユ繪槸瀛樺湪涓涓偣(鐩爣鐐?鐢ㄤ簬璺緞鍚堝茍.
}
// Use the path and waypoints.
// 浣跨敤璺緞鍜岃礬鐐?
(1)鍙互鐞嗚В涓哄彞鏌勶紝鎴栫儲寮曘?/span>
(2)Path涓婃瘡涓杈瑰艦涓績涔嬮棿鐨勮繛綰夸竴鑸笉浼氭槸鐩寸嚎錛岃礬寰勫鏋滄湁鎷愯涔熶細閫犳垚涓浜涚編瑙備笂鐨勯棶棰橈紝榪欎釜鏃跺欓渶瑕佷嬌鐢ㄧ壒瀹氱殑鏂規硶灝嗚礬寰勫彉寰楀敖閲忕瑪鐩達紝灝卞ソ鍍忓皢涓鏍圭懷瀛愭媺鐩淬?/span>
]]>