Skip to content
This repository was archived by the owner on Oct 26, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Wizard.Application/PatchClientDownloader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public PatchClientDownloader(string wizard101Version)
{
_httpClient = new HttpClient();
_httpClient.BaseAddress =
new Uri($"http://versionec.us.wizard101.com/WizPatcher/V_{wizard101Version}/");
new Uri($"http://versionak.us.wizard101.com/WizPatcher/V_{wizard101Version}/");
_httpClient.Timeout = TimeSpan.FromHours(12);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Wizard.Application/Wizard.Application.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Serilog" Version="4.0.2"/>
<PackageReference Include="Serilog" Version="4.3.0"/>
</ItemGroup>

</Project>
35 changes: 20 additions & 15 deletions src/Wizard.ConsoleInterface/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Debug()
.WriteTo.File("logs/app.txt", rollingInterval: RollingInterval.Day)
.WriteTo.Console()
.CreateLogger();

try
Expand All @@ -18,7 +19,7 @@
Environment.Exit(1);
}

Console.WriteLine("wizard - the little helper");
Log.Information("wizard - the little helper");

var applicationDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!;
var tempPatchFileDirectory = Path.Combine(applicationDirectory, "TempPatchFiles");
Expand All @@ -41,29 +42,31 @@
Environment.Exit(1);
}

Console.WriteLine($"Found Wizard101 installation at location {installPath}");
Console.WriteLine($"Wizard101 data version is: {wizard101Version}");
Log.Information("Found Wizard101 installation at location {InstallPath}", installPath);
Log.Information("Wizard101 data version is: {Wizard101Version}", wizard101Version);

directoryManipulator.DestroyGameData();

Console.WriteLine("Deleted previously installed GameData and ObjectCache for a fresh installation.");
Console.WriteLine("Downloading LatestFileList.bin to discover all Wizard101 files.");
Log.Information("Deleted previously installed GameData and ObjectCache for a fresh installation.");
Log.Information("Downloading LatestFileList.bin to discover all Wizard101 files.");

var patchClientDownloader = new PatchClientDownloader(wizard101Version);
await patchClientDownloader.DownloadLatestFileListAsync(tempPatchFileDirectory);

Console.WriteLine("Downloaded LatestFileList.bin successfully!");
Log.Information("Downloaded LatestFileList.bin successfully!");

var latestFileListExtractor =
new LatestFileListExtractor(Path.Combine(tempPatchFileDirectory, "LatestFileList.bin"));
var filesDiscovered = await latestFileListExtractor.ExtractStringsAsync();

Console.WriteLine($"Discovered {filesDiscovered.Count} downloadable objects from the LatestFileList.bin file.");
Log.Information("Discovered {FilesDiscoveredCount} downloadable objects from the LatestFileList.bin file.",
filesDiscovered.Count);

var additionalFilesParser = new AdditionalFilesParser(Path.Combine(applicationDirectory, "AdditionalFiles.txt"));
var additionalFiles = await additionalFilesParser.GetAdditionalFilesAsync();

Console.WriteLine($"Discovered {additionalFiles.Count} downloadable objects from the AdditionalFiles.txt file.");
Log.Information("Discovered {AdditionalFilesCount} downloadable objects from the AdditionalFiles.txt file.",
additionalFiles.Count);

var allFiles = new List<string>();
allFiles.AddRange(filesDiscovered);
Expand All @@ -72,30 +75,32 @@
allFiles = allFiles.Distinct().ToList();
allFiles.Sort();

Console.WriteLine(
$"Discovered a total of {allFiles.Count} files to download after merging and removing duplicates.");
Log.Information(
"Discovered a total of {AllFilesCount} files to download after merging and removing duplicates.",
allFiles.Count);

await directoryManipulator.OverrideLocalPackagesListAsync(allFiles);

Console.WriteLine(
Log.Information(
"Deleted previously installed LocalPackagesList for a fresh installation and override with complete list.");

var currentFile = 1;
foreach (var file in allFiles)
{
Console.WriteLine($"[{currentFile:D4}/{allFiles.Count:D4}] BEGIN {file}");
Log.Information("[{CurrentFile:D4}/{AllFilesCount:D4}] BEGIN {File}", currentFile, allFiles.Count, file);

var fileSize = await patchClientDownloader.GetFileSizeAsync(file);

Console.WriteLine(
$"[{currentFile:D4}/{allFiles.Count:D4}] BEGIN {file} | File size: {fileSize / (1024.0 * 1024.0):F2}MB");
Log.Information(
"[{CurrentFile:D4}/{AllFilesCount:D4}] BEGIN {File} | File size: {FileSize:F2}MB", currentFile,
allFiles.Count, file, fileSize / (1024.0 * 1024.0));

await patchClientDownloader.DownloadFileAsync(file, Path.Combine(installPath, "Data", "GameData"));

currentFile++;
}

Console.WriteLine(
Log.Information(
"The files were successfully downloaded to the Wizard101 client. Please start up your game and enjoy!~");
}
catch (Exception ex)
Expand Down
5 changes: 3 additions & 2 deletions src/Wizard.ConsoleInterface/Wizard.ConsoleInterface.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Serilog" Version="4.0.2"/>
<PackageReference Include="Serilog.Sinks.File" Version="6.0.0"/>
<PackageReference Include="Serilog" Version="4.3.0"/>
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0"/>
<PackageReference Include="Serilog.Sinks.File" Version="7.0.0"/>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,16 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="coverlet.collector" Version="6.0.2"/>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1"/>
<PackageReference Include="xunit" Version="2.9.2"/>
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2"/>
<PackageReference Include="coverlet.collector" Version="6.0.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.0"/>
<PackageReference Include="xunit" Version="2.9.3"/>
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
Expand Down
Loading