Example #1
0
 private void processUserRemove(UserRemove userRemove)
 {
     if (!(_mumbleUsers.Remove(userRemove.Session)))
     {
         _logger.LogError($"Server requested removal of user session ID " +
                          $"'{userRemove.Session}' that does not exist in cache.");
     }
     else
     {
         _logger.LogInformation($"Received user removal for session ID " +
                                $"'{userRemove.Session}'.");
     }
     updateChannelStore();
 }
        /// <summary>
        /// Used to communicate user leaving or being kicked.
        /// Sent by the server when it informs the clients that a user is not present anymore.
        /// </summary>
        /// <param name="userRemove"></param>
        public virtual void UserRemove(UserRemove userRemove)
        {
            User user;

            if (UserDictionary.TryRemove(userRemove.Session, out user))
            {
                user.Channel = null;

                UserLeft(user);
            }

            if (user.Equals(LocalUser))
            {
                Connection.Close();
            }
        }
 /// <summary>
 /// Sent by the client when it attempts to kick a user.
 /// </summary>
 /// <param name="userRemove"></param>
 public void SendUserRemove(UserRemove userRemove)
 {
     Connection.SendControl(PacketType.UserRemove, userRemove);
 }
        /// <summary>
        /// A user has been removed from the server (left, kicked or banned)
        /// </summary>
        /// <param name="userRemove"></param>
        public virtual void UserRemove(UserRemove userRemove)
        {
            User user;
            if (UserDictionary.TryRemove(userRemove.session, out user))
            {
                user.Channel = null;

                UserLeft(user);
            }

            if (user.Equals(LocalUser))
                Connection.Close();
        }
Example #5
0
        private void HandleUserRemove(UserManager manager, User user, UserRemove mode)
        {
            string data = Shared.Pack(
                ServerMethod.Leave,
                user.Id,
                user.Username,
                mode == UserRemove.Forced ? "kick" : "leave",
                UnixNow,
                InternalId
            );

            foreach (Service session in Sessions) {
                if (session.User == user) {
                    continue;
                }

                session.Context.WebSocket.Send(data);
            }
        }
Example #6
0
 internal void OnUserRemove(User user) => UserRemove?.Invoke(user);
Example #7
0
 private void HandleUserRemove(UserManager manager, User user, UserRemove mode)
 {
 }
Example #8
0
        public void Remove(User user, UserRemove mode = UserRemove.Normal)
        {
            Actions.BeforeUserRemove.ForEach((Action<UserManager, User, UserRemove> action) => {
                action.Invoke(this, user, mode);
            });

            Users.Remove(user.Id);

            Actions.AfterUserRemove.ForEach((Action<UserManager, User, UserRemove> action) => {
                action.Invoke(this, user, mode);
            });
        }