Skip to content

Commit

Permalink
fix: add AssetOS to Console
Browse files Browse the repository at this point in the history
  • Loading branch information
SdtBarbarossa committed Apr 4, 2024
1 parent 7204712 commit fa93d09
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 4 deletions.
4 changes: 3 additions & 1 deletion SwgohAssetGetterConsole/DefaultSettings.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Newtonsoft.Json;
using AssetGetterTools.models;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
Expand All @@ -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()
{
Expand Down
27 changes: 25 additions & 2 deletions SwgohAssetGetterConsole/MainProgram.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }

Expand All @@ -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()
Expand Down Expand Up @@ -106,7 +129,7 @@ public List<string> 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())
Expand Down
3 changes: 2 additions & 1 deletion SwgohAssetGetterConsole/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit fa93d09

Please sign in to comment.