Exemple #1
0
        public async void Init()
        {
            using var events = _client.ContextActionEvents(new MurmurRPC.ContextAction
            {
                Action  = Action,
                Channel = Channel?.GetMumbleChannel(),
                Context = (uint)Context,
                Server  = Server?.GetMumbleServer(),
                Text    = Text,
                User    = User?.GetMumbleUser()
            });

            if (events?.ResponseStream is null)
            {
                return;
            }

            await foreach (var ev in events.ResponseStream.ReadAllAsync())
            {
                var ch = ev.Channel == null ? null : _client.ChannelGet(ev.Channel);
                var se = ev.Server == null ? null : _client.ServerGet(ev.Server);
                var us = ev.User == null ? null : _client.UserGet(ev.User);

                Trigger?.Invoke(this,
                                new MumbleContextActionEvent(ev.Action, ev.Text, ev.Context, ev.Actor, us, ch, se));
            }
        }
Exemple #2
0
 public MumbleUser(User user, V1.V1Client client)
 {
     _client = client;
     _user   = _client.UserGet(user);
 }