Skip to content
This repository was archived by the owner on Oct 26, 2025. It is now read-only.

Commit a029f2d

Browse files
authored
Merge pull request #15 from naydevops/file-server-issue
Update libraries, add proper logging and URL for US Server
2 parents d74b19d + 3b90514 commit a029f2d

5 files changed

Lines changed: 35 additions & 23 deletions

File tree

src/Wizard.Application/PatchClientDownloader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public PatchClientDownloader(string wizard101Version)
1010
{
1111
_httpClient = new HttpClient();
1212
_httpClient.BaseAddress =
13-
new Uri($"http://versionec.us.wizard101.com/WizPatcher/V_{wizard101Version}/");
13+
new Uri($"http://versionak.us.wizard101.com/WizPatcher/V_{wizard101Version}/");
1414
_httpClient.Timeout = TimeSpan.FromHours(12);
1515
}
1616

src/Wizard.Application/Wizard.Application.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
</ItemGroup>
1414

1515
<ItemGroup>
16-
<PackageReference Include="Serilog" Version="4.0.2"/>
16+
<PackageReference Include="Serilog" Version="4.3.0"/>
1717
</ItemGroup>
1818

1919
</Project>

src/Wizard.ConsoleInterface/Program.cs

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
Log.Logger = new LoggerConfiguration()
99
.MinimumLevel.Debug()
1010
.WriteTo.File("logs/app.txt", rollingInterval: RollingInterval.Day)
11+
.WriteTo.Console()
1112
.CreateLogger();
1213

1314
try
@@ -18,7 +19,7 @@
1819
Environment.Exit(1);
1920
}
2021

21-
Console.WriteLine("wizard - the little helper");
22+
Log.Information("wizard - the little helper");
2223

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

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

4748
directoryManipulator.DestroyGameData();
4849

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

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

55-
Console.WriteLine("Downloaded LatestFileList.bin successfully!");
56+
Log.Information("Downloaded LatestFileList.bin successfully!");
5657

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

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

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

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

6871
var allFiles = new List<string>();
6972
allFiles.AddRange(filesDiscovered);
@@ -72,30 +75,32 @@
7275
allFiles = allFiles.Distinct().ToList();
7376
allFiles.Sort();
7477

75-
Console.WriteLine(
76-
$"Discovered a total of {allFiles.Count} files to download after merging and removing duplicates.");
78+
Log.Information(
79+
"Discovered a total of {AllFilesCount} files to download after merging and removing duplicates.",
80+
allFiles.Count);
7781

7882
await directoryManipulator.OverrideLocalPackagesListAsync(allFiles);
7983

80-
Console.WriteLine(
84+
Log.Information(
8185
"Deleted previously installed LocalPackagesList for a fresh installation and override with complete list.");
8286

8387
var currentFile = 1;
8488
foreach (var file in allFiles)
8589
{
86-
Console.WriteLine($"[{currentFile:D4}/{allFiles.Count:D4}] BEGIN {file}");
90+
Log.Information("[{CurrentFile:D4}/{AllFilesCount:D4}] BEGIN {File}", currentFile, allFiles.Count, file);
8791

8892
var fileSize = await patchClientDownloader.GetFileSizeAsync(file);
8993

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

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

95100
currentFile++;
96101
}
97102

98-
Console.WriteLine(
103+
Log.Information(
99104
"The files were successfully downloaded to the Wizard101 client. Please start up your game and enjoy!~");
100105
}
101106
catch (Exception ex)

src/Wizard.ConsoleInterface/Wizard.ConsoleInterface.csproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@
1212
</ItemGroup>
1313

1414
<ItemGroup>
15-
<PackageReference Include="Serilog" Version="4.0.2"/>
16-
<PackageReference Include="Serilog.Sinks.File" Version="6.0.0"/>
15+
<PackageReference Include="Serilog" Version="4.3.0"/>
16+
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0"/>
17+
<PackageReference Include="Serilog.Sinks.File" Version="7.0.0"/>
1718
</ItemGroup>
1819

1920
</Project>

tests/Wizard.Application.UnitTests/Wizard.Application.UnitTests.csproj

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,16 @@
1010
</PropertyGroup>
1111

1212
<ItemGroup>
13-
<PackageReference Include="coverlet.collector" Version="6.0.2"/>
14-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1"/>
15-
<PackageReference Include="xunit" Version="2.9.2"/>
16-
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2"/>
13+
<PackageReference Include="coverlet.collector" Version="6.0.4">
14+
<PrivateAssets>all</PrivateAssets>
15+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
16+
</PackageReference>
17+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.0"/>
18+
<PackageReference Include="xunit" Version="2.9.3"/>
19+
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
20+
<PrivateAssets>all</PrivateAssets>
21+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
22+
</PackageReference>
1723
</ItemGroup>
1824

1925
<ItemGroup>

0 commit comments

Comments
 (0)