Skip to content

Commit 7709059

Browse files
authored
Merge pull request #34 from Neinndall/dev
HotFix Update v2.4.2.6
2 parents bd63e4b + 991abf4 commit 7709059

39 files changed

+467
-336
lines changed

AssetsManager/App.xaml.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ private void ConfigureServices(IServiceCollection services)
117117

118118
// Windows, Views, and Dialogs
119119
services.AddTransient<MainWindow>();
120+
services.AddTransient<DownloaderWindow>();
120121
services.AddTransient<HomeWindow>();
121122
services.AddTransient<ExplorerWindow>();
122123
services.AddTransient<ComparatorWindow>();

AssetsManager/AssetsManager.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<OutputType>WinExe</OutputType>
44
<TargetFramework>net8.0-windows10.0.26100.0</TargetFramework>
55
<ApplicationIcon>Resources\Img\logo.ico</ApplicationIcon>
6-
<Version>2.4.2.5</Version>
6+
<Version>2.4.2.6</Version>
77
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
88
<UseWPF>true</UseWPF>
99
</PropertyGroup>

AssetsManager/Services/Core/UpdateCheckService.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,12 +154,12 @@ await _monitorService.CheckAllAssetCategoriesAsync(true, (categoryName) =>
154154
{
155155
if (updatedCategoryNames.Count == 1)
156156
{
157-
UpdatesFound?.Invoke($"New assets have been found in {updatedCategoryNames[0]} category!", null);
157+
UpdatesFound?.Invoke($"New assets have been found in {updatedCategoryNames[0]} category", null);
158158
}
159159
else
160160
{
161161
string categories = string.Join(", ", updatedCategoryNames);
162-
UpdatesFound?.Invoke($"New assets found in categories: {categories}!", null);
162+
UpdatesFound?.Invoke($"New assets found in categories: {categories}", null);
163163
}
164164
}
165165
}
@@ -194,7 +194,7 @@ public async Task CheckForGeneralUpdatesAsync(bool silent = false)
194194

195195
if (appUpdateAvailable)
196196
{
197-
UpdatesFound?.Invoke($"Version {newVersion} is available!", newVersion);
197+
UpdatesFound?.Invoke($"Version {newVersion} is available", newVersion);
198198
}
199199

200200
if (_appSettings.SyncHashesWithCDTB)
@@ -203,14 +203,14 @@ await _status.SyncHashesIfNeeds(_appSettings.SyncHashesWithCDTB, silent, () =>
203203
{
204204
if (silent)
205205
{
206-
UpdatesFound?.Invoke("New hashes are available!", null);
206+
UpdatesFound?.Invoke("New hashes are available", null);
207207
}
208208
});
209209
}
210210

211211
if (_appSettings.CheckJsonDataUpdates)
212212
{
213-
await _jsonDataService.CheckJsonDataUpdatesAsync(silent, () => { UpdatesFound?.Invoke("JSON files have been updated!", null); });
213+
await _jsonDataService.CheckJsonDataUpdatesAsync(silent, () => { UpdatesFound?.Invoke("Monitored files have been updated", null); });
214214
}
215215
}
216216

AssetsManager/Services/Downloads/Status.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,15 @@ public async Task<bool> SyncHashesIfNeeds(bool syncHashesWithCDTB, bool silent =
6969

7070
// Comprobamos si es una sincronización inicial.
7171
// Una forma de detectarlo es si la carpeta 'olds' está vacía.
72-
bool isInitialSync = !Directory.EnumerateFileSystemEntries(_directoriesCreator.HashesOldsPath).Any();
72+
bool isInitialSync = !Directory.EnumerateFileSystemEntries(_directoriesCreator.HashesOldPath).Any();
7373

7474
if (isInitialSync)
7575
{
7676
var filesToCopyToOld = new[] { GAME_HASHES_FILENAME, LCU_HASHES_FILENAME };
7777
foreach (var fileName in filesToCopyToOld)
7878
{
7979
var sourceFile = Path.Combine(_directoriesCreator.HashesNewPath, fileName);
80-
var destFile = Path.Combine(_directoriesCreator.HashesOldsPath, fileName);
80+
var destFile = Path.Combine(_directoriesCreator.HashesOldPath, fileName);
8181
if (File.Exists(sourceFile))
8282
{
8383
File.Copy(sourceFile, destFile, true);

AssetsManager/Services/Explorer/WadNodeLoaderService.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -255,9 +255,7 @@ private FileSystemNodeModel AddNodeToVirtualTree(FileSystemNodeModel root, strin
255255
SourceChunkPathHash = chunkHash,
256256
Status = status
257257
};
258-
259-
260-
258+
261259
currentNode.Children.Add(fileNode);
262260
return fileNode;
263261
}
@@ -333,5 +331,4 @@ public async Task<FileSystemNodeModel> FindNodeByVirtualPathAsync(string virtual
333331
});
334332
}
335333
}
336-
}
337-
334+
}

AssetsManager/Services/Explorer/WadSavingService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,4 +237,4 @@ private async Task HandleDataFile(FileSystemNodeModel node, string destinationPa
237237
await File.WriteAllTextAsync(filePath, formattedContent);
238238
}
239239
}
240-
}
240+
}

AssetsManager/Services/Monitor/MonitorService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public void LoadMonitoredUrls()
5151
{
5252
_appSettings.JsonDataModificationDates.TryGetValue(url, out DateTime lastUpdated);
5353

54-
string statusText = "Pending check...";
54+
string statusText = "Pending check";
5555
string lastChecked = "N/A";
5656
Brush statusColor = new SolidColorBrush(Colors.Gray);
5757

AssetsManager/Utils/DirectoriesCreator.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ public class DirectoriesCreator
1212

1313
public string ResourcesPath { get; private set; }
1414
public string HashesNewPath { get; private set; }
15-
public string HashesOldsPath { get; private set; }
15+
public string HashesOldPath { get; private set; }
1616
public string JsonCacheNewPath { get; private set; }
1717
public string JsonCacheOldPath { get; private set; }
1818
public string JsonCacheHistoryPath { get; private set; }
1919
public string AssetsDownloadedPath { get; private set; }
2020
public string SubAssetsDownloadedPath { get; private set; }
2121
public string BackUpOldHashesPath { get; private set; }
2222
public string WadComparisonSavePath { get; private set; }
23-
public string VersionsPath { get; private set; } // Add this
23+
public string VersionsPath { get; private set; }
2424
public string AppDirectory { get; private set; }
2525

2626
public string UpdateCachePath { get; private set; }
@@ -45,8 +45,10 @@ public DirectoriesCreator(LogService logService)
4545
{
4646
_logService = logService;
4747

48-
HashesNewPath = Path.Combine("hashes", "new");
49-
HashesOldsPath = Path.Combine("hashes", "olds");
48+
AppDirectory = AppDomain.CurrentDomain.BaseDirectory;
49+
50+
HashesNewPath = Path.Combine(AppDirectory, "hashes", "new");
51+
HashesOldPath = Path.Combine(AppDirectory, "hashes", "olds");
5052

5153
string appDataPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
5254
string appFolderPath = Path.Combine(appDataPath, "AssetsManager");
@@ -57,8 +59,6 @@ public DirectoriesCreator(LogService logService)
5759
JsonCacheOldPath = Path.Combine(appFolderPath, "json_cache", "old");
5860
JsonCacheHistoryPath = Path.Combine(appFolderPath, "json_cache", "history");
5961

60-
AppDirectory = AppDomain.CurrentDomain.BaseDirectory;
61-
6262
UpdateCachePath = Path.Combine(appFolderPath, "update_cache");
6363
UpdateLogFilePath = Path.Combine(UpdateCachePath, "update_log.log");
6464

@@ -118,7 +118,7 @@ public void GenerateUpdateFilePaths()
118118
public Task CreateHashesDirectories()
119119
{
120120
CreateDirectoryInternal(HashesNewPath, false);
121-
CreateDirectoryInternal(HashesOldsPath, false);
121+
CreateDirectoryInternal(HashesOldPath, false);
122122
return Task.CompletedTask;
123123
}
124124

AssetsManager/Utils/FileTypeDetector.cs

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,21 @@ public static class FileTypeDetector
1212
private static readonly byte[] WEBP_SIGNATURE = { 0x52, 0x49, 0x46, 0x46 }; // RIFF
1313
private static readonly byte[] WEBP_VP8X_SIGNATURE = { 0x57, 0x45, 0x42, 0x50 }; // WEBP
1414
private static readonly byte[] OGG_SIGNATURE = { 0x4F, 0x67, 0x67, 0x53 }; // "OggS"
15+
private static readonly byte[] WEBM_SIGNATURE = { 0x1A, 0x45, 0xDF, 0xA3 }; // EBML header
1516
private static readonly byte[] WEM_SIGNATURE = { 0x52, 0x49, 0x46, 0x46 }; // RIFF
1617
private static readonly byte[] WEM_WAVE_SIGNATURE = { 0x57, 0x41, 0x56, 0x45 }; // WAVE
1718
private static readonly byte[] BNK_SIGNATURE = { 0x42, 0x4B, 0x48, 0x44 }; // "BKHD"
18-
private static readonly byte[] SKL_SIGNATURE = { 0x53, 0x4B, 0x4C, 0x5F }; // "SKL_"
19+
private static readonly byte[] SKL_SIGNATURE = { 0x72, 0x33, 0x64, 0x32, 0x73, 0x6B, 0x6C, 0x74 }; // "r3d2sklt"
1920
private static readonly byte[] SKN_SIGNATURE = { 0x33, 0x22, 0x11, 0x00 };
20-
private static readonly byte[] ANM_SIGNATURE = { 0x72, 0x41, 0x6E, 0x6D }; // "rAnm"
21+
private static readonly byte[] R3D2MESH_SIGNATURE = { 0x72, 0x33, 0x64, 0x32, 0x4D, 0x65, 0x73, 0x68 }; // "r3d2Mesh"
22+
private static readonly byte[] ANM_R3D2ANMD_SIGNATURE = { 0x72, 0x33, 0x64, 0x32, 0x61, 0x6E, 0x6D, 0x64 }; // "r3d2anmd"
23+
private static readonly byte[] ANM_R3D2CANM_SIGNATURE = { 0x72, 0x33, 0x64, 0x32, 0x63, 0x61, 0x6E, 0x6D }; // "r3d2canm"
24+
private static readonly byte[] MAPGEO_SIGNATURE = { 0x4F, 0x45, 0x47, 0x4D }; // "OEGM"
25+
26+
private static readonly byte[] SCO_SIGNATURE = { 0x5B, 0x4F, 0x62, 0x6A }; // "[Obj"
27+
private static readonly byte[] LUAQ_SIGNATURE = { 0x4C, 0x75, 0x61, 0x51 }; // "LuaQ"
28+
private static readonly byte[] PRELOAD_SIGNATURE = { 0x50, 0x72, 0x65, 0x4C, 0x6F, 0x61, 0x64 }; // "PreLoad"
29+
private static readonly byte[] RST_SIGNATURE = { 0x52, 0x53, 0x54 }; // "RST"
2130
private static readonly byte[] BIN_PROP_SIGNATURE = { 0x50, 0x52, 0x4F, 0x50 }; // "PROP"
2231
private static readonly byte[] BIN_PTCH_SIGNATURE = { 0x50, 0x54, 0x43, 0x48 }; // "PTCH"
2332
private static readonly byte[] ICO_SIGNATURE = { 0x00, 0x00, 0x01, 0x00 };
@@ -33,10 +42,18 @@ public static string GuessExtension(Span<byte> data)
3342
if (StartsWith(data, PNG_SIGNATURE)) return "png";
3443
if (StartsWith(data, JPG_SIGNATURE)) return "jpg";
3544
if (StartsWith(data, OGG_SIGNATURE)) return "ogg";
45+
if (StartsWith(data, WEBM_SIGNATURE)) return "webm";
3646
if (StartsWith(data, BNK_SIGNATURE)) return "bnk";
3747
if (StartsWith(data, SKL_SIGNATURE)) return "skl";
3848
if (StartsWith(data, SKN_SIGNATURE)) return "skn";
39-
if (StartsWith(data, ANM_SIGNATURE)) return "anm";
49+
if (StartsWith(data, R3D2MESH_SIGNATURE)) return "scb";
50+
if (StartsWith(data, ANM_R3D2ANMD_SIGNATURE) || StartsWith(data, ANM_R3D2CANM_SIGNATURE)) return "anm";
51+
if (StartsWith(data, MAPGEO_SIGNATURE)) return "mapgeo";
52+
if (StartsWith(data, SCO_SIGNATURE)) return "sco";
53+
if (Contains(data, LUAQ_SIGNATURE, 1)) return "luaobj";
54+
if (StartsWith(data, PRELOAD_SIGNATURE)) return "preload";
55+
if (StartsWith(data, RST_SIGNATURE)) return "stringtable";
56+
4057
if (StartsWith(data, BIN_PROP_SIGNATURE) || StartsWith(data, BIN_PTCH_SIGNATURE)) return "bin";
4158
if (StartsWith(data, ICO_SIGNATURE)) return "ico";
4259

AssetsManager/Utils/HashCopier.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public async Task HandleCopyAsync(bool autoCopyHashes)
2828
private async Task CopyNewHashesToOlds()
2929
{
3030
string sourcePath = _directoriesCreator.HashesNewPath;
31-
string destinationPath = _directoriesCreator.HashesOldsPath;
31+
string destinationPath = _directoriesCreator.HashesOldPath;
3232
var filesToCopy = new[] { "hashes.game.txt", "hashes.lcu.txt" };
3333

3434
try

0 commit comments

Comments
 (0)