写了一个超长的热更新文档,欢迎反馈

lua为何收到2次 NEW_VERSION_FOUND 事件???
我先调用了 checkUpdate 方法,然后收到了 NEW_VERSION_FOUND ,这个是没错
然后我又调用了 update 方法,结果又收到一次 NEW_VERSION_FOUND 事件。。。
设计如此吗???
那比如:
我在 checkUpdate 之后收到 NEW_VERSION_FOUND 事件 弹出一个框,询问要不要更新
用户点击了更新 调用的 update 方法 ,结果又收到了 NEW_VERSION_FOUND 事件。。。
另外,在 checkUpdate 之后,怎么获取当前需要更新的文件大小???
我已经把ccc1.81版本的热更代码覆盖到cocos2dx-3.16了
版本是cocos2dx-3.16

还有 以下代码是我修改过的

因为我调试的时候,有 0/0的情况

@panda @jare

占坑位

mark 热更新

顶一下先~~~~

话说热更新这个官方demo,按照做了,更新过程也有了,也重新启动了,却进不去table场景,报


这个错,难道是平台不对

问一下 用自带的js文件生成的配置文件 md5码和用工具查看的md5码不一致 导致更新不下来 请问是什么原因

lua有更好的热更方案

请问下广大做热更新的网友,热更新每次都要更新这么多东西么,是不是很慢,我就发下更新的非常的慢

我就想问,这个manifesturl是个啥。。

我知道了,这个是1.10更新的。。。1.10之前都要用,url = cc.RawAsset…wo。。。。。。。。

panda大大,我们项目最近想写一套动态热更的方案,部分资源随用随下,比如说prefab资源,如果把prefab编译出的uuid.json文件和其依赖的资源文件都缓存下来,然后把缓存路径加入到资源搜索路径,然后再使用cc.loader.loadRes能将此prefab加载出来吗?

1赞

这个报错什么回事

热更新时this._am.setVerifyCallback(function (filePath, asset) {
Logger.log(“asset.filePath======”, filePath);
let fileData = jsb.fileUtils.getDataFromFile(filePath);
let nowMd5 = “”;
nowMd5 = jsbMd56(fileData);
if(nowMd5){
Logger.log(“asset.nowMd5======”, nowMd5);
}else{
}
Logger.log(“asset.path======”, asset.path);
Logger.log(“asset.md5======”, asset.md5);
return true;
});

打印下Log就闪退

Incident Identifier: 0D3F5562-5BCE-4270-936A-26D9933DE9C9
CrashReporter Key: fbab8fa58aad06d5499daa6ec67c4e7a8d3d2449
Hardware Model: iPad6,11
Process: jueyule-mobile [3372]
Path: /private/var/containers/Bundle/Application/E018A96B-2CFD-4FD6-A97E-EE49F6CB45CB/jueyule-mobile.app/jueyule-mobile
Identifier: com.haolong.18
Version: 1.11 (1.0.11)
Code Type: ARM-64 (Native)
Role: Non UI
Parent Process: launchd [1]
Coalition: com.haolong.18 [4856]

Date/Time: 2018-10-12 16:13:58.3836 +0800
Launch Time: 2018-10-12 16:13:54.4898 +0800
OS Version: iPhone OS 12.0 (16A366)
Baseband Version: n/a
Report Version: 104

Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x00000001e43d23a4
Termination Signal: Trace/BPT trap: 5
Termination Reason: Namespace SIGNAL, Code 0x5
Terminating Process: exc handler [3372]
Triggered by Thread: 0

Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 JavaScriptCore 0x00000001e43d23a4 WTFCrashWithInfo+ 25508 (int, char const*, char const*, int, unsigned long long, unsigned long long, unsigned long long) + 12
1 JavaScriptCore 0x00000001e4d32758 JSC::JSObject::getOwnStaticPropertySlot+ 9856856 (JSC::VM&, JSC::PropertyName, JSC::PropertySlot&) + 0
2 JavaScriptCore 0x00000001e4cd9b5c JSC::JSValue::toStringSlowCase+ 9493340 (JSC::ExecState*, bool) const + 1080
3 JavaScriptCore 0x00000001e4cd9fa0 JSC::JSValue::toWTFStringSlowCase+ 9494432 (JSC::ExecState*) const + 732
4 JavaScriptCore 0x00000001e4a84434 Inspector::ScriptArguments::getFirstArgumentAsString+ 7046196 (WTF::String&) + 360
5 JavaScriptCore 0x00000001e4a789f8 Inspector::JSGlobalObjectConsoleClient::messageWithTypeAndLevel+ 6998520 (JSC::MessageType, JSC::MessageLevel, JSC::ExecState*, WTF::Ref >&&) + 152
6 JavaScriptCore 0x00000001e4c84a70 JSC::consoleLogWithLevel+ 9144944 (JSC::ExecState*, JSC::MessageLevel) + 144
7 JavaScriptCore 0x00000001e442db94 vmEntryToNative + 308
8 JavaScriptCore 0x00000001e4aa544c JSC::Interpreter::executeCall+ 7181388 (JSC::ExecState*, JSC::JSObject*, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 516
9 JavaScriptCore 0x00000001e4c5c068 JSC::profiledCall+ 8978536 (JSC::ExecState*, JSC::ProfilingReason, JSC::JSValue, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 172
10 JavaScriptCore 0x00000001e4463284 JSObjectCallAsFunction + 368
11 jueyule-mobile 0x00000001050683ac se::Object::call(std::1::vector1::allocator > const&, se::Object*, se::Value*) + 6325164 (Object.cpp:536)
12 jueyule-mobile 0x00000001055cfe3c se::(anonymous namespace)::JSB_console_log(se::State&) + 11992636 (ScriptEngine.cpp:138)
13 jueyule-mobile 0x00000001055c9fc4 se::(anonymous namespace)::JSB_console_logRegistry(OpaqueJSContext const*, OpaqueJSValue*, OpaqueJSValue*, unsigned long, OpaqueJSValue const* const*, OpaqueJSValue const**) + 11968452 (ScriptEngine.cpp:141)
14 JavaScriptCore 0x00000001e44570a8 long long JSC::APICallbackFunction::call+ 569512 (JSC::ExecState*) + 348
15 JavaScriptCore 0x00000001e4435cd8 llint_entry + 32952
16 JavaScriptCore 0x00000001e4435598 llint_entry + 31096
17 JavaScriptCore 0x00000001e44350cc llint_entry + 29868
18 JavaScriptCore 0x00000001e442da1c vmEntryToJavaScript + 300
19 JavaScriptCore 0x00000001e4aa53f0 JSC::Interpreter::executeCall+ 7181296 (JSC::ExecState*, JSC::JSObject*, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 424
20 JavaScriptCore 0x00000001e4c5c068 JSC::profiledCall+ 8978536 (JSC::ExecState*, JSC::ProfilingReason, JSC::JSValue, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 172
21 JavaScriptCore 0x00000001e4463284 JSObjectCallAsFunction + 368
22 jueyule-mobile 0x00000001050683ac se::Object::call(std::1::vector1::allocator > const&, se::Object*, se::Value*) + 6325164 (Object.cpp:536)
23 jueyule-mobile 0x00000001051938c8 js_cocos2dx_extension_AssetsManagerEx_setVerifyCallback(se::State&)::$0::operator()(std::__1::basicstring1::char_traits, std::1::allocator > const&, cocos2d::extension::ManifestAsset) const + 7551176 (jsb_cocos2dx_extension_auto.cpp:770)
24 jueyule-mobile 0x0000000105193668 bool std::1::invoke_void_return_wrapper::call1::basic_string1::char_traits, std::1::allocator > const&, cocos2d::extension::ManifestAsset>(js_cocos2dx_extension_AssetsManagerEx_setVerifyCallback(se::State&)::0&&&, std::__1::basicstring1::char_traits, std::1::allocator > const&&&, cocos2d::extension::ManifestAsset&&) + 7550568 (_functionalbase:318) 25 jueyule-mobile 0x00000001051932c0 std::1::function::func1::allocator0>, bool (std::__1::basicstring1::char_traits, std::1::allocator > const&, cocos2d::extension::ManifestAsset)>::operator()(std::1::basic_string1::char_traits, std::__1::allocator > const&, cocos2d::extension::ManifestAsset&&) + 7549632 (functional:1562) 26 jueyule-mobile 0x0000000104bfbd98 std::1::function1::basic_string1::char_traits, std::1::allocator > const&, cocos2d::extension::ManifestAsset)>::operator()(std::1::basic_string1::char_traits, std::__1::allocator > const&, cocos2d::extension::ManifestAsset) const + 1686936 (functional:1913) 27 jueyule-mobile 0x0000000104bfb9dc cocos2d::extension::AssetsManagerEx::onSuccess(std::1::basic_string1::char_traits, std::1::allocator > const&, std::1::basic_string1::char_traits, std::1::allocator > const&, std::1::basic_string1::char_traits, std::__1::allocator > const&) + 1685980 (AssetsManagerEx.cpp:1300) 28 jueyule-mobile 0x0000000104c008f0 cocos2d::extension::AssetsManagerEx::init(std::1::basic_string1::char_traits, std::1::allocator > const&, std::1::basic_string1::char_traits, std::1::allocator > const&)::_1::operator()(cocos2d::network::DownloadTask const&) const + 1706224 (AssetsManagerEx.cpp:140)
29 jueyule-mobile 0x0000000104c00898 void std::1::invoke_void_return_wrapper::call1::basic_string1::char_traits, std::1::allocator > const&, std::1::basic_string1::char_traits, std::1::allocator > const&)::_1&, cocos2d::network::DownloadTask const&>(cocos2d::extension::AssetsManagerEx::init(std::1::basic_string1::char_traits, std::1::allocator > const&, std::1::basic_string1::char_traits, std::1::allocator > const&)::_1&&&, cocos2d::network::DownloadTask const&&&) + 1706136 (functional_base:350)
30 jueyule-mobile 0x0000000104c006f8 std::1::function::func1::basic_string1::char_traits, std::1::allocator > const&, std::1::basic_string1::char_traits, std::1::allocator > const&)::_1, std::1::allocator1::basic_string1::char_traits, std::1::allocator > const&, std::1::basic_string1::char_traits, std::1::allocator > const&)::_1>, void (cocos2d::network::DownloadTask const&)>::operator()(cocos2d::network::DownloadTask const&) + 1705720 (functional:1562)
31 jueyule-mobile 0x0000000104f20e9c std::__1::function::operator()(cocos2d::network::DownloadTask const&) const + 4984476 (functional:1913)
32 jueyule-mobile 0x0000000104f20de8 cocos2d::network::Downloader::Downloader(cocos2d::network::DownloaderHints const&)::$1::operator()(cocos2d::network::DownloadTask const&, int, int, std::_1::basicstring1::char_traits, std::1::allocator > const&, std::1::vector1::allocator >&) const + 4984296 (CCDownloader.cpp:108)
33 jueyule-mobile 0x0000000104f20ca8 ZNSt3__128__invokevoid_return_wrapperIvE6__callIJRZN7cocos2d7network10DownloaderC1ERKNS4_15DownloaderHintsEE3$1RKNS412DownloadTaskEiiRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS_6vectorIhNSH_IhEEEEEEEvDpOT
+ 4983976 (_functionalbase:350)
34 jueyule-mobile 0x0000000104f20a60 std::1::function::func1::allocator1>, void (cocos2d::network::DownloadTask const&, int, int, std::__1::basicstring1::char_traits, std::1::allocator > const&, std::1::vector1::allocator >&)>::operator()(cocos2d::network::DownloadTask const&, int&&, int&&, std::1::basic_string1::char_traits, std::1::allocator > const&, std::1::vector >&) + 4983392 (functional:1562)
35 jueyule-mobile 0x0000000104c23790 std::1::function1::basic_string1::char_traits, std::1::allocator > const&, std::1::vector1::allocator >&)>::operator()(cocos2d::network::DownloadTask const&, int, int, std::1::basic_string1::char_traits, std::1::allocator > const&, std::1::vector >&) const + 1849232 (functional:1913)
36 jueyule-mobile 0x0000000104c2424c -[DownloaderAppleImpl URLSession:downloadTask:didFinishDownloadingToURL:] + 1851980 (CCDownloader-apple.mm:605)
37 CFNetwork 0x00000001dd8c7d20 _82-[NSURLSession delegatedownloadTask:didFinishDownloadingToURL:completionHandler:]blockinvoke + 36
38 Foundation 0x00000001ddbbbb6c NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK + 16
39 Foundation 0x00000001ddac3cc8 -[NSBlockOperation main] + 72
40 Foundation 0x00000001ddac319c -[__NSOperationInternal _start:] + 740
41 Foundation 0x00000001ddbbda40 _NSOQSchedulef + 272
42 libdispatch.dylib 0x00000001dcb151e0 dispatchblock_async_invoke2 + 104
43 libdispatch.dylib 0x00000001dcb68484 dispatchclient_callout + 16
44 libdispatch.dylib 0x00000001dcb149ec dispatchmain_queue_callback_4CF$VARIANT$mp + 1068
45 CoreFoundation 0x00000001dd0be1bc CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 12
46 CoreFoundation 0x00000001dd0b9084 __CFRunLoopRun + 1964
47 CoreFoundation 0x00000001dd0b85b8 CFRunLoopRunSpecific + 436
48 GraphicsServices 0x00000001df32c584 GSEventRunModal + 100
49 UIKitCore 0x0000000209733558 UIApplicationMain + 212
50 jueyule-mobile 0x0000000104a7ec98 main + 126104 (main.m:8)
51 libdyld.dylib 0x00000001dcb78b94 start + 4

mark

是非常慢 散列的文件太多了

官方不会看到的 放心

这个方法是可以行的

试了一下,确实可以。

好文,以后万一有需要呢。。