Open zhaoxianning opened 6 years ago
不知道改的对不对,反正就是换了个coco2的一个方法,不报错了,进去之后还是一直报错,现在拿不到UI树
[C]: in function 'xpcall'
[string "scripts/.\app/poco/poco_manager.lua"]:160: in function 'onRequest'
[string "scripts/.\app/poco/poco_manager.lua"]:123: in function 'server_loop'
[string "scripts/.\app/poco/poco_manager.lua"]:96: in function <[string "scripts/.\app/poco/poco_manager.lua"]:96>
closing Cocos Poco.
[rpc]closed
initializing Cocos poco.
[rpc]connected
[string "scripts/.\app/poco/Cocos2dxNode.lua"]:171: attempt to call method 'getDescription' (a nil value)
stack traceback:
[string "scripts/.\app/poco/poco_manager.lua"]:174: in function 'getDescription'
[string "scripts/.\app/poco/Cocos2dxNode.lua"]:171: in function <[string "scripts/.\app/poco/Cocos2dxNode.lua"]:80>
(tail call): ?
[string "scripts/.\app/poco/sdk/AbstractNode.lua"]:64: in function 'enumerateAttrs'
[string "scripts/.\app/poco/sdk/AbstractDumper.lua"]:33: in function 'dumpHierarchyImpl'
[string "scripts/.\app/poco/Cocos2dxFrozenDumper.lua"]:51: in function <[string "scripts/.\app/poco/Cocos2dxFrozenDumper.lua"]:50>
(tail call): ?
(tail call): ?
[string "scripts/.\app/poco/poco_manager.lua"]:161: in function <[string "scripts/.\app/poco/poco_manager.lua"]:160>
[C]: in function 'xpcall'
[string "scripts/.\app/poco/poco_manager.lua"]:160: in function 'onRequest'
[string "scripts/.\app/poco/poco_manager.lua"]:123: in function 'server_loop'
[string "scripts/.\app/poco/poco_manager.lua"]:96: in function <[string "scripts/.\app/poco/poco_manager.lua"]:96>
在这个文件里app/poco/Cocos2dxNode.lua
还有一个地方没改对,getChildren
获取子节点列表时没获取对,你可以根据报错信息将所有cocos2dx 3.0以上的api都改成你们版本所用的,理论上没什么大的兼容性问题。
我们都改了API了,不报错了,还是不行啊
你现在游戏脚本里运行下面的代码调试下,看下打印出来的数据是否正常。
local json = require('dkjson')
local Dumper:dumpHierarchy= require('poco.Cocos2dxFrozenDumper')
local tree = Dumper:dumpHierarchy(true)
print(json.encode(tree))
然后检查是否有类似下面的log输出,没有的话就检查luasocket模块是否加载错或版本太旧。
[poco] server listens on tcp://*:%s
还可以将PocoManager.DEBUG = true
来查看更多的调试信息。
按照步骤接SDK后,运行报错 1、按照cocos官方文档接入SDK后提示: