Read the .udc CallHist multiplier and BonusPoints2
MultSqlString = CallHist counts every station the call history file lists, once per callsign, which is how N1MM dedups it. The file reaches the scoring code through ContestLog.History, and a QsoContext now carries it; without a file loaded nothing counts. BonusPoints2 = +50, calls.txt reads the callsigns from the support-files folder and adds 50 to the contact, *2 doubles it and a plain 50 scores 50 instead. The folder comes from the registry, which the app passes when it reads the .udc files. N1MM's other form, where the file is grids.txt and the bonus is looked up by grid square, is not read. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RoGtneMQaz4M9w7Kk49AVD
This commit is contained in:
@@ -42,19 +42,23 @@ public sealed class ContestRegistry
|
||||
|
||||
private ContestRegistry(Dictionary<string, ContestChoice> byName) => this.byName = byName;
|
||||
|
||||
public static ContestRegistry Create(IEnumerable<UdcFile>? userDefined = null)
|
||||
/// `supportFolder` is where a user-defined contest reads the files its
|
||||
/// settings name, which is the folder the country file is in.
|
||||
public static ContestRegistry Create(
|
||||
IEnumerable<UdcFile>? userDefined = null,
|
||||
string? supportFolder = null)
|
||||
{
|
||||
Dictionary<string, ContestChoice> byName = BuiltIn.ToDictionary(
|
||||
c => c.Name,
|
||||
StringComparer.OrdinalIgnoreCase);
|
||||
foreach (UdcFile file in userDefined ?? [])
|
||||
{
|
||||
UserDefinedContest contest = new(file);
|
||||
UserDefinedContest contest = new(file, supportFolder);
|
||||
byName[contest.Name] = new ContestChoice(
|
||||
contest.Name,
|
||||
contest.DisplayName,
|
||||
contest.Modes,
|
||||
_ => new UserDefinedContest(file));
|
||||
_ => new UserDefinedContest(file, supportFolder));
|
||||
}
|
||||
return new ContestRegistry(byName);
|
||||
}
|
||||
@@ -62,7 +66,10 @@ public sealed class ContestRegistry
|
||||
/// Reads every `.udc` file in the folder. Published files come with the
|
||||
/// extension in either case, and a file that will not parse is reported
|
||||
/// rather than silently left out.
|
||||
public static ContestRegistry FromFolder(string folder, out IReadOnlyList<string> problems)
|
||||
public static ContestRegistry FromFolder(
|
||||
string folder,
|
||||
out IReadOnlyList<string> problems,
|
||||
string? supportFolder = null)
|
||||
{
|
||||
List<UdcFile> files = [];
|
||||
List<string> failures = [];
|
||||
@@ -83,7 +90,7 @@ public sealed class ContestRegistry
|
||||
}
|
||||
}
|
||||
problems = failures;
|
||||
return Create(files);
|
||||
return Create(files, supportFolder);
|
||||
}
|
||||
|
||||
public IReadOnlyList<ContestChoice> Choices =>
|
||||
|
||||
Reference in New Issue
Block a user