Remove legacy party configuration
This commit is contained in:
@@ -28,18 +28,17 @@ func resolvePartyInput(input ResolvedInputFile) (ResolvedParty, error) {
|
||||
if err != nil {
|
||||
return ResolvedParty{}, fmt.Errorf("read party input %q: %w", path, err)
|
||||
}
|
||||
document, err := ParseParty(raw)
|
||||
party, err := ParseParty(raw)
|
||||
if err != nil {
|
||||
return ResolvedParty{}, fmt.Errorf("parse party input %q: %w", path, err)
|
||||
}
|
||||
return ResolvedParty{
|
||||
Mode: PartyModeCanonical,
|
||||
Source: PartySource{
|
||||
Path: path,
|
||||
ConfigPath: configPath,
|
||||
Source: input.Source,
|
||||
},
|
||||
Canonical: document.Canonical,
|
||||
Canonical: party,
|
||||
}, nil
|
||||
}
|
||||
|
||||
@@ -64,26 +63,3 @@ func resolveCampaignParty(campaignPath string, campaign *CampaignConfig) (Resolv
|
||||
}
|
||||
return resolvePartyInput(input)
|
||||
}
|
||||
|
||||
func validateCanonicalPartySelection(campaign *CampaignConfig, session *SessionConfig) error {
|
||||
if campaign == nil {
|
||||
return fmt.Errorf("campaign config is required")
|
||||
}
|
||||
if strings.TrimSpace(campaign.Inputs.PlayersFile) != "" {
|
||||
return fmt.Errorf("campaign.inputs.players_file is not allowed with a canonical party")
|
||||
}
|
||||
if session == nil {
|
||||
return nil
|
||||
}
|
||||
if strings.TrimSpace(session.Inputs.PlayersFile) != "" {
|
||||
return fmt.Errorf("session.inputs.players_file is not allowed with a canonical party")
|
||||
}
|
||||
if strings.TrimSpace(session.Inputs.PartyFile) != "" {
|
||||
return fmt.Errorf("session.inputs.party_file cannot override a canonical campaign party")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func virtualPlayersInput() ResolvedInputFile {
|
||||
return ResolvedInputFile{Source: "derived_from_party"}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user