Error
January 9, 2019, 6:13am
#1
NodeJs code :
socket.on(‘joinRoom’,(room)=>{
console.log(room);
var id=socket.id;
var us ={room,id}
rooms.push(us);
io.to(room).emit('nm','NewPlayer Join In Group '+ room );
});
cocos2dx code :
void HelloWorld::dMsg(std::string msg){
_client->on(“nm”, CC_CALLBACK_2(HelloWorld::onReceiveEvent, this));
}
========= cant get msg from server in SocketIO in on Method =============
check something if I am wrong anywhere
and it Work on good in this :
io.sockets.emit(‘nm’, 'NewPlayer Join In Group '+ room);
but it will send every socket connect user i need to send for Particular user or room
Error
January 9, 2019, 6:41am
#3
Socket working proper im talking about different thing .
For particular room is not working
But that is sockeio question, why you are asking here? It has nothing to do with client side.
Try to look into socketio website or stackoverflow.
Error
January 9, 2019, 7:18am
#5
void HelloWorld::dMsg(std::string msg){
_client->on(“nm”, CC_CALLBACK_2(HelloWorld::onReceiveEvent, this));
}
there is not problem? right
please look into cpp-test for cocos2d-x side implementation.
1 Like
Yes, this should help you Thanks @smitpatel88
Error
January 10, 2019, 7:30am
#8
Sorry i miss 1 point from NodeJS now working good . its NodeJs side problem