Skip to content

Commit

Permalink
refactor: replaced _autoEula to local variable
Browse files Browse the repository at this point in the history
  • Loading branch information
fakeman2332 committed Aug 20, 2024
1 parent e41ed7b commit c7c17e4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Core/LocalAdmin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ public sealed class LocalAdmin : IDisposable
private static bool _ignoreNextRestart;
private static bool _noTerminalTitle;
private static int _restarts = -1, _restartsLimit = 4, _restartsTimeWindow = 480; //480 seconds = 8 minutes
private static bool _autoEula;

internal readonly CommandService CommandService = new();
private readonly string _scpslExecutable;
Expand Down Expand Up @@ -182,13 +181,15 @@ internal async Task Start(string[] args)
{
await LoadJsonOrTerminate();

var autoEula = false;

if (DataJson!.EulaAccepted == null)
{
if (args.Contains("--acceptEULA", StringComparer.Ordinal) ||
Environment.GetEnvironmentVariable("SLLA_EULA")?.ToUpperInvariant() is "1" or "TRUE")
{
DataJson!.EulaAccepted = DateTime.UtcNow;
_autoEula = true;
autoEula = true;

await SaveJsonOrTerminate();
}
Expand Down Expand Up @@ -546,7 +547,7 @@ internal async Task Start(string[] args)

_readerTask!.Start();

if (_autoEula)
if (autoEula)
ConsoleUtil.WriteLine("SCP: Secret Laboratory EULA (https://link.scpslgame.com/eula) was accepted by providing a startup argument or setting an environment variable.", ConsoleColor.Yellow);

if (!EnableLogging)
Expand Down

0 comments on commit c7c17e4

Please sign in to comment.