示例#1
0
        public void Ban(string reason = "You have been banned by an operator.")
        {
            var s = _client.BansGet(new Ban.Types.Query
            {
                Server = _user.Server
            }).Bans.ToList();

            var dbuser = _client.DatabaseUserGet(new DatabaseUser
            {
                Id = _user.Id
            });


            s.Add(new Ban
            {
                Name    = _user.Name,
                Reason  = reason,
                Server  = _user.Server,
                Address = _user.Address,
                Hash    = dbuser.Hash,
                Start   = 0,
                Bits    = 32
            });

            var list = new Ban.Types.List();

            list.Server = _user.Server;
            foreach (var ban in s)
            {
                list.Bans.Add(ban);
            }

            _client.BansSet(list);
            Kick(reason);
        }
示例#2
0
 public MumbleDBUser(DatabaseUser user, V1.V1Client client)
 {
     _client = client;
     _user   = _client.DatabaseUserGet(user);
 }