From a1fe0c6c132a74192504cc90e75d5a30c81d1ec7 Mon Sep 17 00:00:00 2001 From: Michel Bagnol Date: Sun, 30 Jun 2019 22:23:19 +0200 Subject: [PATCH] (feature) Send user state including selfmute and selfdeaf without having to ut the move method which imposes to move channel. --- MumbleSharp/Model/User.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/MumbleSharp/Model/User.cs b/MumbleSharp/Model/User.cs index 9a65fb0..ac41b0f 100644 --- a/MumbleSharp/Model/User.cs +++ b/MumbleSharp/Model/User.cs @@ -87,6 +87,21 @@ public void Move(Channel channel) _owner.Connection.SendControl(PacketType.UserState, userstate); } + /// + /// Send the user state (including channel, selfmute, selfdeaf) + /// + public void SendUserState() + { + UserState userstate = new UserState(); + userstate.Actor = this.Id; + userstate.Session = _owner.LocalUser.Id; + userstate.ChannelId = this.Channel.Id; + userstate.SelfMute = this.SelfMuted; + userstate.SelfDeaf = this.SelfDeaf; + + _owner.Connection.SendControl(PacketType.UserState, userstate); + } + protected internal IVoiceCodec GetCodec(SpeechCodecs codec) { return _codecs.GetCodec(codec);