Remove legacy party configuration
This commit is contained in:
@@ -278,14 +278,9 @@ func LoadPipelineCampaignWithParty(pipelinePath string, pipeline *PipelineConfig
|
||||
if campaign == nil {
|
||||
return LoadedPipelineCampaign{}, fmt.Errorf("campaign config is required")
|
||||
}
|
||||
if party.Mode == "" {
|
||||
if party.Canonical == nil {
|
||||
return LoadedPipelineCampaign{}, fmt.Errorf("resolved campaign party is required")
|
||||
}
|
||||
if party.Mode == PartyModeCanonical {
|
||||
if err := validateCanonicalPartySelection(campaign, nil); err != nil {
|
||||
return LoadedPipelineCampaign{}, err
|
||||
}
|
||||
}
|
||||
if err := expandPipelineArtifactFamilies(pipeline, party); err != nil {
|
||||
return LoadedPipelineCampaign{}, err
|
||||
}
|
||||
@@ -322,18 +317,13 @@ func ResolveLoadedPipelineCampaign(loaded LoadedPipelineCampaign, sessionPath st
|
||||
if loaded.Campaign == nil {
|
||||
return nil, fmt.Errorf("campaign config is required")
|
||||
}
|
||||
if loaded.Party.Mode == "" {
|
||||
if loaded.Party.Canonical == nil {
|
||||
party, err := resolveCampaignParty(loaded.CampaignPath, loaded.Campaign)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
loaded.Party = party
|
||||
}
|
||||
if loaded.Party.Mode == PartyModeCanonical {
|
||||
if err := validateCanonicalPartySelection(loaded.Campaign, nil); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
cfg := &Config{
|
||||
Pipeline: loaded.Pipeline,
|
||||
Campaign: loaded.Campaign,
|
||||
@@ -344,11 +334,6 @@ func ResolveLoadedPipelineCampaign(loaded LoadedPipelineCampaign, sessionPath st
|
||||
SessionSource: sessionSource,
|
||||
Party: loaded.Party,
|
||||
}
|
||||
if cfg.Party.Mode == PartyModeCanonical && sessionCfg != nil {
|
||||
if err := validateCanonicalPartySelection(loaded.Campaign, sessionCfg); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
if sessionCfg == nil {
|
||||
return cfg, nil
|
||||
}
|
||||
@@ -363,22 +348,6 @@ func ResolveLoadedPipelineCampaign(loaded LoadedPipelineCampaign, sessionPath st
|
||||
if strings.TrimSpace(cfg.SessionSource.LocalPath) == "" {
|
||||
cfg.SessionSource.LocalPath = sessionPath
|
||||
}
|
||||
if cfg.Party.Mode == PartyModeCanonical {
|
||||
stableInputs.PlayersFile = virtualPlayersInput()
|
||||
cfg.Session.Inputs.PlayersFile = ""
|
||||
} else {
|
||||
party, err := resolvePartyInput(stableInputs.PartyFile)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if party.Mode == PartyModeCanonical {
|
||||
return nil, fmt.Errorf("session.inputs.party_file cannot select a canonical party; canonical parties are campaign-owned")
|
||||
}
|
||||
cfg.Party = party
|
||||
if strings.TrimSpace(stableInputs.PlayersFile.Path) == "" {
|
||||
return nil, fmt.Errorf("players_file is required with a legacy party")
|
||||
}
|
||||
}
|
||||
cfg.StableInputs = stableInputs
|
||||
return cfg, nil
|
||||
}
|
||||
@@ -456,15 +425,9 @@ func mergeCampaignSession(campaignCfg *CampaignConfig, sessionCfg *SessionConfig
|
||||
campaignPath,
|
||||
sessionPath,
|
||||
),
|
||||
PlayersFile: selectStableInput(
|
||||
campaignCfg.Inputs.PlayersFile,
|
||||
sessionCfg.Inputs.PlayersFile,
|
||||
campaignPath,
|
||||
sessionPath,
|
||||
),
|
||||
PartyFile: selectStableInput(
|
||||
campaignCfg.Inputs.PartyFile,
|
||||
sessionCfg.Inputs.PartyFile,
|
||||
"",
|
||||
campaignPath,
|
||||
sessionPath,
|
||||
),
|
||||
@@ -479,8 +442,6 @@ func mergeCampaignSession(campaignCfg *CampaignConfig, sessionCfg *SessionConfig
|
||||
sessionCfg.Inputs.SpeakersFile = stable.SpeakersFile.Path
|
||||
sessionCfg.Inputs.AutocorrectFile = stable.AutocorrectFile.Path
|
||||
sessionCfg.Inputs.GlossaryFile = stable.GlossaryFile.Path
|
||||
sessionCfg.Inputs.PlayersFile = stable.PlayersFile.Path
|
||||
sessionCfg.Inputs.PartyFile = stable.PartyFile.Path
|
||||
sessionCfg.Inputs.SpellCatalogFile = stable.SpellCatalogFile.Path
|
||||
return stable, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user