Devmode in Version String
This commit is contained in:
@@ -1023,7 +1023,7 @@ namespace BeWo
|
||||
|
||||
FrameworkElement.LanguageProperty.OverrideMetadata(typeof(FrameworkElement), new FrameworkPropertyMetadata(XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag)));
|
||||
|
||||
BeWoAppInfo.TryActiveDeveloperMode(e.Args);
|
||||
BeWoAppInfo.BeWoAppVersion.TryActiveDeveloperMode(e.Args);
|
||||
|
||||
//if(e.Args.LastOrDefault(x => x.StartsWith("/timeout:") || x.StartsWith("--timeout:")) is string str)
|
||||
//{
|
||||
|
||||
@@ -19,31 +19,11 @@ namespace BeWo
|
||||
var feature = BeWoClientFeature.AI;
|
||||
|
||||
BeWoAppVersion = new BeWoAppVersion(baseVersion, stage, stageVersion, feature);
|
||||
|
||||
#if DEBUG
|
||||
IsInDeveloperMode = true;
|
||||
#endif
|
||||
}
|
||||
|
||||
private static bool IsInDeveloperMode { get; set; }
|
||||
|
||||
public static BeWoAppVersion BeWoAppVersion { get; private set; }
|
||||
|
||||
public static bool IsInAiMode => BeWoAppVersion.Feature == BeWoClientFeature.AI;
|
||||
public static bool IsInAiSandboxMode => IsInDeveloperMode && IsInAiMode;
|
||||
|
||||
public static void TryActiveDeveloperMode(string[] args)
|
||||
{
|
||||
if (BeWoAppVersion.Stage != BeWoClientReleaseStage.Sandbox)
|
||||
return;
|
||||
|
||||
if (args.All(x => x != "/bewodevmode" && x != "--bewodevmode"))
|
||||
return;
|
||||
|
||||
if (IsInDeveloperMode)
|
||||
throw new NotImplementedException();
|
||||
|
||||
IsInDeveloperMode = true;
|
||||
}
|
||||
public static bool IsInAiSandboxMode => BeWoAppVersion.IsInDeveloperMode && IsInAiMode;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ namespace BeWo.Core
|
||||
public BeWoClientReleaseStage Stage { get; }
|
||||
public Version StageVersion { get; }
|
||||
public BeWoClientFeature Feature { get; }
|
||||
public static bool IsInDeveloperMode { get; private set; }
|
||||
|
||||
public BeWoAppVersion(Version baseVersion, BeWoClientReleaseStage stage, Version stageVersion, BeWoClientFeature feature = BeWoClientFeature.None)
|
||||
{
|
||||
@@ -22,6 +23,22 @@ namespace BeWo.Core
|
||||
Feature = feature;
|
||||
}
|
||||
|
||||
public void TryActiveDeveloperMode(string[] args)
|
||||
{
|
||||
if (Stage != BeWoClientReleaseStage.Sandbox)
|
||||
return;
|
||||
|
||||
#if !DEBUG
|
||||
if (args.All(x => x != "/bewodevmode" && x != "--bewodevmode"))
|
||||
return;
|
||||
#endif
|
||||
|
||||
if (IsInDeveloperMode)
|
||||
throw new NotImplementedException();
|
||||
|
||||
IsInDeveloperMode = true;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
string result = $"Version {BaseVersion}";
|
||||
@@ -36,6 +53,11 @@ namespace BeWo.Core
|
||||
result += $" ({Feature})";
|
||||
}
|
||||
|
||||
if (Stage == BeWoClientReleaseStage.Sandbox)
|
||||
{
|
||||
result += $" dev:{(IsInDeveloperMode ? "1" : "0")}";
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user