You've already forked CC-Framework.BriskGameServer
31 lines
838 B
C#
31 lines
838 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Threading.Tasks;
|
|
|
|
public sealed class BriskConfigModule
|
|
: BriskModuleBase
|
|
{
|
|
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);
|
|
});
|
|
}
|
|
|
|
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 }
|
|
};
|
|
}
|
|
}
|