This commit is contained in:
gamer147
2026-05-25 14:36:12 -04:00
parent 558e8288eb
commit 5e7a65fe5a
54 changed files with 39633 additions and 29 deletions

View File

@@ -25,7 +25,7 @@ public static class Program
return 1;
}
if (opts.SkipReference && opts.SkipCards && opts.SkipGlobals)
if (opts.SkipReference && opts.SkipCards && opts.SkipGlobals && opts.SkipStory)
{
Console.Error.WriteLine("All --skip-* flags set; nothing to do.");
return 1;
@@ -82,6 +82,15 @@ public static class Program
Console.WriteLine("[Bootstrap] --skip-globals set; skipping globals import.");
}
if (!opts.SkipStory)
{
await new StoryImporter().ImportAsync(context, opts.StoryDataDir);
}
else
{
Console.WriteLine("[Bootstrap] --skip-story set; skipping story import.");
}
Console.WriteLine("[Bootstrap] Complete.");
return 0;
}
@@ -95,6 +104,8 @@ public static class Program
bool skipReference = false;
bool skipCards = false;
bool skipGlobals = false;
bool skipStory = false;
string? storyDataDir = null;
string? positionalCards = null;
for (int i = 0; i < args.Length; i++)
@@ -109,6 +120,8 @@ public static class Program
case "--skip-reference": skipReference = true; break;
case "--skip-cards": skipCards = true; break;
case "--skip-globals": skipGlobals = true; break;
case "--skip-story": skipStory = true; break;
case "--story-data-dir": storyDataDir = NextArg(args, ref i); break;
default:
// Back-compat: legacy positional form `svsim-card-import <cards.json> [connection]`.
if (positionalCards is null && !a.StartsWith('-')) positionalCards = a;
@@ -129,13 +142,16 @@ public static class Program
string cardsFile = cards ?? positionalCards ?? shippedCardsFile;
string capturesDir = captures ?? shippedCaptures;
string refDir = referenceDataDir ?? shippedDataDir;
string shippedStoryDir = Path.Combine(shippedDataDir, "story");
string storyDir = storyDataDir ?? shippedStoryDir;
string connStr = connection
?? Environment.GetEnvironmentVariable("NPGSQL_CONNECTION")
?? DefaultConnectionString;
return new BootstrapOptions(
cardsFile, capturesDir, refDir, connStr, skipReference, skipCards, skipGlobals);
cardsFile, capturesDir, refDir, connStr, skipReference, skipCards, skipGlobals,
skipStory, storyDir);
}
private static string NextArg(string[] args, ref int i)
@@ -165,6 +181,8 @@ public static class Program
" --skip-reference Skip reference-data import (classes, sleeves, ranks, ...)\n" +
" --skip-cards Skip card + card-cosmetic-reward import\n" +
" --skip-globals Skip prod-captured globals import\n" +
" --story-data-dir <dir> Override story data directory (default: shipped Data/story)\n" +
" --skip-story Skip story import (worlds/sections/chapters/sbs)\n" +
"\n" +
"Back-compat: `svsim-bootstrap <cards.json> [connection]` still works (positional).");
}
@@ -176,5 +194,7 @@ public static class Program
string ConnectionString,
bool SkipReference,
bool SkipCards,
bool SkipGlobals);
bool SkipGlobals,
bool SkipStory,
string StoryDataDir);
}