get correct control code

This commit is contained in:
minggo 2016-07-22 14:30:06 +08:00
parent a97906a280
commit 4c2234fe20
1 changed files with 2 additions and 3 deletions

View File

@ -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 = "";