本文將會具體解說cocos2d-js下的熱更新機制。這篇內容先給你們介紹一下兩個manifest文件就當熱身了。app
首先介紹project.manifest: 舉個樣例post
{
"packageUrl" : "http://192.168.1.108/games/dragon_gold",
"remoteManifestUrl" : "http://192.168.1.108/games/dragon_gold/project.manifest",
"remoteVersionUrl" : "http://192.168.1.108/games/dragon_gold/version.manifest",
"version" : "1.0.2",
"groupVersions" : {
"1" : "1.0.1",
"2" : "1.0.2"
},
"engineVersion" : "3.6",
"assets" : {
"update1" : {
"path" : "dragon_gold1.zip",
"md5" : "140caaa2a4508912424e807a941bf71",
"compressed" : true,
"group" : "1"
},
"update2" : {
"path" : "dragon_gold2.zip",
"md5" : "140caaa2a4508912424e807a941bf7bc",
"compressed" : true,
"group" : "2"
}
},
"searchPaths" : [
]
spa
}server
(這個用來推斷是否有新的更新包)ip
compressed是用來決定下載下來的包是否需要解壓。md5
group是重中之重。它是用來實現增量跟新的。它的值與groupVersions相相應。資源
這一節就講到這。下次開始用我眼下作的一個項目來具體解說熱更新的使用方法。(備註:這一節是用工做時間寫的。有點馬虎了.......)rem