예제 #1
0
        public static void RemoveUser(RiotUser user)
        {
            if (user.IsValid() == false)
            {
                throw new WebResponseException((int)WebResponseStatusCode.Invalid, $"UserManager.RemoveUser - Invalid User. {user}");
            }

            lock (mUsers)
            {
                if (mUsers.Contains(user) == false)
                {
                    throw new WebResponseException((int)WebResponseStatusCode.NotFound, $"UserManager.RemoveUser - Not Found User. {user}");
                }

                mUsers.Remove(user);
            }
        }
예제 #2
0
        public static void AddUser(RiotUser user)
        {
            if (user.IsValid() == false)
            {
                throw new WebResponseException((int)WebResponseStatusCode.Invalid, $"UserManager.AddUser - Invalid User. {user}");
            }

            lock (mUsers)
            {
                if (mUsers.Contains(user))
                {
                    throw new WebResponseException((int)WebResponseStatusCode.AlreadyAdded, $"UserManager.AddUser - This user has already been added. {user}");
                }

                mUsers.Add(user);
            }
        }