fix(svc): default MaxBattleCount=7 with warn-log on empty reward catalog
This commit is contained in:
@@ -80,7 +80,19 @@ public class ArenaTwoPickService : IArenaTwoPickService
|
|||||||
}
|
}
|
||||||
|
|
||||||
var aCfg = _config.Get<SVSim.Database.Models.Config.ArenaTwoPickConfig>();
|
var aCfg = _config.Get<SVSim.Database.Models.Config.ArenaTwoPickConfig>();
|
||||||
var maxWins = Math.Max(1, await _rewards.GetMaxWinCountAsync());
|
var rawMaxWins = await _rewards.GetMaxWinCountAsync();
|
||||||
|
int maxWins;
|
||||||
|
if (rawMaxWins == 0)
|
||||||
|
{
|
||||||
|
// Reward catalog not seeded — bootstrap hasn't run. Fall back to the spec's
|
||||||
|
// documented default (7) and log a warning so misconfigured deployments are visible.
|
||||||
|
Console.Error.WriteLine("[ArenaTwoPickService] ArenaTwoPickRewards catalog empty; defaulting MaxBattleCount=7. Run SVSim.Bootstrap to seed.");
|
||||||
|
maxWins = 7;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
maxWins = rawMaxWins;
|
||||||
|
}
|
||||||
var candidates = SampleCandidateClasses(aCfg.AllowedClassIds, _rng);
|
var candidates = SampleCandidateClasses(aCfg.AllowedClassIds, _rng);
|
||||||
|
|
||||||
var run = new ViewerArenaTwoPickRun
|
var run = new ViewerArenaTwoPickRun
|
||||||
|
|||||||
Reference in New Issue
Block a user