You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I emit event that is consist of just event name in my node server socket.emit('version')
Than issue occurs in client because of the parsing problem.
When I check the event using Debug.log()
It looks like ["version"] .
So I change Socket.cs code.
before
var seperateIndex = pkt.body.IndexOf(", ");
var seperatorLen = 2;
if (seperateIndex == -1) {
seperateIndex = pkt.body.IndexOf(',');
seperatorLen = 1;
}
var eventName = pkt.body.Substring(2, seperateIndex - 3);
if (!_handlers.ContainsKey(eventName)) {
Debug.LogWarningFormat("{0} event doesn't have a handler", eventName);
break;
}
after
int seperateIndex = pkt.body.IndexOf(", ");
int seperatorLen = 2;
if (seperateIndex == -1) {
seperateIndex = pkt.body.IndexOf(',');
if (seperateIndex == -1) {
seperateIndex = pkt.body.Length - 1;
}
seperatorLen = 1;
}
string eventName = pkt.body.Substring(2, seperateIndex - 3);
if (!_handlers.ContainsKey(eventName)) {
Debug.LogWarningFormat("{0} event doesn't have a handler", eventName);
break;
}
if (eventName.Length == pkt.body.Length - 4) {
_handlers[eventName]("");
break;
}
The text was updated successfully, but these errors were encountered:
@huseong Sorry for my late reply on your issue. Thanks to your report~ I'll check this and apply on develop branch. Or you can make Pull-Request to develop branch. This make me easy to apply your change on our code.
When I emit event that is consist of just event name in my node server
socket.emit('version')
Than issue occurs in client because of the parsing problem.
When I check the event using
Debug.log()
It looks like
["version"]
.So I change Socket.cs code.
before
after
The text was updated successfully, but these errors were encountered: