mirror of https://github.com/axmolengine/axmol.git
issue #2823: comment some test codes.
This commit is contained in:
parent
c381e4ce50
commit
d033411bbe
|
@ -1938,7 +1938,7 @@ void ScriptingCore::enableDebugger() {
|
|||
JS_DefineFunction(cx_, debugGlobal_, "_unlockVM", JSBDebug_UnlockExecution, 0, JSPROP_READONLY | JSPROP_PERMANENT);
|
||||
|
||||
runScript("jsb_debugger.js", debugGlobal_);
|
||||
runScript("SysTest/script.js", debugGlobal_);
|
||||
// runScript("SysTest/script.js", debugGlobal_);
|
||||
|
||||
// prepare the debugger
|
||||
jsval argv = OBJECT_TO_JSVAL(global_);
|
||||
|
@ -2254,142 +2254,134 @@ static void serverEntryPoint(void)
|
|||
buf[readBytes] = '\0';
|
||||
TRACE_DEBUGGER_SERVER("debug server : received command >%s", buf);
|
||||
|
||||
if (recieveIndex == 1)
|
||||
{
|
||||
replyToClient(clientSocket, "{ \"from\":\"root\", \"tabs\":[{ \"actor\":\"JSBTabActor\", \"title\":\"Hello cocos2d-x JSB\", \"url\":\"http://www.cocos2d-x.org\" }], \"selected\":0 }");
|
||||
}
|
||||
else if (recieveIndex == 2)
|
||||
{
|
||||
replyToClient(clientSocket, "{ \"from\":\"JSBTabActor\", \"type\":\"tabAttached\", \"threadActor\":\"tabThreadActor111\" }");
|
||||
}
|
||||
else if (recieveIndex == 3)
|
||||
{
|
||||
replyToClient(clientSocket, "{\
|
||||
\"from\": \"tabThreadActor111\",\
|
||||
\"type\": \"paused\",\
|
||||
\"actor\": \"JSBTabActor\",\
|
||||
\"poppedFrames\": [],\
|
||||
\"why\": {\
|
||||
\"type\": \"attached\"\
|
||||
}\
|
||||
}");
|
||||
|
||||
|
||||
|
||||
//replyToClient(clientSocket, "{ \"from\":\"JSBTabActor\", \"type\":\"tabNavigated\", \"state\":\"start\", \"url\":\"my_url.js\" }");
|
||||
}
|
||||
else if (recieveIndex == 4)
|
||||
{
|
||||
// replyToClient(clientSocket, "{\"from\": \"tabThreadActor111\",\
|
||||
// if (recieveIndex == 1)
|
||||
// {
|
||||
// replyToClient(clientSocket, "{ \"from\":\"root\", \"tabs\":[{ \"actor\":\"JSBTabActor\", \"title\":\"Hello cocos2d-x JSB\", \"url\":\"http://www.cocos2d-x.org\" }], \"selected\":0 }");
|
||||
// }
|
||||
// else if (recieveIndex == 2)
|
||||
// {
|
||||
// replyToClient(clientSocket, "{ \"from\":\"JSBTabActor\", \"type\":\"tabAttached\", \"threadActor\":\"tabThreadActor111\" }");
|
||||
// }
|
||||
// else if (recieveIndex == 3)
|
||||
// {
|
||||
// replyToClient(clientSocket, "{\
|
||||
// \"from\": \"tabThreadActor111\",\
|
||||
// \"type\": \"paused\",\
|
||||
// \"actor\": \"JSBTabActor\",\
|
||||
// \"poppedFrames\": [],\
|
||||
// \"why\": {\
|
||||
// \"type\": \"attached\"\
|
||||
// }\
|
||||
// }");
|
||||
//
|
||||
//
|
||||
//
|
||||
// //replyToClient(clientSocket, "{ \"from\":\"JSBTabActor\", \"type\":\"tabNavigated\", \"state\":\"start\", \"url\":\"my_url.js\" }");
|
||||
// }
|
||||
// else if (recieveIndex == 4)
|
||||
// {
|
||||
// replyToClient(clientSocket, "{\
|
||||
// \"from\": \"tabThreadActor111\",\
|
||||
// \"type\": \"newSource\",\
|
||||
// \"source\": {\
|
||||
// \"actor\": \"source_actor2\",\
|
||||
// \"url\": \"http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js\",\
|
||||
// \"actor\": \"source_actor1\",\
|
||||
// \"url\": \"file://~/Project/cocos2d-html5/cocos2d/CCDirector.js\",\
|
||||
// \"isBlackBoxed\": false\
|
||||
// }}");
|
||||
|
||||
replyToClient(clientSocket, "{\
|
||||
\"from\": \"tabThreadActor111\",\
|
||||
\"type\": \"newSource\",\
|
||||
\"source\": {\
|
||||
\"actor\": \"source_actor1\",\
|
||||
\"url\": \"file://~/Project/cocos2d-html5/cocos2d/CCDirector.js\",\
|
||||
\"isBlackBoxed\": false\
|
||||
}\
|
||||
}");
|
||||
|
||||
replyToClient(clientSocket,
|
||||
"{\
|
||||
\"sources\": [\
|
||||
{\
|
||||
\"actor\": \"source_actor1\",\
|
||||
\"url\": \"file://~/Project/cocos2d-html5/cocos2d/CCDirector.js\",\
|
||||
\"isBlackBoxed\": false\
|
||||
}\
|
||||
],\
|
||||
\"from\": \"tabThreadActor111\"\
|
||||
}");
|
||||
}
|
||||
else if (recieveIndex == 5)
|
||||
{
|
||||
replyToClient(clientSocket, "{\
|
||||
\"from\": \"source_actor1\",\
|
||||
\"source\": {\
|
||||
\"type\": \"longString\",\
|
||||
\"initial\": \"var cc = cc || {}; cc.Director = {};\",\
|
||||
\"length\": 100,\
|
||||
\"actor\": \"conn2.longString48\"\
|
||||
}\
|
||||
}");
|
||||
}
|
||||
else if (recieveIndex == 6)
|
||||
{
|
||||
replyToClient(clientSocket, "{\
|
||||
\"from\": \"conn2.longString48\",\
|
||||
\"substring\": \"var cc = cc || {}; cc.Director = {};\
|
||||
\\ncc.Sprite = {};\"\
|
||||
}");
|
||||
|
||||
|
||||
replyToClient(clientSocket, "{\
|
||||
\"from\": \"tabThreadActor111\",\
|
||||
\"type\": \"resumed\"\
|
||||
}");
|
||||
}
|
||||
else if (recieveIndex == 7)
|
||||
{
|
||||
replyToClient(clientSocket, "{\
|
||||
\"from\": \"tabThreadActor111\",\
|
||||
\"type\": \"resumed\"\
|
||||
}");
|
||||
}
|
||||
else if (recieveIndex == 8)
|
||||
{
|
||||
replyToClient(clientSocket, "{ \"from\":\"tabThreadActor111\", \"actor\":\"breakActor\"}");//, \"actualLocation\":2 }");
|
||||
}
|
||||
else if (recieveIndex == 9)
|
||||
{
|
||||
replyToClient(clientSocket, "{ \"from\":\"breakActor\" }");
|
||||
}
|
||||
else if (recieveIndex == 10)
|
||||
{
|
||||
replyToClient(clientSocket, "{\
|
||||
\"from\": \"tabThreadActor111\",\
|
||||
\"type\": \"resumed\"\
|
||||
}");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
std::string recvBuf = buf;
|
||||
auto found = recvBuf.find("setBreakpoint");
|
||||
if (found != std::string::npos)
|
||||
{
|
||||
replyToClient(clientSocket, "{ \"from\":\"tabThreadActor111\", \"actor\":\"breakActor\"}");//, \"actualLocation\":2 }");
|
||||
}
|
||||
|
||||
found = recvBuf.find("delete");
|
||||
if (found != std::string::npos)
|
||||
{
|
||||
replyToClient(clientSocket, "{ \"from\":\"breakActor\" }");
|
||||
}
|
||||
|
||||
found = recvBuf.find("interrupt");
|
||||
if (found != std::string::npos)
|
||||
{
|
||||
replyToClient(clientSocket, "{\
|
||||
\"from\": \"tabThreadActor111\",\
|
||||
\"type\": \"resumed\"\
|
||||
}");
|
||||
}
|
||||
|
||||
}
|
||||
++recieveIndex;
|
||||
// }\
|
||||
// }");
|
||||
//
|
||||
// replyToClient(clientSocket,
|
||||
// "{\
|
||||
// \"sources\": [\
|
||||
// {\
|
||||
// \"actor\": \"source_actor1\",\
|
||||
// \"url\": \"file://~/Project/cocos2d-html5/cocos2d/CCDirector.js\",\
|
||||
// \"isBlackBoxed\": false\
|
||||
// }\
|
||||
// ],\
|
||||
// \"from\": \"tabThreadActor111\"\
|
||||
// }");
|
||||
// }
|
||||
// else if (recieveIndex == 5)
|
||||
// {
|
||||
// replyToClient(clientSocket, "{\
|
||||
// \"from\": \"source_actor1\",\
|
||||
// \"source\": {\
|
||||
// \"type\": \"longString\",\
|
||||
// \"initial\": \"var cc = cc || {}; cc.Director = {};\",\
|
||||
// \"length\": 100,\
|
||||
// \"actor\": \"conn2.longString48\"\
|
||||
// }\
|
||||
// }");
|
||||
// }
|
||||
// else if (recieveIndex == 6)
|
||||
// {
|
||||
// replyToClient(clientSocket, "{\
|
||||
// \"from\": \"conn2.longString48\",\
|
||||
// \"substring\": \"var cc = cc || {}; cc.Director = {};\
|
||||
//\\ncc.Sprite = {};\"\
|
||||
// }");
|
||||
//
|
||||
//
|
||||
// replyToClient(clientSocket, "{\
|
||||
// \"from\": \"tabThreadActor111\",\
|
||||
// \"type\": \"resumed\"\
|
||||
// }");
|
||||
// }
|
||||
// else if (recieveIndex == 7)
|
||||
// {
|
||||
// replyToClient(clientSocket, "{\
|
||||
// \"from\": \"tabThreadActor111\",\
|
||||
// \"type\": \"resumed\"\
|
||||
// }");
|
||||
// }
|
||||
// else if (recieveIndex == 8)
|
||||
// {
|
||||
// replyToClient(clientSocket, "{ \"from\":\"tabThreadActor111\", \"actor\":\"breakActor\"}");//, \"actualLocation\":2 }");
|
||||
// }
|
||||
// else if (recieveIndex == 9)
|
||||
// {
|
||||
// replyToClient(clientSocket, "{ \"from\":\"breakActor\" }");
|
||||
// }
|
||||
// else if (recieveIndex == 10)
|
||||
// {
|
||||
// replyToClient(clientSocket, "{\
|
||||
// \"from\": \"tabThreadActor111\",\
|
||||
// \"type\": \"resumed\"\
|
||||
// }");
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
//
|
||||
//
|
||||
// std::string recvBuf = buf;
|
||||
// auto found = recvBuf.find("setBreakpoint");
|
||||
// if (found != std::string::npos)
|
||||
// {
|
||||
// replyToClient(clientSocket, "{ \"from\":\"tabThreadActor111\", \"actor\":\"breakActor\"}");//, \"actualLocation\":2 }");
|
||||
// }
|
||||
//
|
||||
// found = recvBuf.find("delete");
|
||||
// if (found != std::string::npos)
|
||||
// {
|
||||
// replyToClient(clientSocket, "{ \"from\":\"breakActor\" }");
|
||||
// }
|
||||
//
|
||||
// found = recvBuf.find("interrupt");
|
||||
// if (found != std::string::npos)
|
||||
// {
|
||||
// replyToClient(clientSocket, "{\
|
||||
// \"from\": \"tabThreadActor111\",\
|
||||
// \"type\": \"resumed\"\
|
||||
// }");
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// ++recieveIndex;
|
||||
// no other thread is using this
|
||||
// inData.append(buf);
|
||||
// // process any input, send any output
|
||||
// clearBuffers();
|
||||
inData.append(buf);
|
||||
// process any input, send any output
|
||||
clearBuffers();
|
||||
} // while(read)
|
||||
|
||||
close(clientSocket);
|
||||
|
|
Loading…
Reference in New Issue