초기커밋
This commit is contained in:
62
GameServer/Entity/CaliumStorage/Action/CaliumWeb3Action.cs
Normal file
62
GameServer/Entity/CaliumStorage/Action/CaliumWeb3Action.cs
Normal file
@@ -0,0 +1,62 @@
|
||||
using Google.Protobuf;
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
using ServerCommon;
|
||||
using ServerCommon.BusinessLogDomain;
|
||||
using MetaAssets;
|
||||
|
||||
|
||||
namespace GameServer;
|
||||
|
||||
public class CaliumWeb3Action : EntityActionBase
|
||||
{
|
||||
private readonly EchoSystemRequester m_echo_requester;
|
||||
public const string SERVER_TYPE = "caliverse";
|
||||
|
||||
public CaliumWeb3Action(CaliumStorageEntity owner) : base(owner)
|
||||
{
|
||||
var server_logic = GameServerApp.getServerLogic();
|
||||
var server_config = server_logic.getServerConfig();
|
||||
|
||||
var ip = AwsHelper.getAwsPublicIPv4OrEthernetIPv4();
|
||||
var port = server_config.getAppParamPort();
|
||||
|
||||
m_echo_requester = new EchoSystemRequester(server_config.EchoSystemConfig.BaseAddress, server_logic.getServerName(), $"{ip}.{port}", server_config.EchoSystemConfig.SlackAddress);
|
||||
}
|
||||
|
||||
public override async Task<Result> onInit() => await Task.FromResult(new Result());
|
||||
|
||||
public override void onClear() {}
|
||||
|
||||
public async Task<(Result result, CaliumRollUpResponse? response)> getDailyRollUpDataAsync(int epoch)
|
||||
{
|
||||
if (epoch > 0)
|
||||
{
|
||||
return await m_echo_requester.getDailyRollUpData(epoch);
|
||||
}
|
||||
|
||||
var current_pivot_date = CaliumStorageHelper.CurrentPivotTimeDate();
|
||||
|
||||
// 1일을 감소한 이유 : create_time 이 전일 23:00:00 ~ 23:59:59 에 생성되기 때문
|
||||
current_pivot_date = current_pivot_date.AddDays(-1);
|
||||
return await m_echo_requester.getDailyRollUpData(current_pivot_date);
|
||||
}
|
||||
|
||||
public async Task<(Result result, ConverterSyncResponse? response)> getConverterSyncDataAsync()
|
||||
{
|
||||
return await m_echo_requester.getConverterSyncData();
|
||||
}
|
||||
|
||||
public async Task<(Result result, CaliumEventResponse? response)> postCaliumEvent(CaliumEventRequest data)
|
||||
{
|
||||
return await m_echo_requester.postCaliumEvent(data);
|
||||
}
|
||||
|
||||
public async Task<Result> checkWeb3Connection()
|
||||
{
|
||||
return await m_echo_requester.checkWeb3Connection();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user