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
The OnAny function works normally. The string value received through this function can be compared normally. However, it doesn't recognize eventName that I handed over through "On("eventName", response=> {foo();});".
OS / Platform
Windows / Unity 19.4.34f1, target .net 4.xx
Code
voidAwake(){client=new ClientInfo("null", userName);clientSocket=new SocketIO(serverIP);}asyncvoidStart(){//For Event Debug
clientSocket.OnAny((eventName,data)=>{ Debug.Log($"OnAny/{eventName}:{data}");});// It works
clientSocket.On("[user] join",response =>{ userList.Add(JsonConvert.DeserializeObject<ClientInfo>(response.GetValue<string>())); Debug.Log($"client Socket current Id : {clientSocket.Id}");});//not works
clientSocket.On("[user] leave",response =>{stringuserSocketId= GetUserIdFromData(response.GetValue<string>()); userList.RemoveWhere(info => info.id ==userSocketId); Debug.Log($"Delete {userSocketId} from userList");});//not works
clientSocket.On("connection",response =>{ Debug.Log("connection");});// not works
Connect();}
maybe an exception was thrown, have you tried to move Log to the first line?
clientSocket.On("[user] join",response =>{ Debug.Log($"client Socket current Id : {clientSocket.Id}"); userList.Add(JsonConvert.DeserializeObject<ClientInfo>(response.GetValue<string>()));});//not works
maybe you can clean your code like this?
clientSocket.On("[user] join",response =>{ Debug.Log($"client Socket current Id : {clientSocket.Id}"); userList.Add(response.GetValue<ClientInfo>());});
@doghappy Thanks to your reply
For some reason, I confirmed that it works normally after the SocketIO .net update.
When error occurred I use the OnAny like this haha
Problem
The OnAny function works normally. The string value received through this function can be compared normally. However, it doesn't recognize eventName that I handed over through "On("eventName", response=> {foo();});".
OS / Platform
Windows / Unity 19.4.34f1, target .net 4.xx
Code
Etc
Unity console log
![image](https://user-images.githubusercontent.com/97009595/160963010-231b0b67-3ba8-499c-aab2-a19b864e3f6b.png)
The text was updated successfully, but these errors were encountered: