Esempio n. 1
0
 public void updateUserInfo(ChatroomEntity info, bool IsAdmin)
 {
     if (IsAdmin)
     {
         Console.WriteLine("Admin entered");
         if (!admins.Any(s => info.UserEquals(s))) //if an admin is not in the list
         {
             admins.Add(info.identifier.ToString());
             savePersistentData();
         }
     }
     else if (admins.Any(s => info.UserEquals(s))) //if it's not an admin but he's in the list
     {
         admins.Remove(info.identifier.ToString());
         savePersistentData();
     }
 }
Esempio n. 2
0
        public bool admincheck(ChatroomEntity UserToVerify)
        {
            string data = UserToVerify.identifier.ToString();

            if (UserToVerify.Rank == ChatroomEntity.AdminStatus.True | (admins.Any(s => UserToVerify.UserEquals(s))))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }