Experimental: no longer run in dev/staging dalamud when not Debug/ReleaseValidate

This commit is contained in:
RisaDev
2024-11-18 01:08:25 +03:00
parent 9c0b8b7ab0
commit 344dc52614
11 changed files with 124 additions and 18 deletions

View File

@@ -5,6 +5,12 @@ namespace CustomizePlus.Core.Services.Dalamud;
public class DalamudBranchService : IService
{
/// <summary>
/// Message used in various places to tell user why the plugin is disabled
/// </summary>
public const string PluginDisabledMessage = "You are running development or testing version of Dalamud.\n" +
"Regular users are not supposed to run Customize+ on non-release versions of Dalamud therefore Customize+ has disabled itself.";
/// <summary>
/// Current Dalamud branch
/// </summary>
@@ -15,6 +21,11 @@ public class DalamudBranchService : IService
/// </summary>
public string CurrentBranchName { get; private set; }
/// <summary>
/// Whether to allow or not Customize+ to actually function
/// </summary>
public bool AllowPluginToRun { get; private set; } = true;
public DalamudBranchService(DalamudConfigService dalamudConfigService, Logger logger)
{
dalamudConfigService.GetDalamudConfig<string>(DalamudConfigService.BetaKindOption, out var betaOption);
@@ -33,7 +44,11 @@ public class DalamudBranchService : IService
break;
}
logger.Information($"Current Dalamud branch is: {CurrentBranchName} ({CurrentBranch})");
#if CHECK_DALAMUD_BRANCH
AllowPluginToRun = CurrentBranch == DalamudBranch.Release;
#endif
logger.Information($"Current Dalamud branch is: {CurrentBranchName} ({CurrentBranch}). Plugin allowed to run: {AllowPluginToRun}");
}
public enum DalamudBranch