Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Meetsch/MumbleSharp
Browse files Browse the repository at this point in the history
  • Loading branch information
Meetsch committed Jun 30, 2019
2 parents a1fe0c6 + 82e2ab8 commit 81f0ba3
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions MumbleSharp/Model/User.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ public class User
private readonly IMumbleProtocol _owner;

public UInt32 Id { get; private set; }
public UInt32 ChannelId { get; set; }
public string Name { get; set; }
public string Comment { get; set; }
public bool Deaf { get; set; }
public bool Muted { get; set; }
public bool SelfDeaf { get; set; }
Expand All @@ -35,9 +38,6 @@ public Channel Channel
}
}

public string Name { get; set; }
public string Comment { get; set; }

private readonly CodecSet _codecs = new CodecSet();

public User(IMumbleProtocol owner, uint id)
Expand Down Expand Up @@ -80,26 +80,24 @@ public void Move(Channel channel)
if (_channel == channel)
return;

UserState userstate = new UserState();
userstate.Actor = Id;
userstate.ChannelId = channel.Id;
this.ChannelId = channel.Id;

_owner.Connection.SendControl<UserState>(PacketType.UserState, userstate);
SendUserState();
}

/// <summary>
/// Send the user state (including channel, selfmute, selfdeaf)
/// Send user state (including channel, selfmute, selfdeaf)
/// </summary>
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<UserState>(PacketType.UserState, userstate);
_owner.Connection.SendControl<UserState>(PacketType.UserState, new UserState()
{
Actor = this.Id,
Session = _owner.LocalUser.Id,
ChannelId = this.ChannelId,
SelfMute = this.SelfMuted,
SelfDeaf = this.SelfDeaf,
});
}

protected internal IVoiceCodec GetCodec(SpeechCodecs codec)
Expand Down

0 comments on commit 81f0ba3

Please sign in to comment.