Import remote facts with managed catalog
This commit is contained in:
parent
e78f158629
commit
bf87e47999
3 changed files with 21 additions and 3 deletions
|
|
@ -308,7 +308,8 @@ static async Task<AetheriaRuntimeDaemonTickResult> ImportRemoteCommittedFactsAsy
|
|||
options.DaemonId,
|
||||
frame.SessionId,
|
||||
options.VerseId,
|
||||
importedFactIds);
|
||||
importedFactIds,
|
||||
node.RuntimeCatalog().Latest());
|
||||
|
||||
var importedFrame = import.Frame;
|
||||
importedFrame.ImportedFactIds = import.AcceptedFactIds;
|
||||
|
|
|
|||
|
|
@ -10055,6 +10055,7 @@ static void RequireDaemonVersePublication(string root)
|
|||
"startServer: true",
|
||||
"node.LatestFrame().ReadAsync()",
|
||||
"Catalog = node.RuntimeCatalog().Latest()",
|
||||
"node.RuntimeCatalog().Latest());",
|
||||
"node.VerseAuthorityPolicy().ReadAsync()",
|
||||
"node.StarbridgeScenario().ReadAsync()",
|
||||
"node.StarbridgeSession().ReadAsync()",
|
||||
|
|
@ -10115,6 +10116,21 @@ static void RequireDaemonVersePublication(string root)
|
|||
string.Join(", ", missingDaemonHostSymbols));
|
||||
}
|
||||
|
||||
var committedFactImportStart = daemonHostSource.IndexOf(
|
||||
"static async Task<AetheriaRuntimeDaemonTickResult> ImportRemoteCommittedFactsAsync",
|
||||
StringComparison.Ordinal);
|
||||
var committedFactImportEnd = committedFactImportStart >= 0
|
||||
? daemonHostSource.IndexOf("static RudpCultNetSchemaServer StartRtsCultMeshHost", committedFactImportStart, StringComparison.Ordinal)
|
||||
: -1;
|
||||
var committedFactImportBlock = committedFactImportStart >= 0 && committedFactImportEnd > committedFactImportStart
|
||||
? daemonHostSource.Substring(committedFactImportStart, committedFactImportEnd - committedFactImportStart)
|
||||
: "";
|
||||
if (!committedFactImportBlock.Contains("node.RuntimeCatalog().Latest())", StringComparison.Ordinal))
|
||||
{
|
||||
throw new InvalidOperationException(
|
||||
"Remote committed fact import must pass the managed runtime catalog document into the tick importer instead of reopening catalog storage.");
|
||||
}
|
||||
|
||||
var apiPublicationStart = daemonHostSource.IndexOf(
|
||||
"static async Task PublishDaemonApiDocumentsAsync",
|
||||
StringComparison.Ordinal);
|
||||
|
|
|
|||
|
|
@ -40,7 +40,8 @@ namespace GameCult.Aetheria.State.Verse
|
|||
string daemonId,
|
||||
string sessionId,
|
||||
string verseId,
|
||||
IEnumerable<string>? importedFactIds = null)
|
||||
IEnumerable<string>? importedFactIds = null,
|
||||
AetheriaRuntimeCatalogSnapshot? catalog = null)
|
||||
{
|
||||
currentFrame ??= new AetheriaRuntimeDaemonFrameDocument
|
||||
{
|
||||
|
|
@ -111,7 +112,7 @@ namespace GameCult.Aetheria.State.Verse
|
|||
AccountedCommandIds = currentFrame.AccountedCommandIds,
|
||||
CumulativeAppliedCommandIds = currentFrame.CumulativeAppliedCommandIds,
|
||||
CumulativeRejectedCommandIds = currentFrame.CumulativeRejectedCommandIds,
|
||||
Catalog = AetheriaRuntimeCatalogStore.OpenReadOnly(stateFilePath),
|
||||
Catalog = catalog ?? AetheriaRuntimeCatalogStore.OpenReadOnly(stateFilePath),
|
||||
BuildPublications = false
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue