Closed ghost closed 2 years ago
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
Debug.Log($"OnAny/{eventName}:{data}");
if(eventName == "[user] enter")
{
Debug.Log("User Enter");
Thanks @doghappy :) have a good day
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