Quick-x刚刚从升级3.3rc 升级到3.3final版本,lua加密的代码运行不了。

之前项目是3.3rc版本,今天刚刚换了3.3final版本,然后加密的脚本就运行不了了。

脚本是用命令compile_scripts.bat加密的。

执行cc.LuaLoadChunksFromZIP(“res/game.zip”)的时候报错。


LOAD LUA FILE: D:/myGameDir/wshRelease/src/main.lua


lua_loadChunksFromZIP() - load zip file: res/game.zip*

load “app.battle.BattleArrayConfig”, error: syntax error during pre-compilation.

load “app.battle.BattleController”, error: syntax error during pre-compilation.

load “app.battle.BattleLogic”, error: syntax error during pre-compilation.

load “app.battle.element.models.Actor”, error: syntax error during pre-compilation.

lua_loadChunksFromZIP() - loaded chunks count: 0

can not get file data of src/app/MyApp.lua

:18: module ‘app.MyApp’ not found:
no field package.preload’app.MyApp’]
no file ‘.\app\MyApp.lua’
no file ‘D:\cocos\quick-cocos2d-x\quick\player\win32\lua\app\MyApp.lua’
no file ‘D:\cocos\quick-cocos2d-x\quick\player\win32\lua\app\MyApp\init.lua’
no file ‘D:\cocos\quick-cocos2d-x\quick\player\win32\app\MyApp.lua’
no file ‘D:\cocos\quick-cocos2d-x\quick\player\win32\app\MyApp\init.lua’
no file ‘D:/myGameDir/wshRelease/src/app\MyApp.lua’
no file ‘src/’
no file ‘.\app\MyApp.dll’
no file ‘D:\cocos\quick-cocos2d-x\quick\player\win32\app\MyApp.dll’
no file ‘D:\cocos\quick-cocos2d-x\quick\player\win32\loadall.dll’
no file ‘.\app.dll’
no file ‘D:\cocos\quick-cocos2d-x\quick\player\win32\app.dll’
no file 'D:\cocos\quick-cocos2d-x\quick\player\win32\loadall.dll

今天刚刚发现加密的脚本不能跑…

吐槽:说好的无痛升级在哪里,我这次升级又痛了一下。虽然没有上次3.2升3.3那么痛。

抱歉抱歉,不懂用论坛,问题已经解决,却一直标记着未解决,话说如果这个论坛加一个功能,就是我一直不鸟一个问题的进展应该给我标一个处理超时的状态嘛,搞得我看到我这么古老的问题被顶这里一直没处理多不好意思,大神都有回复了还一直不处理~~没注意。。

you need this:
http://www.cocoachina.com/bbs/read.php?tid-282762.html

我也遇到这个问题,我不想在AppDelegate.ccp 去load game.zip文件,而是要在main.lua里面去LuaLoadChunksFromZIP(“res/game.zip”),主要用于做资源更新用
,求版主来解决一下,我的环境是windows,quick3.3final,在模拟器上测试报错

一样在main.lua里面也可以load的~~只是这回是一定要改C++代码的,把AppDelegate.cpp文件里面的

engine->executeScriptFile(ConfigParser::getInstance()->getEntryFile().c_str());
的函数为
stack->executeString(“require ‘main’”);

只要改这个就行了。

但是这是要改C++了呀,求不改C++。。。

话说,做动态更新LuaLoadChunksFromZIP会有问题~我过来人,LuaLoadChunksFromZIP加载的包不会释放的,重新调用一次LuaLoadChunksFromZIP那就会重叠,之前的包没有释放掉,不过目前我想出了一个办法,是直接package.loaded = nil然后所有代码再require一遍,但是可行还在研究中~~

遇到同样的问题了,求解为什么一定要改C++才可以呢?

没有修改C++啊 cc.LuaLoadChunksFromZIP 调用应该没有问题啊。

engine->executeScriptFile(ConfigParser::getInstance()->getEntryFile().c_str());
的函数为
stack->executeString(“require ‘main’”);

只要改这个就行了。

需要这样改才行,不然就会像楼主那样报错。

我没有修改也能正常跑起来啊。

重新用 compile_scripts.bat 加密一次 看看运行结果。
之前是luajit, 最后改为了lua

楼主问题解决了吗?怎么解决的?