mirror of
https://github.com/OatmealDome/Rotationator.git
synced 2026-03-21 17:34:16 -05:00
Program: Add bounds check to prevent generating more than 256 rotations
This commit is contained in:
parent
c68a64f2b5
commit
3d65678022
|
|
@ -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})");
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user