private void SendLeaveRoom(AudioRoomEx roomEx)
 {
     var message = new VoipMessageLeaveRoom
     {
         RoomName = roomEx.R.AudioRoomId,
         FromUserId = _userData.User.Id
     };
     _audioChatClient.Send(message);
     OnVoiceConnectionChanged(roomEx, false);
 }
 private static IVoipMessage Instantiate(byte mType)
 {
     IVoipMessage m;
     switch (mType)
     {
         case (VoipMessageVoice.MType):
             m = new VoipMessageVoice();
             break;
         case (VoipMessageJoinRoom.MType):
             m = new VoipMessageJoinRoom();
             break;
         case (VoipMessageLeaveRoom.MType):
             m = new VoipMessageLeaveRoom();
             break;
         default:
             m = null;
             break;
     }
     return m;
 }
        private void ReceivedLeave(VoipMessageLeaveRoom message)
        {
            AudioRoomEx roomEx;
            lock (_joinedRooms)
            {
                if (!_joinedRooms.TryGetValue(message.RoomName, out roomEx))
                    return;
            }

            OnVoiceConnectionChanged(roomEx, false);
        }