When the game object gets destroyed that holds the game room, I call room.Leave()
public void OnDestroy()
{
if (isRoomJoined)
{
this.Leave();
}
}
This throws an error whenever I do this though.
WebsocketSharp Error! An exception has occured while OnClose.
Is the issue that I'm leaving while the gameObject is being destroyed?
Edit:
Also, it appears that this doesn't have any actual affect on any other rooms and everything appears to be functioning normally. But it scares me for it to have this error popping up.
Update:
When I try to just leave the room without destroying the game object, I still see the issue
So it looks like the error is coming from this cast of WebSocket to Room.
But I'm still not quite sure how to fix the issue.
If I change this line in Room.cs it makes it work: