Experimental: no longer run in dev/staging dalamud when not Debug/ReleaseValidate
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user