config(battle-node): require NodeServerUrl from appsettings, no fallback
Move the localhost default off BattleNodeOptions and out of Program.cs into an appsettings.json "BattleNode" section, and make AddBattleNode throw at startup if the value is missing or blank. Deployments now must set the URL explicitly, and dev keeps working via the checked-in value. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -165,11 +165,10 @@ public class Program
|
||||
|
||||
builder.Services.AddBattleNode(opt =>
|
||||
{
|
||||
// Matches the prod do_matching wire format: host:port/socket.io/, no scheme prefix.
|
||||
// BestHTTP's SocketManager parses this as the Socket.IO v2 endpoint URL.
|
||||
opt.NodeServerUrl = "localhost:5148/socket.io/";
|
||||
// Any field in BattleNodeOptions can be overridden via the "BattleNode" section
|
||||
// in appsettings*.json — see appsettings.Development.json for DiagnosticLogging.
|
||||
// Every field on BattleNodeOptions is populated from the "BattleNode" section in
|
||||
// appsettings*.json. NodeServerUrl has no hardcoded fallback — AddBattleNode
|
||||
// throws at startup if it's missing/blank. See BattleNodeOptions.NodeServerUrl
|
||||
// for the required wire format.
|
||||
builder.Configuration.GetSection("BattleNode").Bind(opt);
|
||||
});
|
||||
// In-process FCFS pair-up for TK2 PvP /do_matching, plus rank-battle's AI-fallback
|
||||
|
||||
Reference in New Issue
Block a user