Release v0.3.0 lowercase UPM package name

This commit is contained in:
2026-04-11 14:44:13 +08:00
parent 07fc690e67
commit 7a8dd4cea0
142 changed files with 149 additions and 78 deletions

View File

@@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
/// <summary>
/// 动态配置模块。
/// </summary>
public sealed class BriskConfigModule
: BriskModuleBase
{
/// <summary>
/// 获取当前客户端命中的动态配置。
/// </summary>
public async Task<BriskConfigCurrent> GetCurrentAsync()
{
return await ExecutePublicAsync(async context =>
{
var data = await context.HttpClient.GetDataAsync("/config/current", CreateQuery(context), false);
return BriskModelMapper.ToConfigCurrent(data);
});
}
/// <summary>
/// 刷新并重新获取动态配置。
/// </summary>
public Task<BriskConfigCurrent> RefreshAsync()
{
return GetCurrentAsync();
}
private static Dictionary<string, string> CreateQuery(BriskContext context)
{
return new Dictionary<string, string>
{
{ "game_key", context.Options.GameKey },
{ "client_version", context.Options.ClientVersion }
};
}
}