cocos ide 调试lua 程序自动关闭问题的解决

前端之家收集整理的这篇文章主要介绍了cocos ide 调试lua 程序自动关闭问题的解决前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

D:\project\client\muguaji\frameworks\cocos2d-x\tools\simulator\libsimulator\lib\runtime\ConsoleCommand.cpp

rapidjson::Value bodyvalue(rapidjson::kObjectType);

rapidjson::Document* filecfgjson = _fileserver->getFileCfgJson();
for (auto it = filecfgjson->MemberonBegin(); it != filecfgjson->MemberonEnd(); ++it)
{
//bodyvalue.AddMember(it->name.GetString(),it->value.GetString(),dReplyParse.GetAllocator());//注释这一句bug cause lang and shutdownapp 当资源太多的时候ide通信超时直接发起shutdownapp命令,导致onStartDebuger没有被调用,所以没有启动lua调试器
}
dReplyParse.AddMember("body",bodyvalue,dReplyParse.GetAllocator());

dReplyParse.AddMember("code",dReplyParse.GetAllocator());


正常的交互命令应该是这样

onSendCommand是代码中打印的log

Console: listening on 0.0.0.0 : 6010
Console: listening on 0.0.0.0 : 6020
iShow!
onSendCommand {"cmd":"getversion","type":"request","seq":42}
onSendCommand {"cmd":"getfileinfo","seq":43}
onSendCommand {"debugcfg":"'127.0.0.1','10000','luaidekey',nil,'win','\/CocosLuaGame\/'","cmd":"start-logic","seq":44}
onStartDebuger
startScript debug args = require('debugger')('127.0.0.1','/CocosLuaGame/','')
debug args = require('debugger')('127.0.0.1','')



onSendCommand {"cmd":"getversion","seq":42} onSendCommand {"cmd":"getfileinfo","seq":43} //这个地方超时的话会导致exe被关闭

猜你在找的Cocos2d-x相关文章