From fa93d098cd858b15272e7fe3874ed61cd2c87b53 Mon Sep 17 00:00:00 2001 From: Midi Date: Thu, 4 Apr 2024 20:33:09 +0200 Subject: [PATCH] fix: add AssetOS to Console --- SwgohAssetGetterConsole/DefaultSettings.cs | 4 +++- SwgohAssetGetterConsole/MainProgram.cs | 27 ++++++++++++++++++++-- SwgohAssetGetterConsole/settings.json | 3 ++- 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/SwgohAssetGetterConsole/DefaultSettings.cs b/SwgohAssetGetterConsole/DefaultSettings.cs index 53da27d..8be77e3 100644 --- a/SwgohAssetGetterConsole/DefaultSettings.cs +++ b/SwgohAssetGetterConsole/DefaultSettings.cs @@ -1,4 +1,5 @@ -using Newtonsoft.Json; +using AssetGetterTools.models; +using Newtonsoft.Json; using System; using System.Collections.Generic; using System.IO; @@ -12,6 +13,7 @@ public class DefaultSettings public string defaultOutputDirectory { get; set; } public string defaultAssetVersion { get; set; } public bool exportMeshes { get; set; } + public AssetOS assetOS { get; set; } public static DefaultSettings GetDefaultSettings() { diff --git a/SwgohAssetGetterConsole/MainProgram.cs b/SwgohAssetGetterConsole/MainProgram.cs index 969e777..8a43141 100644 --- a/SwgohAssetGetterConsole/MainProgram.cs +++ b/SwgohAssetGetterConsole/MainProgram.cs @@ -18,14 +18,16 @@ public class MainProgram public string AssetVersion { get; set; } public bool exportMeshes { get; set; } + public AssetOS assetOS { get; set; } public string AssetDownloadUrl { get { - return @"https://eaassets-a.akamaihd.net/assetssw.capitalgames.com/PROD/" + this.AssetVersion + @"/Android/ETC/"; + return @"https://eaassets-a.akamaihd.net/assetssw.capitalgames.com/PROD/" + this.AssetVersion + this.AssetOSPath; } } + public string AssetOSPath { get; set; } public Filehelper fileHelper { get; set; } @@ -37,9 +39,30 @@ public MainProgram() this.targetFolder = defaultSettings.defaultOutputDirectory; this.AssetVersion = defaultSettings.defaultAssetVersion; this.exportMeshes = defaultSettings.exportMeshes; + this.assetOS = defaultSettings.assetOS; this.fileHelper = new Filehelper(); this.fileHelper.workingFolder = defaultSettings.workingDirectory; + this.SetAssetOSPath(assetOS); + } + + public void SetAssetOSPath(AssetOS assetOS) + { + switch (assetOS) + { + case AssetOS.Windows: + AssetOSPath = @"/Windows/ETC/"; + break; + case AssetOS.Android: + AssetOSPath = @"/Android/ETC/"; + break; + case AssetOS.iOS: + AssetOSPath = @"/iOS/PVRTC/"; + break; + default: + AssetOSPath = @"/Windows/ETC/"; + break; + } } public void SaveAssetNamesToFile() @@ -106,7 +129,7 @@ public List diffAssetVersions(string oldVersion, DiffType diffType = Dif ManifestHelper manifestHelper = new ManifestHelper(); manifestHelper.ReadFromFile(pathToManifest); - var diffManifestUrl = @"https://eaassets-a.akamaihd.net/assetssw.capitalgames.com/PROD/" + oldVersion + @"/Android/ETC/"; + var diffManifestUrl = @"https://eaassets-a.akamaihd.net/assetssw.capitalgames.com/PROD/" + oldVersion + this.AssetOSPath; var pathToDiffManifest = $"{workingFolder}/Manifest/{oldVersion}_manifest.data"; using (var client = new WebClient()) diff --git a/SwgohAssetGetterConsole/settings.json b/SwgohAssetGetterConsole/settings.json index 266816d..4f91c04 100644 --- a/SwgohAssetGetterConsole/settings.json +++ b/SwgohAssetGetterConsole/settings.json @@ -2,5 +2,6 @@ "workingDirectory": "C:\\Users\\midi\\Documents\\swgoh\\AssetBundles\\", "defaultOutputDirectory": "C:\\Users\\midi\\Documents\\swgoh\\AssetBundles\\OutPut", "defaultAssetVersion": "2046", - "exportMeshes": false + "exportMeshes": false, + "assetOS": 0 }