public void Stop () {
if (connection.clientId == null)
return;
// Unregisters the client and leaves the room (if in one)
JSONObject obj = JSONObject.Create ();
obj.AddField ("roomId", connection.connected ? connection.roomId : "");
obj.AddField ("clientId", connection.clientId);
Emit ("leaveRoom", obj, (SocketIOEvent e) => {
OnRoomDestroyed ();
});
}