Upgrade cocos/math & cocos/network to v3.13

This commit is contained in:
pandamicro
2016-08-05 18:13:16 +08:00
parent 4afa545394
commit bcbc4e1131
31 changed files with 396 additions and 300 deletions
+8 -9
View File
@@ -27,14 +27,14 @@
****************************************************************************/
#include "SocketIO.h"
#include "network/SocketIO.h"
#include <algorithm>
#include <sstream>
#include <iterator>
#include "base/CCDirector.h"
#include "base/CCScheduler.h"
#include "WebSocket.h"
#include "HttpClient.h"
#include "network/WebSocket.h"
#include "network/HttpClient.h"
#include "json/rapidjson.h"
#include "json/document.h"
@@ -877,9 +877,8 @@ void SIOClientImpl::onMessage(WebSocket* ws, const WebSocket::Data& data)
break;
case 4:
{
const char second = payload.at(0);
int control2 = atoi(&second);
CCLOGINFO("Message code: [%i]", control);
int control2 = payload.at(0) - '0';
CCLOGINFO("Message code: [%i]", control2);
SocketIOPacket *packetOut = SocketIOPacket::createPacketWithType("event", _version);
std::string endpoint = "";
@@ -988,8 +987,8 @@ void SIOClientImpl::onClose(WebSocket* ws)
}
// discard this client
_connected = false;
if (Director::DirectorInstance)
Director::DirectorInstance->getScheduler()->unscheduleAllForTarget(this);
if (Director::getInstance())
Director::getInstance()->getScheduler()->unscheduleAllForTarget(this);
SocketIO::getInstance()->removeSocket(_uri);
}
@@ -1000,7 +999,7 @@ void SIOClientImpl::onClose(WebSocket* ws)
void SIOClientImpl::onError(WebSocket* ws, const WebSocket::ErrorCode& error)
{
CC_UNUSED_PARAM(ws);
CCLOGERROR("Websocket error received: %d", error);
CCLOGERROR("Websocket error received: %d", static_cast<int>(error));
}
//begin SIOClient methods