release: 1.4.7

This commit is contained in:
2026-04-22 17:44:49 +08:00
parent 79f478dd5f
commit e38e066a2d
37 changed files with 2598 additions and 78 deletions

View File

@@ -11,6 +11,7 @@ public sealed class ToponControllerOptions
public const string SubChannelKey = "topon.sub_channel";
public const string DebugKey = "topon.debug";
public const string DebuggerKeyKey = "topon.debugger_key";
public const string AutoOpenDebuggerUiKey = "topon.auto_open_debugger_ui";
public const string SDKAreaKey = "topon.sdk_area";
public const string LongitudeKey = "topon.longitude";
public const string LatitudeKey = "topon.latitude";
@@ -19,11 +20,21 @@ public sealed class ToponControllerOptions
public const string QueryAreaOnInitKey = "topon.query_area_on_init";
public const string InitCustomMapKey = "topon.custom_map";
public const string RewardedCustomDataKey = "topon.rewarded_custom_data";
public const string RewardedAutoLoadKey = "topon.rewarded_auto_load";
public const string RewardedPrewarmOnInitKey = "topon.rewarded_prewarm_on_init";
public const string RewardedMaxLoadAttemptsKey = "topon.rewarded_max_load_attempts";
public const string RewardedLoadRetryDelayMsKey = "topon.rewarded_load_retry_delay_ms";
public const string InterstitialAutoLoadKey = "topon.interstitial_auto_load";
public const string InterstitialPrewarmOnInitKey = "topon.interstitial_prewarm_on_init";
public const string InterstitialMaxLoadAttemptsKey = "topon.interstitial_max_load_attempts";
public const string InterstitialLoadRetryDelayMsKey = "topon.interstitial_load_retry_delay_ms";
public const string LocalStrategyAssetPathKey = "topon.local_strategy_asset_path";
public string Channel { get; set; }
public string SubChannel { get; set; }
public bool? Debug { get; set; }
public string DebuggerKey { get; set; }
public bool AutoOpenDebuggerUI { get; set; }
public int? SDKArea { get; set; }
public double? Longitude { get; set; }
public double? Latitude { get; set; }
@@ -34,6 +45,15 @@ public sealed class ToponControllerOptions
public Dictionary<string, string> RewardedCustomData { get; set; }
public Action<string> OnAreaReceived { get; set; }
public Action<string> OnAreaError { get; set; }
public bool RewardedAutoLoad { get; set; } = true;
public bool RewardedPrewarmOnInit { get; set; } = true;
public int RewardedMaxLoadAttempts { get; set; } = 3;
public int RewardedLoadRetryDelayMs { get; set; } = 1000;
public bool InterstitialAutoLoad { get; set; } = true;
public bool InterstitialPrewarmOnInit { get; set; } = true;
public int InterstitialMaxLoadAttempts { get; set; } = 2;
public int InterstitialLoadRetryDelayMs { get; set; } = 500;
public string LocalStrategyAssetPath { get; set; }
public static ToponControllerOptions Resolve(ADConfig adConfig, object[] args)
{
@@ -85,6 +105,7 @@ public sealed class ToponControllerOptions
SubChannel = GetString(map, SubChannelKey, "sub_channel") ?? SubChannel;
Debug = GetBool(map, DebugKey, "debug") ?? Debug;
DebuggerKey = GetString(map, DebuggerKeyKey) ?? DebuggerKey;
AutoOpenDebuggerUI = GetBool(map, AutoOpenDebuggerUiKey) ?? AutoOpenDebuggerUI;
SDKArea = GetInt(map, SDKAreaKey) ?? SDKArea;
Longitude = GetDouble(map, LongitudeKey) ?? Longitude;
Latitude = GetDouble(map, LatitudeKey) ?? Latitude;
@@ -93,6 +114,15 @@ public sealed class ToponControllerOptions
QueryAreaOnInit = GetBool(map, QueryAreaOnInitKey) ?? QueryAreaOnInit;
InitCustomMap = MergeMaps(InitCustomMap, GetPrefixedMap(map, InitCustomMapKey + "."));
RewardedCustomData = MergeMaps(RewardedCustomData, GetPrefixedMap(map, RewardedCustomDataKey + "."));
RewardedAutoLoad = GetBool(map, RewardedAutoLoadKey) ?? RewardedAutoLoad;
RewardedPrewarmOnInit = GetBool(map, RewardedPrewarmOnInitKey) ?? RewardedPrewarmOnInit;
RewardedMaxLoadAttempts = GetInt(map, RewardedMaxLoadAttemptsKey) ?? RewardedMaxLoadAttempts;
RewardedLoadRetryDelayMs = GetInt(map, RewardedLoadRetryDelayMsKey) ?? RewardedLoadRetryDelayMs;
InterstitialAutoLoad = GetBool(map, InterstitialAutoLoadKey) ?? InterstitialAutoLoad;
InterstitialPrewarmOnInit = GetBool(map, InterstitialPrewarmOnInitKey) ?? InterstitialPrewarmOnInit;
InterstitialMaxLoadAttempts = GetInt(map, InterstitialMaxLoadAttemptsKey) ?? InterstitialMaxLoadAttempts;
InterstitialLoadRetryDelayMs = GetInt(map, InterstitialLoadRetryDelayMsKey) ?? InterstitialLoadRetryDelayMs;
LocalStrategyAssetPath = GetString(map, LocalStrategyAssetPathKey) ?? LocalStrategyAssetPath;
}
private void ApplyLegacyArgs(object[] args)
@@ -124,6 +154,7 @@ public sealed class ToponControllerOptions
SubChannel = explicitOptions.SubChannel ?? SubChannel;
Debug = explicitOptions.Debug ?? Debug;
DebuggerKey = explicitOptions.DebuggerKey ?? DebuggerKey;
AutoOpenDebuggerUI = explicitOptions.AutoOpenDebuggerUI || AutoOpenDebuggerUI;
SDKArea = explicitOptions.SDKArea ?? SDKArea;
Longitude = explicitOptions.Longitude ?? Longitude;
Latitude = explicitOptions.Latitude ?? Latitude;
@@ -174,6 +205,7 @@ public sealed class ToponControllerOptions
SubChannel = GetString(map, SubChannelKey, "sub_channel") ?? SubChannel;
Debug = GetBool(map, DebugKey, "debug") ?? Debug;
DebuggerKey = GetString(map, DebuggerKeyKey) ?? DebuggerKey;
AutoOpenDebuggerUI = GetBool(map, AutoOpenDebuggerUiKey) ?? AutoOpenDebuggerUI;
SDKArea = GetInt(map, SDKAreaKey) ?? SDKArea;
Longitude = GetDouble(map, LongitudeKey) ?? Longitude;
Latitude = GetDouble(map, LatitudeKey) ?? Latitude;
@@ -182,6 +214,15 @@ public sealed class ToponControllerOptions
QueryAreaOnInit = GetBool(map, QueryAreaOnInitKey) ?? QueryAreaOnInit;
InitCustomMap = MergeMaps(InitCustomMap, GetPrefixedMap(map, InitCustomMapKey + "."));
RewardedCustomData = MergeMaps(RewardedCustomData, GetPrefixedMap(map, RewardedCustomDataKey + "."));
RewardedAutoLoad = GetBool(map, RewardedAutoLoadKey) ?? RewardedAutoLoad;
RewardedPrewarmOnInit = GetBool(map, RewardedPrewarmOnInitKey) ?? RewardedPrewarmOnInit;
RewardedMaxLoadAttempts = GetInt(map, RewardedMaxLoadAttemptsKey) ?? RewardedMaxLoadAttempts;
RewardedLoadRetryDelayMs = GetInt(map, RewardedLoadRetryDelayMsKey) ?? RewardedLoadRetryDelayMs;
InterstitialAutoLoad = GetBool(map, InterstitialAutoLoadKey) ?? InterstitialAutoLoad;
InterstitialPrewarmOnInit = GetBool(map, InterstitialPrewarmOnInitKey) ?? InterstitialPrewarmOnInit;
InterstitialMaxLoadAttempts = GetInt(map, InterstitialMaxLoadAttemptsKey) ?? InterstitialMaxLoadAttempts;
InterstitialLoadRetryDelayMs = GetInt(map, InterstitialLoadRetryDelayMsKey) ?? InterstitialLoadRetryDelayMs;
LocalStrategyAssetPath = GetString(map, LocalStrategyAssetPathKey) ?? LocalStrategyAssetPath;
}
private static string GetString(IDictionary<string, string> map, params string[] keys)