fix(streamdata): correctly track explicit APN host configuration

Record whether an APN host was explicitly provided during module init by
setting `ApnHostProvided` only when APN is enabled and host is non-empty.

This preserves accurate APN state for downstream logic that depends on
distinguishing defaulted host values from user-provided configuration.
This commit is contained in:
Felix 2026-05-15 22:15:46 +03:00
parent 3d47e802f1
commit d2e7f9aa6b

View File

@ -15,9 +15,10 @@ namespace LME.StreamData
{ {
public class ModInit : IModuleLoaded public class ModInit : IModuleLoaded
{ {
public static double Version => 1.0; public static double Version => 1.5;
public static OnlinesSettings StreamDataSettings; public static OnlinesSettings StreamDataSettings;
public static bool ApnHostProvided;
public static OnlinesSettings Settings public static OnlinesSettings Settings
{ {
@ -52,7 +53,7 @@ namespace LME.StreamData
StreamDataSettings = conf.ToObject<OnlinesSettings>(); StreamDataSettings = conf.ToObject<OnlinesSettings>();
if (hasApn) if (hasApn)
ApnHelper.ApplyInitConf(apnEnabled, apnHost, StreamDataSettings, useDefaultHostWhenEmpty: true); ApnHelper.ApplyInitConf(apnEnabled, apnHost, StreamDataSettings, useDefaultHostWhenEmpty: true);
ApnHostProvided = hasApn && apnEnabled && !string.IsNullOrWhiteSpace(apnHost);
if (hasApn && apnEnabled) if (hasApn && apnEnabled)
{ {
StreamDataSettings.streamproxy = false; StreamDataSettings.streamproxy = false;