Stage 2 of deprecation for IsBotAccount, --server and --service

This commit is contained in:
JustArchi
2018-05-13 20:59:05 +02:00
parent a7df090225
commit 2357729ca4
2 changed files with 12 additions and 19 deletions

View File

@@ -129,19 +129,16 @@ namespace ArchiSteamFarm {
[JsonProperty]
internal string SteamPassword { get; set; }
private bool DeprecatedConfig;
private bool ShouldSerializeSensitiveDetails = true;
[JsonProperty(Required = Required.DisallowNull)]
[SuppressMessage("ReSharper", "ValueParameterNotUsed")]
private bool IsBotAccount {
set {
// TODO: Deprecate further in the next version
ASF.ArchiLogger.LogGenericWarning(string.Format(Strings.WarningDeprecated, nameof(IsBotAccount), nameof(BotBehaviour)));
if (value) {
BotBehaviour |= EBotBehaviour.RejectInvalidFriendInvites;
BotBehaviour |= EBotBehaviour.RejectInvalidTrades;
BotBehaviour |= EBotBehaviour.RejectInvalidGroupInvites;
}
ASF.ArchiLogger.LogGenericError(string.Format(Strings.WarningDeprecated, nameof(IsBotAccount), nameof(BotBehaviour)));
DeprecatedConfig = true;
}
}
@@ -186,6 +183,10 @@ namespace ArchiSteamFarm {
return null;
}
if (botConfig.DeprecatedConfig) {
return null;
}
botConfig.ShouldSerializeSensitiveDetails = false;
// Support encrypted passwords

View File

@@ -447,21 +447,13 @@ namespace ArchiSteamFarm {
break;
case "--server" when !cryptKeyNext:
// TODO: Deprecate further in the next version
ASF.ArchiLogger.LogGenericWarning(string.Format(Strings.WarningDeprecated, "--server", "GlobalConfig.IPC"));
ProcessRequired = true;
if (GlobalConfig.IPCPrefixes.Count > 0) {
IPC.Start(GlobalConfig.IPCPrefixes);
}
ASF.ArchiLogger.LogGenericError(string.Format(Strings.WarningDeprecated, "--server", "GlobalConfig.IPC"));
Environment.Exit(1);
break;
case "--service" when !cryptKeyNext:
// TODO: Deprecate further in the next version
ASF.ArchiLogger.LogGenericWarning(string.Format(Strings.WarningDeprecated, "--service", "--no-restart --process-required --system-required"));
RestartAllowed = false;
ProcessRequired = true;
SystemRequired = true;
ASF.ArchiLogger.LogGenericError(string.Format(Strings.WarningDeprecated, "--service", "--no-restart --process-required --system-required"));
Environment.Exit(1);
break;
case "--system-required" when !cryptKeyNext:
SystemRequired = true;