示例#1
0
        public bool IsAuthInfoExist(PlayerUUID uuid, string userName)
        {
            if (!(LauncherProfile.AuthenticationDatabase?.Any() ?? false))
            {
                return(false);
            }

            var isMatched =
                LauncherProfile.AuthenticationDatabase
                .AsParallel()
                .Any(a =>
                     a.Value.Profiles?
                     .AsParallel()
                     .Any(aa =>
                          aa.Key
                          .ToString()
                          .Equals(uuid.ToString(), StringComparison.OrdinalIgnoreCase) &&
                          aa.Value.DisplayName.Equals(userName, StringComparison.Ordinal)
                          ) ?? false);

            return(isMatched);
        }
示例#2
0
 public void SelectUser(PlayerUUID uuid)
 {
     LauncherProfile.SelectedUser.Account = uuid.ToString();
     SaveProfile();
 }