diff --git a/Refresher.AndroidApp/MainActivity.cs b/Refresher.AndroidApp/MainActivity.cs index ff92fe4..d8edf35 100644 --- a/Refresher.AndroidApp/MainActivity.cs +++ b/Refresher.AndroidApp/MainActivity.cs @@ -1,7 +1,9 @@ using _Microsoft.Android.Resource.Designer; using Android.Content; -using Refresher.Core.Pipelines; -using Refresher.Core.Pipelines.Lbp; +using Refresher.Core.Patching.Pipelines; +using Refresher.Core.Patching.Pipelines.Lbp; +using Refresher.Core.Patching.Pipelines.Legacy; +using Refresher.Core.Patching.Pipelines.Test; using SCEToolSharp; using ConditionalAttribute = System.Diagnostics.ConditionalAttribute; @@ -24,7 +26,7 @@ protected override void OnCreate(Bundle? savedInstanceState) this.AddButtonForPipeline(mainContent, "Patch LBP1/2/3 for PS3"); this.AddButtonForPipeline(mainContent, "Patch any PS3 game"); - #if DEBUG +#if DEBUG this.AddButtonForPipeline(mainContent, "Example Pipeline"); this.AddSceToolSharpTestButton(mainContent); #endif diff --git a/Refresher.AndroidApp/PipelineActivity.cs b/Refresher.AndroidApp/PipelineActivity.cs index 89a2400..01781f8 100644 --- a/Refresher.AndroidApp/PipelineActivity.cs +++ b/Refresher.AndroidApp/PipelineActivity.cs @@ -4,7 +4,8 @@ using Android.Views; using Refresher.Core; using Refresher.Core.Logging; -using Refresher.Core.Pipelines; +using Refresher.Core.Patching.Pipelines; +using Refresher.Core.Patching.Steps; using static Android.Views.ViewGroup.LayoutParams; namespace Refresher.AndroidApp; diff --git a/Refresher.Core/Accessors/ConsolePatchAccessor.cs b/Refresher.Core/Accessors/ConsolePatchAccessor.cs index 82eebf8..95d33ad 100644 --- a/Refresher.Core/Accessors/ConsolePatchAccessor.cs +++ b/Refresher.Core/Accessors/ConsolePatchAccessor.cs @@ -27,7 +27,7 @@ public ConsolePatchAccessor(string remoteIp) private byte[]? GetIdps() { - State.Logger.LogInfo(IDPS, "Getting IDPS from the console..."); + State.Logger.LogInfo(LogType.IDPS, "Getting IDPS from the console..."); UriBuilder idpsPs3 = new("http", this._remoteIp, 80, "idps.ps3"); UriBuilder idpsHex = new("http", this._remoteIp, 80, "dev_hdd0/idps.hex"); UriBuilder idpsHexUsb = new("http", this._remoteIp, 80, "dev_usb000/idps.hex"); @@ -48,7 +48,7 @@ public ConsolePatchAccessor(string remoteIp) { HttpResponseMessage response; - State.Logger.LogDebug(IDPS, $" {stepName} ({uri.AbsolutePath})"); + State.Logger.LogDebug(LogType.IDPS, $" {stepName} ({uri.AbsolutePath})"); try { response = client.GetAsync(uri).Result; @@ -62,17 +62,17 @@ public ConsolePatchAccessor(string remoteIp) { if (!HandleIdpsRequestError(e)) { - State.Logger.LogError(IDPS, $"Couldn't fetch the IDPS from the PS3 because of an unknown error: {e}"); + State.Logger.LogError(LogType.IDPS, $"Couldn't fetch the IDPS from the PS3 because of an unknown error: {e}"); SentrySdk.CaptureException(e); } return null; } - State.Logger.LogDebug(IDPS, $" {(int)response.StatusCode} {response.StatusCode} (success: {response.IsSuccessStatusCode})"); + State.Logger.LogDebug(LogType.IDPS, $" {(int)response.StatusCode} {response.StatusCode} (success: {response.IsSuccessStatusCode})"); if (!response.IsSuccessStatusCode) { - State.Logger.LogError(IDPS, $"Couldn't fetch the IDPS from the PS3 because of a bad status code: {response.StatusCode}"); - State.Logger.LogDebug(IDPS, response.Content.ReadAsStringAsync().Result); + State.Logger.LogError(LogType.IDPS, $"Couldn't fetch the IDPS from the PS3 because of a bad status code: {response.StatusCode}"); + State.Logger.LogDebug(LogType.IDPS, response.Content.ReadAsStringAsync().Result); return null; } @@ -83,7 +83,7 @@ private static bool HandleIdpsRequestError(Exception inner) { if (inner is HttpRequestException httpException) { - State.Logger.LogError(IDPS, $"Couldn't fetch the IDPS from the PS3 because we couldn't make the request: {httpException.Message}"); + State.Logger.LogError(LogType.IDPS, $"Couldn't fetch the IDPS from the PS3 because we couldn't make the request: {httpException.Message}"); return true; } diff --git a/Refresher.Core/Accessors/PatchAccessor.cs b/Refresher.Core/Accessors/PatchAccessor.cs index 92ed84b..244d4fe 100644 --- a/Refresher.Core/Accessors/PatchAccessor.cs +++ b/Refresher.Core/Accessors/PatchAccessor.cs @@ -1,5 +1,6 @@ using System.Reflection; -using Refresher.Core.Pipelines; +using Refresher.Core.Patching.Pipelines; +using Refresher.Core.Patching.Steps; namespace Refresher.Core.Accessors; @@ -96,7 +97,7 @@ public static async Task TryAsync(Step step, Func action) private static void CatchAccessorException(Step step, Exception ex) { - State.Logger.LogError(Accessor, "Filesystem error: " + ex); + State.Logger.LogError(LogType.Accessor, "Filesystem error: " + ex); step.Fail($"Something went wrong while accessing the filesystem: {ex.GetType().Name}: {ex.Message}"); } } \ No newline at end of file diff --git a/Refresher.Core/GlobalUsings.cs b/Refresher.Core/GlobalUsings.cs deleted file mode 100644 index 3af29f2..0000000 --- a/Refresher.Core/GlobalUsings.cs +++ /dev/null @@ -1 +0,0 @@ -global using static Refresher.Core.LogType; \ No newline at end of file diff --git a/Refresher.Core/Patching/EbootPatcher.cs b/Refresher.Core/Patching/EbootPatcher.cs index 78d4c2f..f78054c 100644 --- a/Refresher.Core/Patching/EbootPatcher.cs +++ b/Refresher.Core/Patching/EbootPatcher.cs @@ -141,7 +141,7 @@ private static List FindPatchableElements(Stream file) FindLbpkDomains(reader, lbpkPositions, foundItems); long end = Stopwatch.GetTimestamp(); - State.Logger.LogDebug(Patcher, $"Detecting patchables took {(end - start) / (double)Stopwatch.Frequency} seconds!"); + State.Logger.LogDebug(LogType.Patcher, $"Detecting patchables took {(end - start) / (double)Stopwatch.Frequency} seconds!"); return foundItems; } @@ -245,7 +245,7 @@ private static void FilterValidUrls(BinaryReader reader, List foundPossibl if (UrlMatch().Matches(str).Count != 0) { - State.Logger.LogTrace(Patcher, $"Found URL at offset {foundPosition}: '{str}'"); + State.Logger.LogTrace(LogType.Patcher, $"Found URL at offset {foundPosition}: '{str}'"); foundItems.Add(new PatchTargetInfo { Length = len, @@ -344,7 +344,7 @@ public static string GeneratePpuHash(Stream stream) string ppuHash = BitConverter.ToString(hash.Hash!).Replace("-", "").ToLower(); - State.Logger.LogDebug(PPU, $"PPU hash: PPU-{ppuHash}"); + State.Logger.LogDebug(LogType.PPU, $"PPU hash: PPU-{ppuHash}"); return ppuHash; } diff --git a/Refresher.Core/Pipelines/Lbp/LbpPS3PatchPipeline.cs b/Refresher.Core/Patching/Pipelines/Lbp/LbpPS3PatchPipeline.cs similarity index 90% rename from Refresher.Core/Pipelines/Lbp/LbpPS3PatchPipeline.cs rename to Refresher.Core/Patching/Pipelines/Lbp/LbpPS3PatchPipeline.cs index cddbda9..86ba114 100644 --- a/Refresher.Core/Pipelines/Lbp/LbpPS3PatchPipeline.cs +++ b/Refresher.Core/Patching/Pipelines/Lbp/LbpPS3PatchPipeline.cs @@ -1,10 +1,10 @@ -using Refresher.Core.Pipelines.Steps; +using Refresher.Core.Patching.Steps.Common; +using Refresher.Core.Patching.Steps.PS3; -namespace Refresher.Core.Pipelines.Lbp; +namespace Refresher.Core.Patching.Pipelines.Lbp; public class LbpPS3PatchPipeline : Pipeline { - public override string Id => "lbp-ps3-patch"; public override string Name => "LBP PS3 Patch"; protected override Type SetupAccessorStepType => typeof(SetupPS3AccessorStep); diff --git a/Refresher.Core/Pipelines/Lbp/LbpRPCS3PatchPipeline.cs b/Refresher.Core/Patching/Pipelines/Lbp/LbpRPCS3PatchPipeline.cs similarity index 88% rename from Refresher.Core/Pipelines/Lbp/LbpRPCS3PatchPipeline.cs rename to Refresher.Core/Patching/Pipelines/Lbp/LbpRPCS3PatchPipeline.cs index b10d865..ecf3e5e 100644 --- a/Refresher.Core/Pipelines/Lbp/LbpRPCS3PatchPipeline.cs +++ b/Refresher.Core/Patching/Pipelines/Lbp/LbpRPCS3PatchPipeline.cs @@ -1,11 +1,10 @@ -using Refresher.Core.Accessors; -using Refresher.Core.Pipelines.Steps; +using Refresher.Core.Patching.Steps.Common; +using Refresher.Core.Patching.Steps.RPCS3; -namespace Refresher.Core.Pipelines.Lbp; +namespace Refresher.Core.Patching.Pipelines.Lbp; public class LbpRPCS3PatchPipeline : Pipeline { - public override string Id => "lbp-rpcs3-patch"; public override string Name => "LBP RPCS3 Patch"; protected override Type SetupAccessorStepType => typeof(SetupEmulatorAccessorStep); diff --git a/Refresher.Core/Pipelines/Lbp/PatchworkConfigPipeline.cs b/Refresher.Core/Patching/Pipelines/Lbp/PatchworkConfigPipeline.cs similarity index 74% rename from Refresher.Core/Pipelines/Lbp/PatchworkConfigPipeline.cs rename to Refresher.Core/Patching/Pipelines/Lbp/PatchworkConfigPipeline.cs index 569bf5c..73eaa9b 100644 --- a/Refresher.Core/Pipelines/Lbp/PatchworkConfigPipeline.cs +++ b/Refresher.Core/Patching/Pipelines/Lbp/PatchworkConfigPipeline.cs @@ -1,10 +1,9 @@ -using Refresher.Core.Pipelines.Steps; +using Refresher.Core.Patching.Steps.Common; -namespace Refresher.Core.Pipelines.Lbp; +namespace Refresher.Core.Patching.Pipelines.Lbp; public abstract class PatchworkConfigPipeline : Pipeline { - public override string Id => "patchwork-config-" + this.ConsoleName.ToLower(); public override string Name => $"Patchwork {this.ConsoleName} Config"; public override string? ShorthandUrlId => this.ConsoleName.ToLower(); diff --git a/Refresher.Core/Pipelines/Lbp/PatchworkPs3ConfigPipeline.cs b/Refresher.Core/Patching/Pipelines/Lbp/PatchworkPs3ConfigPipeline.cs similarity index 68% rename from Refresher.Core/Pipelines/Lbp/PatchworkPs3ConfigPipeline.cs rename to Refresher.Core/Patching/Pipelines/Lbp/PatchworkPs3ConfigPipeline.cs index d5d3426..590b25a 100644 --- a/Refresher.Core/Pipelines/Lbp/PatchworkPs3ConfigPipeline.cs +++ b/Refresher.Core/Patching/Pipelines/Lbp/PatchworkPs3ConfigPipeline.cs @@ -1,6 +1,6 @@ -using Refresher.Core.Pipelines.Steps; +using Refresher.Core.Patching.Steps.PS3; -namespace Refresher.Core.Pipelines.Lbp; +namespace Refresher.Core.Patching.Pipelines.Lbp; public class PatchworkPS3ConfigPipeline : PatchworkConfigPipeline { diff --git a/Refresher.Core/Pipelines/Lbp/PatchworkRPCS3ConfigPipeline.cs b/Refresher.Core/Patching/Pipelines/Lbp/PatchworkRPCS3ConfigPipeline.cs similarity index 69% rename from Refresher.Core/Pipelines/Lbp/PatchworkRPCS3ConfigPipeline.cs rename to Refresher.Core/Patching/Pipelines/Lbp/PatchworkRPCS3ConfigPipeline.cs index c422344..8cb2edf 100644 --- a/Refresher.Core/Pipelines/Lbp/PatchworkRPCS3ConfigPipeline.cs +++ b/Refresher.Core/Patching/Pipelines/Lbp/PatchworkRPCS3ConfigPipeline.cs @@ -1,6 +1,6 @@ -using Refresher.Core.Pipelines.Steps; +using Refresher.Core.Patching.Steps.RPCS3; -namespace Refresher.Core.Pipelines.Lbp; +namespace Refresher.Core.Patching.Pipelines.Lbp; public class PatchworkRPCS3ConfigPipeline : PatchworkConfigPipeline { diff --git a/Refresher.Core/Pipelines/ElfToElfPatchPipeline.cs b/Refresher.Core/Patching/Pipelines/Legacy/ElfToElfPatchPipeline.cs similarity index 72% rename from Refresher.Core/Pipelines/ElfToElfPatchPipeline.cs rename to Refresher.Core/Patching/Pipelines/Legacy/ElfToElfPatchPipeline.cs index 4e2377c..05e4026 100644 --- a/Refresher.Core/Pipelines/ElfToElfPatchPipeline.cs +++ b/Refresher.Core/Patching/Pipelines/Legacy/ElfToElfPatchPipeline.cs @@ -1,10 +1,9 @@ -using Refresher.Core.Pipelines.Steps; +using Refresher.Core.Patching.Steps.Legacy; -namespace Refresher.Core.Pipelines; +namespace Refresher.Core.Patching.Pipelines.Legacy; public class ElfToElfPatchPipeline : Pipeline { - public override string Id => "elf-elf-patch"; public override string Name => ".elf->.elf Patch"; protected override List StepTypes => diff --git a/Refresher.Core/Pipelines/PS3PatchPipeline.cs b/Refresher.Core/Patching/Pipelines/Legacy/PS3PatchPipeline.cs similarity index 84% rename from Refresher.Core/Pipelines/PS3PatchPipeline.cs rename to Refresher.Core/Patching/Pipelines/Legacy/PS3PatchPipeline.cs index 19a8325..f7f8a02 100644 --- a/Refresher.Core/Pipelines/PS3PatchPipeline.cs +++ b/Refresher.Core/Patching/Pipelines/Legacy/PS3PatchPipeline.cs @@ -1,10 +1,11 @@ -using Refresher.Core.Pipelines.Steps; +using Refresher.Core.Patching.Steps.Common; +using Refresher.Core.Patching.Steps.Legacy; +using Refresher.Core.Patching.Steps.PS3; -namespace Refresher.Core.Pipelines; +namespace Refresher.Core.Patching.Pipelines.Legacy; public class PS3PatchPipeline : Pipeline { - public override string Id => "ps3-patch"; public override string Name => "PS3 Patch (any game)"; protected override Type SetupAccessorStepType => typeof(SetupPS3AccessorStep); diff --git a/Refresher.Core/Pipelines/RPCS3PatchPipeline.cs b/Refresher.Core/Patching/Pipelines/Legacy/RPCS3PatchPipeline.cs similarity index 82% rename from Refresher.Core/Pipelines/RPCS3PatchPipeline.cs rename to Refresher.Core/Patching/Pipelines/Legacy/RPCS3PatchPipeline.cs index 49cf0e6..8e4d446 100644 --- a/Refresher.Core/Pipelines/RPCS3PatchPipeline.cs +++ b/Refresher.Core/Patching/Pipelines/Legacy/RPCS3PatchPipeline.cs @@ -1,10 +1,11 @@ -using Refresher.Core.Pipelines.Steps; +using Refresher.Core.Patching.Steps.Common; +using Refresher.Core.Patching.Steps.Legacy; +using Refresher.Core.Patching.Steps.RPCS3; -namespace Refresher.Core.Pipelines; +namespace Refresher.Core.Patching.Pipelines.Legacy; public class RPCS3PatchPipeline : Pipeline { - public override string Id => "rpcs3-patch"; public override string Name => "RPCS3 Patch (any game)"; protected override Type SetupAccessorStepType => typeof(SetupEmulatorAccessorStep); diff --git a/Refresher.Core/Pipelines/Pipeline.cs b/Refresher.Core/Patching/Pipelines/Pipeline.cs similarity index 98% rename from Refresher.Core/Pipelines/Pipeline.cs rename to Refresher.Core/Patching/Pipelines/Pipeline.cs index cd00a6c..6ceae77 100644 --- a/Refresher.Core/Pipelines/Pipeline.cs +++ b/Refresher.Core/Patching/Pipelines/Pipeline.cs @@ -1,18 +1,17 @@ using System.Collections.Frozen; using System.Diagnostics; using Refresher.Core.Accessors; -using Refresher.Core.Patching; -using Refresher.Core.Pipelines.Steps; +using Refresher.Core.Patching.Steps; +using Refresher.Core.Patching.Steps.Common; using Refresher.Core.Platform; using Refresher.Core.Storage; using Refresher.Core.Verification.AutoDiscover; using GlobalState = Refresher.Core.State; -namespace Refresher.Core.Pipelines; +namespace Refresher.Core.Patching.Pipelines; public abstract class Pipeline : IAccessesPlatform { - public abstract string Id { get; } public abstract string Name { get; } public readonly Dictionary Inputs = []; diff --git a/Refresher.Core/Pipelines/PipelineController.cs b/Refresher.Core/Patching/Pipelines/PipelineController.cs similarity index 98% rename from Refresher.Core/Pipelines/PipelineController.cs rename to Refresher.Core/Patching/Pipelines/PipelineController.cs index 5b52715..7a1f715 100644 --- a/Refresher.Core/Pipelines/PipelineController.cs +++ b/Refresher.Core/Patching/Pipelines/PipelineController.cs @@ -1,7 +1,7 @@ using Refresher.Core.Platform; using Refresher.Core.Verification.AutoDiscover; -namespace Refresher.Core.Pipelines; +namespace Refresher.Core.Patching.Pipelines; /// /// A set of common utilities to assist in controlling a pipeline from a UI. diff --git a/Refresher.Core/Pipelines/PipelineState.cs b/Refresher.Core/Patching/Pipelines/PipelineState.cs similarity index 70% rename from Refresher.Core/Pipelines/PipelineState.cs rename to Refresher.Core/Patching/Pipelines/PipelineState.cs index 03f7395..0c3f60a 100644 --- a/Refresher.Core/Pipelines/PipelineState.cs +++ b/Refresher.Core/Patching/Pipelines/PipelineState.cs @@ -1,4 +1,4 @@ -namespace Refresher.Core.Pipelines; +namespace Refresher.Core.Patching.Pipelines; public enum PipelineState : byte { diff --git a/Refresher.Core/Pipelines/ExamplePipeline.cs b/Refresher.Core/Patching/Pipelines/Test/ExamplePipeline.cs similarity index 76% rename from Refresher.Core/Pipelines/ExamplePipeline.cs rename to Refresher.Core/Patching/Pipelines/Test/ExamplePipeline.cs index 454b994..1b85b89 100644 --- a/Refresher.Core/Pipelines/ExamplePipeline.cs +++ b/Refresher.Core/Patching/Pipelines/Test/ExamplePipeline.cs @@ -1,10 +1,9 @@ -using Refresher.Core.Pipelines.Steps; +using Refresher.Core.Patching.Steps.Test; -namespace Refresher.Core.Pipelines; +namespace Refresher.Core.Patching.Pipelines.Test; public class ExamplePipeline : Pipeline { - public override string Id => "example"; public override string Name => "Example Pipeline"; protected override List StepTypes { get; } = [ diff --git a/Refresher.Core/Pipelines/Steps/ApplySprxPatchToEbootStep.cs b/Refresher.Core/Patching/Steps/Common/ApplySprxPatchToEbootStep.cs similarity index 84% rename from Refresher.Core/Pipelines/Steps/ApplySprxPatchToEbootStep.cs rename to Refresher.Core/Patching/Steps/Common/ApplySprxPatchToEbootStep.cs index 4fba44d..54b8b6e 100644 --- a/Refresher.Core/Pipelines/Steps/ApplySprxPatchToEbootStep.cs +++ b/Refresher.Core/Patching/Steps/Common/ApplySprxPatchToEbootStep.cs @@ -1,12 +1,14 @@ -using SPRXPatcher.Elf; +using Refresher.Core.Patching.Pipelines; +using SPRXPatcher.Elf; -namespace Refresher.Core.Pipelines.Steps; +namespace Refresher.Core.Patching.Steps.Common; public class ApplySprxPatchToEbootStep : Step { public ApplySprxPatchToEbootStep(Pipeline pipeline) : base(pipeline) {} + public override string Name { get; } = "Hooking Patchwork to your EBOOT"; public override float Progress { get; protected set; } public override async Task ExecuteAsync(CancellationToken cancellationToken = default) { diff --git a/Refresher.Core/Pipelines/Steps/BackupGameEbootBeforeReplaceStep.cs b/Refresher.Core/Patching/Steps/Common/BackupGameEbootBeforeReplaceStep.cs similarity index 80% rename from Refresher.Core/Pipelines/Steps/BackupGameEbootBeforeReplaceStep.cs rename to Refresher.Core/Patching/Steps/Common/BackupGameEbootBeforeReplaceStep.cs index 6e27e7f..0bee11e 100644 --- a/Refresher.Core/Pipelines/Steps/BackupGameEbootBeforeReplaceStep.cs +++ b/Refresher.Core/Patching/Steps/Common/BackupGameEbootBeforeReplaceStep.cs @@ -1,12 +1,14 @@ -using Refresher.Core.Accessors; +using Refresher.Core.Patching.Pipelines; +using Refresher.Core.Accessors; -namespace Refresher.Core.Pipelines.Steps; +namespace Refresher.Core.Patching.Steps.Common; public class BackupGameEbootBeforeReplaceStep : Step { public BackupGameEbootBeforeReplaceStep(Pipeline pipeline) : base(pipeline) {} + public override string Name { get; } = "Backing up your current EBOOT"; public override float Progress { get; protected set; } public override Task ExecuteAsync(CancellationToken cancellationToken = default) { diff --git a/Refresher.Core/Pipelines/Steps/DecryptGameEbootStep.cs b/Refresher.Core/Patching/Steps/Common/DecryptGameEbootStep.cs similarity index 85% rename from Refresher.Core/Pipelines/Steps/DecryptGameEbootStep.cs rename to Refresher.Core/Patching/Steps/Common/DecryptGameEbootStep.cs index 4482175..3a0f2d6 100644 --- a/Refresher.Core/Pipelines/Steps/DecryptGameEbootStep.cs +++ b/Refresher.Core/Patching/Steps/Common/DecryptGameEbootStep.cs @@ -1,12 +1,14 @@ +using Refresher.Core.Patching.Pipelines; using SCEToolSharp; -namespace Refresher.Core.Pipelines.Steps; +namespace Refresher.Core.Patching.Steps.Common; public class DecryptGameEbootStep : Step { public DecryptGameEbootStep(Pipeline pipeline) : base(pipeline) {} + public override string Name { get; } = "Decrypting your EBOOT"; public override float Progress { get; protected set; } public override Task ExecuteAsync(CancellationToken cancellationToken = default) { diff --git a/Refresher.Core/Pipelines/Steps/DownloadGameEbootStep.cs b/Refresher.Core/Patching/Steps/Common/DownloadGameEbootStep.cs similarity index 83% rename from Refresher.Core/Pipelines/Steps/DownloadGameEbootStep.cs rename to Refresher.Core/Patching/Steps/Common/DownloadGameEbootStep.cs index da18406..4f824c2 100644 --- a/Refresher.Core/Pipelines/Steps/DownloadGameEbootStep.cs +++ b/Refresher.Core/Patching/Steps/Common/DownloadGameEbootStep.cs @@ -1,12 +1,14 @@ using Refresher.Core.Accessors; +using Refresher.Core.Patching.Pipelines; -namespace Refresher.Core.Pipelines.Steps; +namespace Refresher.Core.Patching.Steps.Common; public class DownloadGameEbootStep : Step { public DownloadGameEbootStep(Pipeline pipeline) : base(pipeline) {} + public override string Name { get; } = "Downloading your EBOOT"; public override float Progress { get; protected set; } public override Task ExecuteAsync(CancellationToken cancellationToken = default) { @@ -19,7 +21,7 @@ public override Task ExecuteAsync(CancellationToken cancellationToken = default) if (this.Pipeline.Accessor!.FileExists(ebootPath)) return; // If the backup doesn't exist, use the EBOOT.BIN - State.Logger.LogInfo(Accessor, "Couldn't find an original backup of the EBOOT, using active copy. This is not an error."); + State.Logger.LogInfo(LogType.Accessor, "Couldn't find an original backup of the EBOOT, using active copy. This is not an error."); ebootPath = Path.Combine(usrDir, "EBOOT.BIN"); this.Progress = 0.25f; @@ -47,7 +49,7 @@ public override Task ExecuteAsync(CancellationToken cancellationToken = default) if(this.Failed) return Task.CompletedTask; - State.Logger.LogDebug(Accessor, $"Downloaded EBOOT Path: {downloadedFile}"); + State.Logger.LogDebug(LogType.Accessor, $"Downloaded EBOOT Path: {downloadedFile}"); if (!File.Exists(downloadedFile)) { return this.Fail("Could not find the EBOOT we downloaded. This is likely a bug. Patching cannot continue."); diff --git a/Refresher.Core/Pipelines/Steps/DownloadGameLicenseStep.cs b/Refresher.Core/Patching/Steps/Common/DownloadGameLicenseStep.cs similarity index 79% rename from Refresher.Core/Pipelines/Steps/DownloadGameLicenseStep.cs rename to Refresher.Core/Patching/Steps/Common/DownloadGameLicenseStep.cs index 0d837ea..68493a7 100644 --- a/Refresher.Core/Pipelines/Steps/DownloadGameLicenseStep.cs +++ b/Refresher.Core/Patching/Steps/Common/DownloadGameLicenseStep.cs @@ -1,12 +1,14 @@ using Refresher.Core.Patching; +using Refresher.Core.Patching.Pipelines; -namespace Refresher.Core.Pipelines.Steps; +namespace Refresher.Core.Patching.Steps.Common; public class DownloadGameLicenseStep : Step { public DownloadGameLicenseStep(Pipeline pipeline) : base(pipeline) {} + public override string Name { get; } = "Downloading your game license for decryption"; public override float Progress { get; protected set; } public override Task ExecuteAsync(CancellationToken cancellationToken = default) { @@ -24,12 +26,12 @@ public override Task ExecuteAsync(CancellationToken cancellationToken = default) bool found = false; foreach (string user in this.Pipeline.Accessor!.GetDirectoriesInDirectory(Path.Combine("home"))) { - State.Logger.LogDebug(Crypto, $"Checking all license files in {user}"); + State.Logger.LogDebug(LogType.Crypto, $"Checking all license files in {user}"); string exdataFolder = Path.Combine(user, "exdata"); if (!this.Pipeline.Accessor.DirectoryExists(exdataFolder)) { - State.Logger.LogDebug(Crypto, $"Exdata folder doesn't exist for user {user}, skipping..."); + State.Logger.LogDebug(LogType.Crypto, $"Exdata folder doesn't exist for user {user}, skipping..."); continue; } @@ -39,7 +41,7 @@ public override Task ExecuteAsync(CancellationToken cancellationToken = default) if (!(contentId != null && licenseFile.Contains(contentId)) && !licenseFile.Contains(game.TitleId)) continue; - State.Logger.LogDebug(Crypto, $"Found compatible rap: {licenseFile}"); + State.Logger.LogDebug(LogType.Crypto, $"Found compatible rap: {licenseFile}"); string actDatPath = Path.Combine(user, "exdata", "act.dat"); @@ -54,7 +56,7 @@ public override Task ExecuteAsync(CancellationToken cancellationToken = default) string downloadedLicenseFile = this.Pipeline.Accessor.DownloadFile(licenseFile); File.Move(downloadedLicenseFile, Path.Join(licenseDir, Path.GetFileName(licenseFile)), true); - State.Logger.LogInfo(Crypto, $"Downloaded compatible license file {licenseFile}."); + State.Logger.LogInfo(LogType.Crypto, $"Downloaded compatible license file {licenseFile}."); if(Path.GetFileNameWithoutExtension(licenseFile) == game.ContentId) found = true; @@ -67,7 +69,7 @@ public override Task ExecuteAsync(CancellationToken cancellationToken = default) if (!found) { this.Game.ShouldUseNpdrmEncryption = false; - State.Logger.LogWarning(Crypto, "Couldn't find a license file for {0}. For disc copies, this is normal. " + + State.Logger.LogWarning(LogType.Crypto, "Couldn't find a license file for {0}. For disc copies, this is normal. " + "For digital copies, this may present problems. Attempting to continue without it...", game.TitleId); } else diff --git a/Refresher.Core/Pipelines/Steps/DownloadGameListStep.cs b/Refresher.Core/Patching/Steps/Common/DownloadGameListStep.cs similarity index 81% rename from Refresher.Core/Pipelines/Steps/DownloadGameListStep.cs rename to Refresher.Core/Patching/Steps/Common/DownloadGameListStep.cs index 6013353..0119987 100644 --- a/Refresher.Core/Pipelines/Steps/DownloadGameListStep.cs +++ b/Refresher.Core/Patching/Steps/Common/DownloadGameListStep.cs @@ -1,13 +1,15 @@ using Refresher.Core.Accessors; using Refresher.Core.Patching; +using Refresher.Core.Patching.Pipelines; -namespace Refresher.Core.Pipelines.Steps; +namespace Refresher.Core.Patching.Steps.Common; public class DownloadGameListStep : Step { public DownloadGameListStep(Pipeline pipeline) : base(pipeline) {} + public override string Name { get; } = "Downloading info about your games"; public override float Progress { get; protected set; } public override async Task ExecuteAsync(CancellationToken cancellationToken = default) { @@ -22,7 +24,7 @@ public override async Task ExecuteAsync(CancellationToken cancellationToken = de int i = 0; foreach (string gamePath in games) { - State.Logger.LogInfo(InfoRetrieval, $"Downloading information for game '{gamePath}'..."); + State.Logger.LogInfo(LogType.InfoRetrieval, $"Downloading information for game '{gamePath}'..."); GameInformation game = new() { @@ -46,8 +48,8 @@ public override async Task ExecuteAsync(CancellationToken cancellationToken = de } catch(Exception e) { - State.Logger.LogWarning(InfoRetrieval, $"Failed to get information for '{game.TitleId}'. {tries} tries remaining..."); - State.Logger.LogWarning(InfoRetrieval, e.ToString()); + State.Logger.LogWarning(LogType.InfoRetrieval, $"Failed to get information for '{game.TitleId}'. {tries} tries remaining..."); + State.Logger.LogWarning(LogType.InfoRetrieval, e.ToString()); if (isConsole) await Task.Delay(5000, cancellationToken); } diff --git a/Refresher.Core/Pipelines/Steps/DownloadIconStep.cs b/Refresher.Core/Patching/Steps/Common/DownloadIconStep.cs similarity index 83% rename from Refresher.Core/Pipelines/Steps/DownloadIconStep.cs rename to Refresher.Core/Patching/Steps/Common/DownloadIconStep.cs index 5401659..8d85a0b 100644 --- a/Refresher.Core/Pipelines/Steps/DownloadIconStep.cs +++ b/Refresher.Core/Patching/Steps/Common/DownloadIconStep.cs @@ -1,13 +1,15 @@ using Refresher.Core.Patching; +using Refresher.Core.Patching.Pipelines; using Refresher.Core.Storage; -namespace Refresher.Core.Pipelines.Steps; +namespace Refresher.Core.Patching.Steps.Common; public class DownloadIconStep : Step { public DownloadIconStep(Pipeline pipeline) : base(pipeline) {} + public override string Name { get; } = "Downloading the icons of a game"; public override float Progress { get; protected set; } public override Task ExecuteAsync(CancellationToken cancellationToken = default) { diff --git a/Refresher.Core/Pipelines/Steps/DownloadParamSfoStep.cs b/Refresher.Core/Patching/Steps/Common/DownloadParamSfoStep.cs similarity index 77% rename from Refresher.Core/Pipelines/Steps/DownloadParamSfoStep.cs rename to Refresher.Core/Patching/Steps/Common/DownloadParamSfoStep.cs index 2a0e207..77ad12d 100644 --- a/Refresher.Core/Pipelines/Steps/DownloadParamSfoStep.cs +++ b/Refresher.Core/Patching/Steps/Common/DownloadParamSfoStep.cs @@ -1,14 +1,16 @@ using Refresher.Core.Accessors; using Refresher.Core.Patching; +using Refresher.Core.Patching.Pipelines; using Refresher.Core.Verification; -namespace Refresher.Core.Pipelines.Steps; +namespace Refresher.Core.Patching.Steps.Common; public class DownloadParamSfoStep : Step { public DownloadParamSfoStep(Pipeline pipeline) : base(pipeline) {} + public override string Name { get; } = "Downloading info about a game"; public override float Progress { get; protected set; } public override Task ExecuteAsync(CancellationToken cancellationToken = default) { @@ -33,7 +35,7 @@ public override Task ExecuteAsync(CancellationToken cancellationToken = default) if (sfoStream == null) { if(game.TitleId != "TEST12345") - State.Logger.LogWarning(InfoRetrieval, "The PARAM.SFO file does not exist. This usually means you haven't installed any updates for your game. Refresher will try to proceed anyways."); + State.Logger.LogWarning(LogType.InfoRetrieval, "The PARAM.SFO file does not exist. This usually means you haven't installed any updates for your game. Refresher will try to proceed anyways."); return Task.CompletedTask; } @@ -57,21 +59,21 @@ public override Task ExecuteAsync(CancellationToken cancellationToken = default) this.Platform.WarnPrompt($"Couldn't load {game}'s PARAM.SFO: {e}\n\nRefresher will try to proceed anyways."); if (sfo != null) { - State.Logger.LogDebug(InfoRetrieval, $"PARAM.SFO version:{sfo.Version} dump:"); + State.Logger.LogDebug(LogType.InfoRetrieval, $"PARAM.SFO version:{sfo.Version} dump:"); foreach ((string? key, object? value) in sfo.Table) { - State.Logger.LogDebug(InfoRetrieval, $" '{key}' = '{value}'"); + State.Logger.LogDebug(LogType.InfoRetrieval, $" '{key}' = '{value}'"); } } else { - State.Logger.LogWarning(InfoRetrieval, "PARAM.SFO was not read, can't dump to log"); + State.Logger.LogWarning(LogType.InfoRetrieval, "PARAM.SFO was not read, can't dump to log"); } SentrySdk.CaptureException(e); } - State.Logger.LogInfo(InfoRetrieval, "Parsed PARAM.SFO: " + game); + State.Logger.LogInfo(LogType.InfoRetrieval, "Parsed PARAM.SFO: " + game); return Task.CompletedTask; } diff --git a/Refresher.Core/Pipelines/Steps/PrepareSceToolStep.cs b/Refresher.Core/Patching/Steps/Common/PrepareSceToolStep.cs similarity index 81% rename from Refresher.Core/Pipelines/Steps/PrepareSceToolStep.cs rename to Refresher.Core/Patching/Steps/Common/PrepareSceToolStep.cs index a5fe498..3047fc4 100644 --- a/Refresher.Core/Pipelines/Steps/PrepareSceToolStep.cs +++ b/Refresher.Core/Patching/Steps/Common/PrepareSceToolStep.cs @@ -1,6 +1,7 @@ +using Refresher.Core.Patching.Pipelines; using static SCEToolSharp.LibSceToolSharp; -namespace Refresher.Core.Pipelines.Steps; +namespace Refresher.Core.Patching.Steps.Common; public class PrepareSceToolStep : Step { @@ -8,6 +9,7 @@ public PrepareSceToolStep(Pipeline pipeline) : base(pipeline) { } + public override string Name { get; } = "Preparing decryption tools (SCETool)"; public override float Progress { get; protected set; } public override Task ExecuteAsync(CancellationToken cancellationToken = default) { diff --git a/Refresher.Core/Pipelines/Steps/ReadEbootContentIdStep.cs b/Refresher.Core/Patching/Steps/Common/ReadEbootContentIdStep.cs similarity index 73% rename from Refresher.Core/Pipelines/Steps/ReadEbootContentIdStep.cs rename to Refresher.Core/Patching/Steps/Common/ReadEbootContentIdStep.cs index 440f79f..30ea949 100644 --- a/Refresher.Core/Pipelines/Steps/ReadEbootContentIdStep.cs +++ b/Refresher.Core/Patching/Steps/Common/ReadEbootContentIdStep.cs @@ -1,12 +1,14 @@ +using Refresher.Core.Patching.Pipelines; using SCEToolSharp; -namespace Refresher.Core.Pipelines.Steps; +namespace Refresher.Core.Patching.Steps.Common; public class ReadEbootContentIdStep : Step { public ReadEbootContentIdStep(Pipeline pipeline) : base(pipeline) {} + public override string Name { get; } = "Seeking the content ID from your EBOOT"; public override float Progress { get; protected set; } public override Task ExecuteAsync(CancellationToken cancellationToken = default) { @@ -21,7 +23,7 @@ public override Task ExecuteAsync(CancellationToken cancellationToken = default) this.Progress = 1f; if(contentId != null) - State.Logger.LogDebug(InfoRetrieval, "Got content ID from the game's EBOOT: {0}", contentId); + State.Logger.LogDebug(LogType.InfoRetrieval, "Got content ID from the game's EBOOT: {0}", contentId); else this.Platform.WarnPrompt("Unable to find content ID in the game's EBOOT. Encryption may or may not work."); return Task.CompletedTask; diff --git a/Refresher.Core/Pipelines/Steps/RevertGameEbootFromBackupStep.cs b/Refresher.Core/Patching/Steps/Common/RevertGameEbootFromBackupStep.cs similarity index 88% rename from Refresher.Core/Pipelines/Steps/RevertGameEbootFromBackupStep.cs rename to Refresher.Core/Patching/Steps/Common/RevertGameEbootFromBackupStep.cs index 770d942..2bbc82c 100644 --- a/Refresher.Core/Pipelines/Steps/RevertGameEbootFromBackupStep.cs +++ b/Refresher.Core/Patching/Steps/Common/RevertGameEbootFromBackupStep.cs @@ -1,12 +1,14 @@ using Refresher.Core.Accessors; +using Refresher.Core.Patching.Pipelines; -namespace Refresher.Core.Pipelines.Steps; +namespace Refresher.Core.Patching.Steps.Common; public class RevertGameEbootFromBackupStep : Step { public RevertGameEbootFromBackupStep(Pipeline pipeline) : base(pipeline) {} - + + public override string Name { get; } = "Reverting EBOOT from backup"; public override float Progress { get; protected set; } public override Task ExecuteAsync(CancellationToken cancellationToken = default) { diff --git a/Refresher.Core/Pipelines/Steps/UploadGameEbootStep.cs b/Refresher.Core/Patching/Steps/Common/UploadGameEbootStep.cs similarity index 84% rename from Refresher.Core/Pipelines/Steps/UploadGameEbootStep.cs rename to Refresher.Core/Patching/Steps/Common/UploadGameEbootStep.cs index fd3b544..58efb12 100644 --- a/Refresher.Core/Pipelines/Steps/UploadGameEbootStep.cs +++ b/Refresher.Core/Patching/Steps/Common/UploadGameEbootStep.cs @@ -1,6 +1,7 @@ using Refresher.Core.Accessors; +using Refresher.Core.Patching.Pipelines; -namespace Refresher.Core.Pipelines.Steps; +namespace Refresher.Core.Patching.Steps.Common; public class UploadGameEbootStep : Step { @@ -8,6 +9,7 @@ public UploadGameEbootStep(Pipeline pipeline) : base(pipeline) { } + public override string Name { get; } = "Uploading patched EBOOT"; public override float Progress { get; protected set; } public override Task ExecuteAsync(CancellationToken cancellationToken = default) { diff --git a/Refresher.Core/Pipelines/Steps/UploadPatchworkConfigurationStep.cs b/Refresher.Core/Patching/Steps/Common/UploadPatchworkConfigurationStep.cs similarity index 92% rename from Refresher.Core/Pipelines/Steps/UploadPatchworkConfigurationStep.cs rename to Refresher.Core/Patching/Steps/Common/UploadPatchworkConfigurationStep.cs index f6ac643..2109de9 100644 --- a/Refresher.Core/Pipelines/Steps/UploadPatchworkConfigurationStep.cs +++ b/Refresher.Core/Patching/Steps/Common/UploadPatchworkConfigurationStep.cs @@ -1,7 +1,8 @@ using System.Text; using Refresher.Core.Accessors; +using Refresher.Core.Patching.Pipelines; -namespace Refresher.Core.Pipelines.Steps; +namespace Refresher.Core.Patching.Steps.Common; public class UploadPatchworkConfigurationStep : Step { @@ -14,6 +15,7 @@ public UploadPatchworkConfigurationStep(Pipeline pipeline) : base(pipeline) CommonStepInputs.LobbyPassword, ]; + public override string Name { get; } = "Uploading Patchwork config files"; public override float Progress { get; protected set; } public override async Task ExecuteAsync(CancellationToken ct = default) { diff --git a/Refresher.Core/Pipelines/Steps/UploadPatchworkSprxStep.cs b/Refresher.Core/Patching/Steps/Common/UploadPatchworkSprxStep.cs similarity index 93% rename from Refresher.Core/Pipelines/Steps/UploadPatchworkSprxStep.cs rename to Refresher.Core/Patching/Steps/Common/UploadPatchworkSprxStep.cs index 76908af..351f9b4 100644 --- a/Refresher.Core/Pipelines/Steps/UploadPatchworkSprxStep.cs +++ b/Refresher.Core/Patching/Steps/Common/UploadPatchworkSprxStep.cs @@ -1,14 +1,16 @@ using System.Reflection; using Refresher.Core.Accessors; +using Refresher.Core.Patching.Pipelines; using Refresher.Core.Platform; -namespace Refresher.Core.Pipelines.Steps; +namespace Refresher.Core.Patching.Steps.Common; public class UploadPatchworkSprxStep : Step { public UploadPatchworkSprxStep(Pipeline pipeline) : base(pipeline) {} + public override string Name { get; } = "Uploading Patchwork module"; public override float Progress { get; protected set; } public override async Task ExecuteAsync(CancellationToken cancellationToken = default) { diff --git a/Refresher.Core/Pipelines/Steps/ValidateGameStep.cs b/Refresher.Core/Patching/Steps/Common/ValidateGameStep.cs similarity index 86% rename from Refresher.Core/Pipelines/Steps/ValidateGameStep.cs rename to Refresher.Core/Patching/Steps/Common/ValidateGameStep.cs index 1606def..66e34e9 100644 --- a/Refresher.Core/Pipelines/Steps/ValidateGameStep.cs +++ b/Refresher.Core/Patching/Steps/Common/ValidateGameStep.cs @@ -1,12 +1,14 @@ using Refresher.Core.Patching; +using Refresher.Core.Patching.Pipelines; -namespace Refresher.Core.Pipelines.Steps; +namespace Refresher.Core.Patching.Steps.Common; public class ValidateGameStep : Step { public ValidateGameStep(Pipeline pipeline) : base(pipeline) {} + public override string Name { get; } = "Validating your entered game data"; public override float Progress { get; protected set; } public override List Inputs { get; } = diff --git a/Refresher.Core/Pipelines/CommonStepInputs.cs b/Refresher.Core/Patching/Steps/CommonStepInputs.cs similarity index 98% rename from Refresher.Core/Pipelines/CommonStepInputs.cs rename to Refresher.Core/Patching/Steps/CommonStepInputs.cs index a22039d..bdce1b3 100644 --- a/Refresher.Core/Pipelines/CommonStepInputs.cs +++ b/Refresher.Core/Patching/Steps/CommonStepInputs.cs @@ -1,4 +1,4 @@ -namespace Refresher.Core.Pipelines; +namespace Refresher.Core.Patching.Steps; public static class CommonStepInputs { diff --git a/Refresher.Core/Pipelines/Steps/ApplyPatchToEbootStep.cs b/Refresher.Core/Patching/Steps/Legacy/ApplyPatchToEbootStep.cs similarity index 76% rename from Refresher.Core/Pipelines/Steps/ApplyPatchToEbootStep.cs rename to Refresher.Core/Patching/Steps/Legacy/ApplyPatchToEbootStep.cs index 1092501..7214400 100644 --- a/Refresher.Core/Pipelines/Steps/ApplyPatchToEbootStep.cs +++ b/Refresher.Core/Patching/Steps/Legacy/ApplyPatchToEbootStep.cs @@ -1,4 +1,6 @@ -namespace Refresher.Core.Pipelines.Steps; +using Refresher.Core.Patching.Pipelines; + +namespace Refresher.Core.Patching.Steps.Legacy; public class ApplyPatchToEbootStep : Step { @@ -10,6 +12,7 @@ public ApplyPatchToEbootStep(Pipeline pipeline) : base(pipeline) CommonStepInputs.ServerUrl, ]; + public override string Name { get; } = "Writing server data into your EBOOT"; public override float Progress { get; protected set; } public override Task ExecuteAsync(CancellationToken cancellationToken = default) { diff --git a/Refresher.Core/Pipelines/Steps/InputElfStep.cs b/Refresher.Core/Patching/Steps/Legacy/InputElfStep.cs similarity index 86% rename from Refresher.Core/Pipelines/Steps/InputElfStep.cs rename to Refresher.Core/Patching/Steps/Legacy/InputElfStep.cs index 8971cea..c894419 100644 --- a/Refresher.Core/Pipelines/Steps/InputElfStep.cs +++ b/Refresher.Core/Patching/Steps/Legacy/InputElfStep.cs @@ -1,6 +1,6 @@ -using Refresher.Core.Patching; +using Refresher.Core.Patching.Pipelines; -namespace Refresher.Core.Pipelines.Steps; +namespace Refresher.Core.Patching.Steps.Legacy; public class InputElfStep : Step { @@ -12,6 +12,7 @@ public InputElfStep(Pipeline pipeline) : base(pipeline) CommonStepInputs.ElfInput, ]; + public override string Name { get; } = "Opening an EBOOT.ELF"; public override float Progress { get; protected set; } public override Task ExecuteAsync(CancellationToken cancellationToken = default) { diff --git a/Refresher.Core/Pipelines/Steps/OutputElfStep.cs b/Refresher.Core/Patching/Steps/Legacy/OutputElfStep.cs similarity index 79% rename from Refresher.Core/Pipelines/Steps/OutputElfStep.cs rename to Refresher.Core/Patching/Steps/Legacy/OutputElfStep.cs index cd6bbf8..0d14c96 100644 --- a/Refresher.Core/Pipelines/Steps/OutputElfStep.cs +++ b/Refresher.Core/Patching/Steps/Legacy/OutputElfStep.cs @@ -1,6 +1,7 @@ -using Refresher.Core.Platform; +using Refresher.Core.Patching.Pipelines; +using Refresher.Core.Platform; -namespace Refresher.Core.Pipelines.Steps; +namespace Refresher.Core.Patching.Steps.Legacy; public class OutputElfStep : Step { @@ -12,6 +13,7 @@ public OutputElfStep(Pipeline pipeline) : base(pipeline) CommonStepInputs.ElfOutput, ]; + public override string Name { get; } = "Deploying patched EBOOT.ELF"; public override float Progress { get; protected set; } public override Task ExecuteAsync(CancellationToken cancellationToken = default) { diff --git a/Refresher.Core/Pipelines/Steps/PrepareEbootPatchCreatorAndVerifyStep.cs b/Refresher.Core/Patching/Steps/Legacy/PrepareEbootPatchCreatorAndVerifyStep.cs similarity index 81% rename from Refresher.Core/Pipelines/Steps/PrepareEbootPatchCreatorAndVerifyStep.cs rename to Refresher.Core/Patching/Steps/Legacy/PrepareEbootPatchCreatorAndVerifyStep.cs index f689edf..ae8b810 100644 --- a/Refresher.Core/Pipelines/Steps/PrepareEbootPatchCreatorAndVerifyStep.cs +++ b/Refresher.Core/Patching/Steps/Legacy/PrepareEbootPatchCreatorAndVerifyStep.cs @@ -1,7 +1,8 @@ using Refresher.Core.Patching; +using Refresher.Core.Patching.Pipelines; using Refresher.Core.Verification; -namespace Refresher.Core.Pipelines.Steps; +namespace Refresher.Core.Patching.Steps.Legacy; public class PrepareEbootPatchCreatorAndVerifyStep : Step { @@ -14,6 +15,7 @@ public PrepareEbootPatchCreatorAndVerifyStep(Pipeline pipeline) : base(pipeline) CommonStepInputs.ServerUrl, ]; + public override string Name { get; } = "Preparing RPCS3 patch creator"; public override float Progress { get; protected set; } public override Task ExecuteAsync(CancellationToken cancellationToken = default) { @@ -26,14 +28,14 @@ public override Task ExecuteAsync(CancellationToken cancellationToken = default) patcher.GameName = this.Game.Name; patcher.GameVersion = this.Game.Version; - State.Logger.LogDebug(RPCS3, $"RPCS3 patches folder: {patcher.Rpcs3PatchFolder}"); + State.Logger.LogDebug(LogType.RPCS3, $"RPCS3 patches folder: {patcher.Rpcs3PatchFolder}"); this.Pipeline.Patcher = patcher; List messages = patcher.Verify(url, this.AutoDiscover?.UsesCustomDigestKey ?? false); foreach (Message message in messages) { - State.Logger.LogInfo(Patcher, message.ToString()); + State.Logger.LogInfo(LogType.Patcher, message.ToString()); } if (messages.Any(m => m.Level == MessageLevel.Error)) diff --git a/Refresher.Core/Pipelines/Steps/PrepareEbootPatcherAndVerifyStep.cs b/Refresher.Core/Patching/Steps/Legacy/PrepareEbootPatcherAndVerifyStep.cs similarity index 82% rename from Refresher.Core/Pipelines/Steps/PrepareEbootPatcherAndVerifyStep.cs rename to Refresher.Core/Patching/Steps/Legacy/PrepareEbootPatcherAndVerifyStep.cs index 37d2f3f..9976d76 100644 --- a/Refresher.Core/Pipelines/Steps/PrepareEbootPatcherAndVerifyStep.cs +++ b/Refresher.Core/Patching/Steps/Legacy/PrepareEbootPatcherAndVerifyStep.cs @@ -1,7 +1,8 @@ using Refresher.Core.Patching; +using Refresher.Core.Patching.Pipelines; using Refresher.Core.Verification; -namespace Refresher.Core.Pipelines.Steps; +namespace Refresher.Core.Patching.Steps.Legacy; public class PrepareEbootPatcherAndVerifyStep : Step { @@ -13,6 +14,7 @@ public PrepareEbootPatcherAndVerifyStep(Pipeline pipeline) : base(pipeline) CommonStepInputs.ServerUrl, ]; + public override string Name { get; } = "Preparing PS3 EBOOT patcher"; public override float Progress { get; protected set; } public override Task ExecuteAsync(CancellationToken cancellationToken = default) { @@ -25,7 +27,7 @@ public override Task ExecuteAsync(CancellationToken cancellationToken = default) List messages = patcher.Verify(url, true); // TODO: handle autodiscover in pipelines foreach (Message message in messages) { - State.Logger.LogInfo(Patcher, message.ToString()); + State.Logger.LogInfo(LogType.Patcher, message.ToString()); } if (messages.Any(m => m.Level == MessageLevel.Error)) diff --git a/Refresher.Core/Pipelines/Steps/UploadGameEbootElfStep.cs b/Refresher.Core/Patching/Steps/Legacy/UploadGameEbootElfStep.cs similarity index 84% rename from Refresher.Core/Pipelines/Steps/UploadGameEbootElfStep.cs rename to Refresher.Core/Patching/Steps/Legacy/UploadGameEbootElfStep.cs index 4c9c6dc..72b79fb 100644 --- a/Refresher.Core/Pipelines/Steps/UploadGameEbootElfStep.cs +++ b/Refresher.Core/Patching/Steps/Legacy/UploadGameEbootElfStep.cs @@ -1,6 +1,7 @@ using Refresher.Core.Accessors; +using Refresher.Core.Patching.Pipelines; -namespace Refresher.Core.Pipelines.Steps; +namespace Refresher.Core.Patching.Steps.Legacy; public class UploadGameEbootElfStep : Step { @@ -8,6 +9,7 @@ public UploadGameEbootElfStep(Pipeline pipeline) : base(pipeline) { } + public override string Name { get; } = "Uploading EBOOT.ELF"; public override float Progress { get; protected set; } public override Task ExecuteAsync(CancellationToken cancellationToken = default) { diff --git a/Refresher.Core/Pipelines/Steps/EncryptGameEbootStep.cs b/Refresher.Core/Patching/Steps/PS3/EncryptGameEbootStep.cs similarity index 75% rename from Refresher.Core/Pipelines/Steps/EncryptGameEbootStep.cs rename to Refresher.Core/Patching/Steps/PS3/EncryptGameEbootStep.cs index 5a56b19..9643bc2 100644 --- a/Refresher.Core/Pipelines/Steps/EncryptGameEbootStep.cs +++ b/Refresher.Core/Patching/Steps/PS3/EncryptGameEbootStep.cs @@ -1,24 +1,26 @@ -using SCEToolSharp; +using Refresher.Core.Patching.Pipelines; +using SCEToolSharp; -namespace Refresher.Core.Pipelines.Steps; +namespace Refresher.Core.Patching.Steps.PS3; public class EncryptGameEbootStep : Step { public EncryptGameEbootStep(Pipeline pipeline) : base(pipeline) {} + public override string Name { get; } = "Encrypting your patched EBOOT"; public override float Progress { get; protected set; } public override Task ExecuteAsync(CancellationToken cancellationToken = default) { if (this.Game.ShouldUseNpdrmEncryption ?? this.Game.TitleId.StartsWith('N')) { - State.Logger.LogDebug(Crypto, "Will encrypt using Npdrm"); + State.Logger.LogDebug(LogType.Crypto, "Will encrypt using Npdrm"); LibSceToolSharp.SetNpdrmEncryptOptions(); LibSceToolSharp.SetNpdrmContentId(this.Game.ContentId!); } else { - State.Logger.LogDebug(Crypto, "Will encrypt using Disc"); + State.Logger.LogDebug(LogType.Crypto, "Will encrypt using Disc"); LibSceToolSharp.SetDiscEncryptOptions(); } diff --git a/Refresher.Core/Pipelines/Steps/GetConsoleIdpsStep.cs b/Refresher.Core/Patching/Steps/PS3/GetConsoleIdpsStep.cs similarity index 80% rename from Refresher.Core/Pipelines/Steps/GetConsoleIdpsStep.cs rename to Refresher.Core/Patching/Steps/PS3/GetConsoleIdpsStep.cs index fc3cd4b..0f69385 100644 --- a/Refresher.Core/Pipelines/Steps/GetConsoleIdpsStep.cs +++ b/Refresher.Core/Patching/Steps/PS3/GetConsoleIdpsStep.cs @@ -1,13 +1,15 @@ using System.Diagnostics; using Refresher.Core.Accessors; +using Refresher.Core.Patching.Pipelines; -namespace Refresher.Core.Pipelines.Steps; +namespace Refresher.Core.Patching.Steps.PS3; public class GetConsoleIdpsStep : Step { public GetConsoleIdpsStep(Pipeline pipeline) : base(pipeline) {} + public override string Name { get; } = "Downloading IDPS data from your console"; public override float Progress { get; protected set; } public override Task ExecuteAsync(CancellationToken cancellationToken = default) { diff --git a/Refresher.Core/Pipelines/Steps/SetupPS3AccessorStep.cs b/Refresher.Core/Patching/Steps/PS3/SetupPS3AccessorStep.cs similarity index 73% rename from Refresher.Core/Pipelines/Steps/SetupPS3AccessorStep.cs rename to Refresher.Core/Patching/Steps/PS3/SetupPS3AccessorStep.cs index eafaeee..ce03be5 100644 --- a/Refresher.Core/Pipelines/Steps/SetupPS3AccessorStep.cs +++ b/Refresher.Core/Patching/Steps/PS3/SetupPS3AccessorStep.cs @@ -1,12 +1,14 @@ using Refresher.Core.Accessors; +using Refresher.Core.Patching.Pipelines; -namespace Refresher.Core.Pipelines.Steps; +namespace Refresher.Core.Patching.Steps.PS3; public class SetupPS3AccessorStep : Step { public SetupPS3AccessorStep(Pipeline pipeline) : base(pipeline) {} + public override string Name { get; } = "Preparing to access files on your PS3"; public override float Progress { get; protected set; } public override List Inputs { get; } = [ @@ -16,7 +18,7 @@ public SetupPS3AccessorStep(Pipeline pipeline) : base(pipeline) public override Task ExecuteAsync(CancellationToken cancellationToken = default) { string remoteIp = CommonStepInputs.ConsoleIP.GetValueFromPipeline(this.Pipeline); - State.Logger.LogDebug(PS3, $"Using PS3 IP {remoteIp}"); + State.Logger.LogDebug(LogType.PS3, $"Using PS3 IP {remoteIp}"); PatchAccessor.Try(this, () => { diff --git a/Refresher.Core/Pipelines/Steps/FakeEncryptGameEbootStep.cs b/Refresher.Core/Patching/Steps/RPCS3/FakeEncryptGameEbootStep.cs similarity index 92% rename from Refresher.Core/Pipelines/Steps/FakeEncryptGameEbootStep.cs rename to Refresher.Core/Patching/Steps/RPCS3/FakeEncryptGameEbootStep.cs index eb8536c..b2c30ce 100644 --- a/Refresher.Core/Pipelines/Steps/FakeEncryptGameEbootStep.cs +++ b/Refresher.Core/Patching/Steps/RPCS3/FakeEncryptGameEbootStep.cs @@ -6,14 +6,16 @@ using System.Security.Cryptography; using Refresher.Core.Native.Elf; using Refresher.Core.Native.Sce; +using Refresher.Core.Patching.Pipelines; -namespace Refresher.Core.Pipelines.Steps; +namespace Refresher.Core.Patching.Steps.RPCS3; public class FakeEncryptGameEbootStep : Step { public FakeEncryptGameEbootStep(Pipeline pipeline) : base(pipeline) {} + public override string Name { get; } = "Fake-encrypting your EBOOT"; private static ushort Swap16(ushort val) => (ushort)(((val & 0xFF00) >> 8) | ((val & 0x00FF) << 8)); private static uint Swap32(uint val) => ((val & 0xFF000000) >> 24) | @@ -47,12 +49,12 @@ private static void WriteStruct(Stream stream, T @struct) where T : struct public override float Progress { get; protected set; } public override Task ExecuteAsync(CancellationToken cancellationToken = default) { - State.Logger.LogDebug(Encrypt, "Loading ELF to memory..."); + State.Logger.LogDebug(LogType.Encrypt, "Loading ELF to memory..."); byte[] elfData = File.ReadAllBytes(this.Game.DecryptedEbootPath); Elf64Ehdr elfHeader = MemoryMarshal.Read(elfData); - State.Logger.LogDebug(Encrypt, "Calculating offsets..."); + State.Logger.LogDebug(LogType.Encrypt, "Calculating offsets..."); SceHeader sceHeader = new(); SelfHeader selfHeader = new(); @@ -80,7 +82,7 @@ public override Task ExecuteAsync(CancellationToken cancellationToken = default) ulong shdrOffset = Swap64(elfHeader.e_shoff) + Swap64(sceHeader.head_len); - State.Logger.LogDebug(Encrypt, "Calculating segments ..."); + State.Logger.LogDebug(LogType.Encrypt, "Calculating segments ..."); SegmentInfo[] segments = new SegmentInfo[phdrCount]; for (int i = 0; i < phdrCount; i++) @@ -122,12 +124,12 @@ public override Task ExecuteAsync(CancellationToken cancellationToken = default) controlInfo.digest1 = new byte[20]; controlInfo.digest2 = new byte[20]; - State.Logger.LogDebug(Encrypt, "Calculating hashes..."); + State.Logger.LogDebug(LogType.Encrypt, "Calculating hashes..."); byte[] hardcodedSha = [0x62, 0x7c, 0xb1, 0x80, 0x8a, 0xb9, 0x38, 0xe3, 0x2c, 0x8c, 0x09, 0x17, 0x08, 0x72, 0x6a, 0x57, 0x9e, 0x25, 0x86, 0xe4]; Buffer.BlockCopy(hardcodedSha, 0, controlInfo.digest1, 0, 20); controlInfo.digest2 = SHA1.HashData(elfData); - State.Logger.LogDebug(Encrypt, "FSELF built, writing..."); + State.Logger.LogDebug(LogType.Encrypt, "FSELF built, writing..."); string outputPath = this.Game.EncryptedEbootPath = Path.GetTempFileName(); using FileStream output = File.Open(outputPath, FileMode.Create); WriteStruct(output, sceHeader); diff --git a/Refresher.Core/Pipelines/Steps/PrintInfoForEncryptedGameEbootStep.cs b/Refresher.Core/Patching/Steps/RPCS3/PrintInfoForEncryptedGameEbootStep.cs similarity index 68% rename from Refresher.Core/Pipelines/Steps/PrintInfoForEncryptedGameEbootStep.cs rename to Refresher.Core/Patching/Steps/RPCS3/PrintInfoForEncryptedGameEbootStep.cs index ce8479b..5e7e9cd 100644 --- a/Refresher.Core/Pipelines/Steps/PrintInfoForEncryptedGameEbootStep.cs +++ b/Refresher.Core/Patching/Steps/RPCS3/PrintInfoForEncryptedGameEbootStep.cs @@ -1,12 +1,14 @@ -using SCEToolSharp; +using Refresher.Core.Patching.Pipelines; +using SCEToolSharp; -namespace Refresher.Core.Pipelines.Steps; +namespace Refresher.Core.Patching.Steps.RPCS3; public class PrintInfoForEncryptedGameEbootStep : Step { public PrintInfoForEncryptedGameEbootStep(Pipeline pipeline) : base(pipeline) {} + public override string Name { get; } = "Printing info on encrypted EBOOT"; public override float Progress { get; protected set; } public override Task ExecuteAsync(CancellationToken cancellationToken = default) { diff --git a/Refresher.Core/Pipelines/Steps/SetupEmulatorAccessorStep.cs b/Refresher.Core/Patching/Steps/RPCS3/SetupEmulatorAccessorStep.cs similarity index 78% rename from Refresher.Core/Pipelines/Steps/SetupEmulatorAccessorStep.cs rename to Refresher.Core/Patching/Steps/RPCS3/SetupEmulatorAccessorStep.cs index f9ce528..da85f87 100644 --- a/Refresher.Core/Pipelines/Steps/SetupEmulatorAccessorStep.cs +++ b/Refresher.Core/Patching/Steps/RPCS3/SetupEmulatorAccessorStep.cs @@ -1,12 +1,14 @@ using Refresher.Core.Accessors; +using Refresher.Core.Patching.Pipelines; -namespace Refresher.Core.Pipelines.Steps; +namespace Refresher.Core.Patching.Steps.RPCS3; public class SetupEmulatorAccessorStep : Step { public SetupEmulatorAccessorStep(Pipeline pipeline) : base(pipeline) {} + public override string Name { get; } = "Preparing to access files inside your RPCS3 installation"; public override float Progress { get; protected set; } public override List Inputs { get; } = [ @@ -24,7 +26,7 @@ public override Task ExecuteAsync(CancellationToken cancellationToken = default) "Please use the real file path. " + "(it usually starts with C:\\ or some other drive letter)"); - State.Logger.LogDebug(RPCS3, $"Using RPCS3 path {path}"); + State.Logger.LogDebug(LogType.RPCS3, $"Using RPCS3 path {path}"); this.Pipeline.Accessor = new EmulatorPatchAccessor(path); return Task.CompletedTask; diff --git a/Refresher.Core/Pipelines/Step.cs b/Refresher.Core/Patching/Steps/Step.cs similarity index 88% rename from Refresher.Core/Pipelines/Step.cs rename to Refresher.Core/Patching/Steps/Step.cs index 5e72ed9..0dd6df3 100644 --- a/Refresher.Core/Pipelines/Step.cs +++ b/Refresher.Core/Patching/Steps/Step.cs @@ -1,8 +1,9 @@ using Refresher.Core.Patching; +using Refresher.Core.Patching.Pipelines; using Refresher.Core.Platform; using Refresher.Core.Verification.AutoDiscover; -namespace Refresher.Core.Pipelines; +namespace Refresher.Core.Patching.Steps; public abstract class Step : IAccessesPlatform { @@ -10,6 +11,7 @@ public abstract class Step : IAccessesPlatform public abstract float Progress { get; protected set; } public virtual List Inputs { get; } = []; + public abstract string Name { get; } protected GameInformation Game => this.Pipeline.GameInformation!; protected EncryptionDetails Encryption => this.Pipeline.EncryptionDetails!; diff --git a/Refresher.Core/Pipelines/StepInput.cs b/Refresher.Core/Patching/Steps/StepInput.cs similarity index 90% rename from Refresher.Core/Pipelines/StepInput.cs rename to Refresher.Core/Patching/Steps/StepInput.cs index fddec2b..3c992ce 100644 --- a/Refresher.Core/Pipelines/StepInput.cs +++ b/Refresher.Core/Patching/Steps/StepInput.cs @@ -1,4 +1,6 @@ -namespace Refresher.Core.Pipelines; +using Refresher.Core.Patching.Pipelines; + +namespace Refresher.Core.Patching.Steps; public class StepInput { diff --git a/Refresher.Core/Pipelines/StepInputType.cs b/Refresher.Core/Patching/Steps/StepInputType.cs similarity index 75% rename from Refresher.Core/Pipelines/StepInputType.cs rename to Refresher.Core/Patching/Steps/StepInputType.cs index 80e1ea3..e17818c 100644 --- a/Refresher.Core/Pipelines/StepInputType.cs +++ b/Refresher.Core/Patching/Steps/StepInputType.cs @@ -1,4 +1,4 @@ -namespace Refresher.Core.Pipelines; +namespace Refresher.Core.Patching.Steps; public enum StepInputType : byte { diff --git a/Refresher.Core/Pipelines/Steps/DelayOneSecondStep.cs b/Refresher.Core/Patching/Steps/Test/DelayOneSecondStep.cs similarity index 78% rename from Refresher.Core/Pipelines/Steps/DelayOneSecondStep.cs rename to Refresher.Core/Patching/Steps/Test/DelayOneSecondStep.cs index f7c69f7..5b09823 100644 --- a/Refresher.Core/Pipelines/Steps/DelayOneSecondStep.cs +++ b/Refresher.Core/Patching/Steps/Test/DelayOneSecondStep.cs @@ -1,6 +1,7 @@ using System.Diagnostics; +using Refresher.Core.Patching.Pipelines; -namespace Refresher.Core.Pipelines.Steps; +namespace Refresher.Core.Patching.Steps.Test; public class DelayOneSecondStep : Step { @@ -8,6 +9,7 @@ public DelayOneSecondStep(Pipeline pipeline) : base(pipeline) { } + public override string Name { get; } = "Delaying one second"; public override float Progress { get; protected set; } public override async Task ExecuteAsync(CancellationToken cancellationToken = default) diff --git a/Refresher.Core/Pipelines/Steps/ExampleInputStep.cs b/Refresher.Core/Patching/Steps/Test/ExampleInputStep.cs similarity index 84% rename from Refresher.Core/Pipelines/Steps/ExampleInputStep.cs rename to Refresher.Core/Patching/Steps/Test/ExampleInputStep.cs index b78682a..a6a2905 100644 --- a/Refresher.Core/Pipelines/Steps/ExampleInputStep.cs +++ b/Refresher.Core/Patching/Steps/Test/ExampleInputStep.cs @@ -1,6 +1,7 @@ +using Refresher.Core.Patching.Pipelines; using Refresher.Core.Platform; -namespace Refresher.Core.Pipelines.Steps; +namespace Refresher.Core.Patching.Steps.Test; public class ExampleInputStep : Step { @@ -8,6 +9,7 @@ public ExampleInputStep(Pipeline pipeline) : base(pipeline) { } + public override string Name { get; } = "Example input"; public override float Progress { get; protected set; } public override List Inputs { get; } = diff --git a/Refresher.Core/Storage/PreviousInputStorage.cs b/Refresher.Core/Storage/PreviousInputStorage.cs index e66514e..8ffbb10 100644 --- a/Refresher.Core/Storage/PreviousInputStorage.cs +++ b/Refresher.Core/Storage/PreviousInputStorage.cs @@ -1,4 +1,4 @@ -using Refresher.Core.Pipelines; +using Refresher.Core.Patching.Pipelines; namespace Refresher.Core.Storage; diff --git a/Refresher.Core/Verification/AutoDiscover/AutoDiscoverClient.cs b/Refresher.Core/Verification/AutoDiscover/AutoDiscoverClient.cs index 42e34aa..e32f722 100644 --- a/Refresher.Core/Verification/AutoDiscover/AutoDiscoverClient.cs +++ b/Refresher.Core/Verification/AutoDiscover/AutoDiscoverClient.cs @@ -153,7 +153,7 @@ private static string TryCompleteUrl(string url) // technically, beacon doesn't support autodiscover so this is more future-proofing if they ever do for some reason return "https://beacon.lbpunion.com"; case "refreshed": - State.Logger.LogError("jvyden", "you're gonna make me cry. it's refresh. not refreshed."); + State.Logger.LogError(LogType.AutoDiscover, "jvyden", "you're gonna make me cry. it's refresh. not refreshed."); goto case "refresh"; default: // prefer HTTPS by default if there's no scheme set. diff --git a/Refresher/CLI/CommandLine.cs b/Refresher/CLI/CommandLine.cs index e05a60e..d32ab72 100644 --- a/Refresher/CLI/CommandLine.cs +++ b/Refresher/CLI/CommandLine.cs @@ -69,7 +69,7 @@ void DeleteTempFile(string? s) List messages = ebootPatcher.Verify(options.ServerUrl, options.Digest ?? false).ToList(); //Write the messages to the console - foreach (Message message in messages) State.Logger.LogInfo(Verify, $"{message.Level}: {message.Content}"); + foreach (Message message in messages) State.Logger.LogInfo(LogType.Verify, $"{message.Level}: {message.Content}"); //If there are any errors, exit if (messages.Any(m => m.Level == MessageLevel.Error)) diff --git a/Refresher/EtoPlatformInterface.cs b/Refresher/EtoPlatformInterface.cs index 8a24fa9..28fb9bd 100644 --- a/Refresher/EtoPlatformInterface.cs +++ b/Refresher/EtoPlatformInterface.cs @@ -46,7 +46,7 @@ public override void ErrorPrompt(string prompt) public override QuestionResult Ask(string question) { - State.Logger.LogInfo(Platform, $"Asking user '{question}'..."); + State.Logger.LogInfo(LogType.Platform, $"Asking user '{question}'..."); DialogResult result = DialogResult.None; Application.Instance.Invoke(() => { @@ -54,7 +54,7 @@ public override QuestionResult Ask(string question) }); // ReSharper disable once SwitchExpressionHandlesSomeKnownEnumValuesWithExceptionInDefault - State.Logger.LogInfo(Platform, $"User answered {result.ToString()}"); + State.Logger.LogInfo(LogType.Platform, $"User answered {result.ToString()}"); return result switch { DialogResult.Yes => QuestionResult.Yes, @@ -81,7 +81,7 @@ public override void OpenUrl(Uri uri) } catch (Exception e) { - State.Logger.LogError(OSIntegration, e.ToString()); + State.Logger.LogError(LogType.OSIntegration, e.ToString()); MessageBox.Show("We couldn't open your browser due to an error.\n" + $"You can use this link instead: {url}\n\n" + $"Exception details: {e.GetType().Name} {e.Message}", MessageBoxType.Error); diff --git a/Refresher/Program.cs b/Refresher/Program.cs index 791c3f3..bda90be 100644 --- a/Refresher/Program.cs +++ b/Refresher/Program.cs @@ -7,7 +7,7 @@ using Refresher.CLI; using Refresher.Core; using Refresher.Core.Logging; -using Refresher.Core.Pipelines.Lbp; +using Refresher.Core.Patching.Pipelines.Lbp; using Refresher.UI; using Velopack; using Velopack.Logging; @@ -31,12 +31,12 @@ public static void Main(string[] args) State.InitializeLogger([new ConsoleSink(), new EventSink(), new SentryBreadcrumbSink()]); State.InitializeSentry(); - State.Logger.LogInfo(OSIntegration, $"Refresher launched with args [{string.Join(',', args)}] (count: {args.Length})"); + State.Logger.LogInfo(LogType.OSIntegration, $"Refresher launched with args [{string.Join(',', args)}] (count: {args.Length})"); bool isCliInvocation = args.Length > 0 && !UrlAssociationHandler.IsArgsUrl(args) && !UrlAssociationHandler.IsArgsTryingToRegisterAssociations(args); if (isCliInvocation) { - State.Logger.LogInfo(OSIntegration, "Launching in CLI mode"); + State.Logger.LogInfo(LogType.OSIntegration, "Launching in CLI mode"); AppDomain.CurrentDomain.UnhandledException += (_, eventArgs) => { @@ -86,7 +86,7 @@ public static void Main(string[] args) try { - State.Logger.LogInfo(OSIntegration, "Launching in GUI mode"); + State.Logger.LogInfo(LogType.OSIntegration, "Launching in GUI mode"); Form form = UrlAssociationHandler.IsArgsUrl(args) ? FormFromUrl(args[0]) : new MainForm(); diff --git a/Refresher/UI/MainForm.cs b/Refresher/UI/MainForm.cs index 44408bb..f5bb735 100644 --- a/Refresher/UI/MainForm.cs +++ b/Refresher/UI/MainForm.cs @@ -1,7 +1,9 @@ using Eto.Drawing; using Eto.Forms; -using Refresher.Core.Pipelines; -using Refresher.Core.Pipelines.Lbp; +using Refresher.Core.Patching.Pipelines; +using Refresher.Core.Patching.Pipelines.Lbp; +using Refresher.Core.Patching.Pipelines.Legacy; +using Refresher.Core.Patching.Pipelines.Test; using Velopack; using Velopack.Exceptions; using Velopack.Sources; diff --git a/Refresher/UI/PipelineForm.cs b/Refresher/UI/PipelineForm.cs index b41349a..873b6a3 100644 --- a/Refresher/UI/PipelineForm.cs +++ b/Refresher/UI/PipelineForm.cs @@ -9,12 +9,12 @@ using Refresher.Core.Accessors; using Refresher.Core.Logging; using Refresher.Core.Patching; -using Refresher.Core.Pipelines; +using Refresher.Core.Patching.Pipelines; +using Refresher.Core.Patching.Steps; using Refresher.Core.Platform; using Refresher.Core.Storage; using Refresher.Extensions; using Refresher.UI.Items; -using Pipeline = Refresher.Core.Pipelines.Pipeline; namespace Refresher.UI; @@ -335,7 +335,7 @@ await Application.Instance.InvokeAsync(() => } catch (DirectoryNotFoundException) { - State.Logger.LogError(Accessor, "The games folder doesn't exist at that path. Please ensure you entered the right path/IP."); + State.Logger.LogError(LogType.Accessor, "The games folder doesn't exist at that path. Please ensure you entered the right path/IP."); } catch (Exception ex) { @@ -391,7 +391,7 @@ private void HandleGameList(List games) } catch(Exception e) { - State.Logger.LogWarning(InfoRetrieval, $"Failed to set image for {game}: {e}"); + State.Logger.LogWarning(LogType.InfoRetrieval, $"Failed to set image for {game}: {e}"); } } diff --git a/Refresher/UI/RefresherForm.cs b/Refresher/UI/RefresherForm.cs index 315a37e..c62bada 100644 --- a/Refresher/UI/RefresherForm.cs +++ b/Refresher/UI/RefresherForm.cs @@ -52,7 +52,7 @@ protected RefresherForm(string subtitle, Size size, bool padBottom = true) TForm form = new(); form.Show(); - State.Logger.LogDebug(OSIntegration, $"Showing child form {form.GetType().Name} '{form.Title}'"); + State.Logger.LogDebug(LogType.OSIntegration, $"Showing child form {form.GetType().Name} '{form.Title}'"); if (close) {