这是bug吗
不会吧,你做MD5校验没?
怎么自己校验MD5,从脚本中我好像只能拿到服务器的MD5,不能拿到下载的文件吧
用zip压缩包呢
this._am.setVerifyCallback(function (path, asset) {
// When asset is compressed, we don’t need to check its md5, because zip file have been deleted.
var compressed = asset.compressed;
// Retrieve the correct md5 value.
var expectedMD5 = asset.md5;
// asset.path is relative path and path is absolute.
var relativePath = asset.path;
// The size of asset file, but this value could be absent.
var size = asset.size;
if (compressed) {
panel.getComponent(cc.Label).string = "Verification passed : " + relativePath;
return true;
}
else {
panel.getComponent(cc.Label).string = "Verification passed : " + relativePath + ’ (’ + expectedMD5 + ‘)’;
return true;
}
});
脚本里面不是说下载到zip会删除吗
zip会自动解压,然后删除压缩包
就是在这个回调里,官方说了下载可能会出错,所以必须校验MD5。
看来是我误解了注释的意思
那要如何才能获取到下载的文件来计算MD5
zip下砸不完整的话,解压会失败吧
嗯,但是游戏大了,之后每次下zip不太现实