mirror of
https://github.com/OatmealDome/Rotationator.git
synced 2026-10-01 05:46:46 -05:00
Program: Add bounds check to prevent generating more than 256 rotations
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using System.CommandLine;
|
||||
using System.CommandLine;
|
||||
using System.CommandLine.Invocation;
|
||||
using System.Text.Json;
|
||||
using OatmealDome.BinaryData;
|
||||
@@ -215,6 +215,11 @@ void Run(InvocationContext context)
|
||||
|
||||
loopTime = loopTime.AddHours(length);
|
||||
}
|
||||
|
||||
if (maximumPhases > 256)
|
||||
{
|
||||
throw new Exception("Gambit can only load up to 256 rotations at a time");
|
||||
}
|
||||
|
||||
Console.WriteLine($"Generating {maximumPhases} phases to reach {endTime:O} (already have {currentPhases.Count})");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user