Closed vrwalking closed 11 years ago
Yes, send() and SocketMessage() can be used in unitysocketio, and you should develop your event handler as https://github.com/NetEase/pomelo-unityclient/blob/master/pomelo-unityclient/pomelo-unityclient/EventManager.cs . The same is as issue https://github.com/NetEase/UnitySocketIO/issues/7 .
ok, thanks
I was following 'How to use' :
private void SocketMessage (object sender, MessageEventArgs e) { if ( e!= null && e.Message.Event == "message") { string msg = e.Message.MessageText; process(msg); } }
But e.Message.Event is Null except if we use socket.send(string) on server.
socket.emit('loveall',{love:'emitting love'}) on server side gives null and not 'loveall' as event.
I am aware of the event handling from other issue posts, is this connected to that? without this i need to parse the whole messagetext to get the event name.Please help if i am doing any wrong.