From bd7f90f9933883fd5b49f3a8ba68b11d27f279d5 Mon Sep 17 00:00:00 2001 From: Chris Hannon Date: Sat, 19 Sep 2015 20:47:54 -0400 Subject: [PATCH] adds initializing value and corrects spelling of variable _endpointseparator Signed-off-by: Chris Hannon --- cocos/network/SocketIO.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cocos/network/SocketIO.cpp b/cocos/network/SocketIO.cpp index fdce6eb210..7aade376a0 100644 --- a/cocos/network/SocketIO.cpp +++ b/cocos/network/SocketIO.cpp @@ -84,7 +84,7 @@ protected: std::string _name;//event name std::vector _args;//we will be using a vector of strings to store multiple data std::string _endpoint;// - std::string _endpointseperator;//socket.io 1.x requires a ',' between endpoint and payload + std::string _endpointseparator;//socket.io 1.x requires a ',' between endpoint and payload std::string _type;//message type std::string _separator;//for stringify the object std::vector _types;//types of messages @@ -101,7 +101,7 @@ private: std::vector _typesMessage; }; -SocketIOPacket::SocketIOPacket() :_separator(":") +SocketIOPacket::SocketIOPacket() :_separator(":"), _endpointseparator("") { _types.push_back("disconnect"); _types.push_back("connect"); @@ -149,7 +149,7 @@ std::string SocketIOPacket::toString()const // Add the endpoint for the namespace to be used if not the default namespace "" or "/", and as long as it is not an ACK, heartbeat, or disconnect packet if (_endpoint != "/" && _endpoint != "" && _type != "ack" && _type != "heartbeat" && _type != "disconnect") { - encoded << _endpoint << _endpointseperator; + encoded << _endpoint << _endpointseparator; } encoded << this->_separator; @@ -231,7 +231,7 @@ std::string SocketIOPacket::stringify()const SocketIOPacketV10x::SocketIOPacketV10x() { _separator = ""; - _endpointseperator = ","; + _endpointseparator = ","; _types.push_back("disconnected"); _types.push_back("connected"); _types.push_back("heartbeat");