Пример #1
0
 public void Update(DestinyManifest?other)
 {
     if (other is null)
     {
         return;
     }
     if (Version != other.Version)
     {
         Version = other.Version;
         OnPropertyChanged(nameof(Version));
     }
     if (MobileAssetContentPath != other.MobileAssetContentPath)
     {
         MobileAssetContentPath = other.MobileAssetContentPath;
         OnPropertyChanged(nameof(MobileAssetContentPath));
     }
     if (!MobileGearAssetDataBases.DeepEqualsList(other.MobileGearAssetDataBases))
     {
         MobileGearAssetDataBases = other.MobileGearAssetDataBases;
         OnPropertyChanged(nameof(MobileGearAssetDataBases));
     }
     if (!MobileWorldContentPaths.DeepEqualsDictionaryNaive(other.MobileWorldContentPaths))
     {
         MobileWorldContentPaths = other.MobileWorldContentPaths;
         OnPropertyChanged(nameof(MobileWorldContentPaths));
     }
     if (!JsonWorldContentPaths.DeepEqualsDictionaryNaive(other.JsonWorldContentPaths))
     {
         JsonWorldContentPaths = other.JsonWorldContentPaths;
         OnPropertyChanged(nameof(JsonWorldContentPaths));
     }
     if (!JsonWorldComponentContentPaths.DeepEqualsDictionary(other.JsonWorldComponentContentPaths))
     {
         JsonWorldComponentContentPaths = other.JsonWorldComponentContentPaths;
         OnPropertyChanged(nameof(JsonWorldComponentContentPaths));
     }
     if (MobileClanBannerDatabasePath != other.MobileClanBannerDatabasePath)
     {
         MobileClanBannerDatabasePath = other.MobileClanBannerDatabasePath;
         OnPropertyChanged(nameof(MobileClanBannerDatabasePath));
     }
     if (!MobileGearCDN.DeepEqualsDictionaryNaive(other.MobileGearCDN))
     {
         MobileGearCDN = other.MobileGearCDN;
         OnPropertyChanged(nameof(MobileGearCDN));
     }
     if (!IconImagePyramidInfo.DeepEqualsList(other.IconImagePyramidInfo))
     {
         IconImagePyramidInfo = other.IconImagePyramidInfo;
         OnPropertyChanged(nameof(IconImagePyramidInfo));
     }
 }
Пример #2
0
 public bool DeepEquals(DestinyManifest?other)
 {
     return(other is not null &&
            Version == other.Version &&
            MobileAssetContentPath == other.MobileAssetContentPath &&
            MobileGearAssetDataBases.DeepEqualsList(other.MobileGearAssetDataBases) &&
            MobileWorldContentPaths.DeepEqualsDictionaryNaive(other.MobileWorldContentPaths) &&
            JsonWorldContentPaths.DeepEqualsDictionaryNaive(other.JsonWorldContentPaths) &&
            JsonWorldComponentContentPaths.DeepEqualsDictionaryNaive(other.JsonWorldComponentContentPaths) &&
            MobileClanBannerDatabasePath == other.MobileClanBannerDatabasePath &&
            MobileGearCDN.DeepEqualsDictionaryNaive(other.MobileGearCDN) &&
            IconImagePyramidInfo.DeepEqualsList(other.IconImagePyramidInfo));
 }
Пример #3
0
        public bool Equals(DestinyManifest input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     Version == input.Version ||
                     (Version != null && Version.Equals(input.Version))
                     ) &&
                 (
                     MobileAssetContentPath == input.MobileAssetContentPath ||
                     (MobileAssetContentPath != null && MobileAssetContentPath.Equals(input.MobileAssetContentPath))
                 ) &&
                 (
                     MobileGearAssetDataBases == input.MobileGearAssetDataBases ||
                     (MobileGearAssetDataBases != null && MobileGearAssetDataBases.SequenceEqual(input.MobileGearAssetDataBases))
                 ) &&
                 (
                     MobileWorldContentPaths == input.MobileWorldContentPaths ||
                     (MobileWorldContentPaths != null && MobileWorldContentPaths.SequenceEqual(input.MobileWorldContentPaths))
                 ) &&
                 (
                     JsonWorldContentPaths == input.JsonWorldContentPaths ||
                     (JsonWorldContentPaths != null && JsonWorldContentPaths.SequenceEqual(input.JsonWorldContentPaths))
                 ) &&
                 (
                     JsonWorldComponentContentPaths == input.JsonWorldComponentContentPaths ||
                     (JsonWorldComponentContentPaths != null && JsonWorldComponentContentPaths.SequenceEqual(input.JsonWorldComponentContentPaths))
                 ) &&
                 (
                     MobileClanBannerDatabasePath == input.MobileClanBannerDatabasePath ||
                     (MobileClanBannerDatabasePath != null && MobileClanBannerDatabasePath.Equals(input.MobileClanBannerDatabasePath))
                 ) &&
                 (
                     MobileGearCdn == input.MobileGearCdn ||
                     (MobileGearCdn != null && MobileGearCdn.SequenceEqual(input.MobileGearCdn))
                 ) &&
                 (
                     IconImagePyramidInfo == input.IconImagePyramidInfo ||
                     (IconImagePyramidInfo != null && IconImagePyramidInfo.SequenceEqual(input.IconImagePyramidInfo))
                 ));
        }
Пример #4
0
        //https://www.bungie.net/Platform/GroupV2/User/{membershipType}/{membershipId}/0/1/
        //public static async Task<Character> GetDestiny2ActivitiesDoneByCharacterId(Character characters, string apiKey)
        //{
        //        using (var client = new HttpClient())
        //        {
        //            client.DefaultRequestHeaders.Add("X-API-Key", apiKey);
        //            //string link = apiSite + $"/Destiny2/{membershipType}/Profile/{profile.Data.UserInfo.membershipId}/Character/{id}/?components=100,200";
        //            string link = apiSite + $"/Destiny2/{membershipType}/Account/{characters.data.MembershipId}/Character/{characters.data.CharacterId}/Stats/Activities/?mode=63";

        //            var response = await client.GetAsync(link);
        //            var content = await response.Content.ReadAsStringAsync();
        //            Models.Destiny2Bungie.Character.Root root = Newtonsoft.Json.JsonConvert.DeserializeObject<Models.Destiny2Bungie.Character.Root>(content);

        //            characters = root.Response.character;
        //            //await Context.Channel.SendMessageAsync("", embed: embed);
        //        }

        //    return characters;
        //}

        #region GetSqlLite
        //http://www.bungie.net/platform/Destiny/Manifest/
        public static async Task <MobileWorldContentPaths> GetDestiny2Manifests(string apiKey)
        {
            MobileWorldContentPaths mobileWorldContentPaths = new MobileWorldContentPaths();

            using (var client = new HttpClient())
            {
                client.DefaultRequestHeaders.Add("X-API-Key", apiKey);
                string link = "http://www.bungie.net/platform/Destiny/Manifest/";

                var response = await client.GetAsync(link);

                var content = await response.Content.ReadAsStringAsync();

                Models.Destiny2Bungie.Manifest.Root root = Newtonsoft.Json.JsonConvert.DeserializeObject <Models.Destiny2Bungie.Manifest.Root>(content);

                mobileWorldContentPaths = root.Response.MobileWorldContentPaths;
            }

            return(mobileWorldContentPaths);
        }