34 lines
1.4 KiB
C#
34 lines
1.4 KiB
C#
using Google.Protobuf;
|
|
using Google.Protobuf.WellKnownTypes;
|
|
|
|
|
|
using ServerCore;
|
|
using ServerBase;
|
|
using ServerCommon;
|
|
using ServerCommon.BusinessLogDomain;
|
|
using MetaAssets;
|
|
|
|
|
|
namespace GameServer.PacketHandler;
|
|
|
|
[PacketHandler("allgameserver", typeof(ServerMessage.Types.GS2GS_NTF_CHANGE_CALIUM_STORAGE_INFO), typeof(NtfChangeCaliumStorageInfoMQPacketHandler), typeof(RabbitMQ4Game))]
|
|
public class NtfChangeCaliumStorageInfoMQPacketHandler : PacketRecvHandler
|
|
{
|
|
public override async Task<Result> onProcessPacket(ISession session, IMessage recvMessage)
|
|
{
|
|
var server_logic = GameServerApp.getServerLogic();
|
|
var rabbitMq = server_logic.getRabbitMqConnector() as RabbitMqConnector;
|
|
NullReferenceCheckHelper.throwIfNull(rabbitMq, () => "rabbitMq is null !!!");
|
|
|
|
var msg = recvMessage as ServerMessage;
|
|
ArgumentNullException.ThrowIfNull(msg);
|
|
|
|
var calium_storage_entity = server_logic.findGlobalEntity<CaliumStorageEntity>();
|
|
NullReferenceCheckHelper.throwIfNull(calium_storage_entity, () => "calium_storage_entity is null !!!");
|
|
|
|
var calium_storage_action = calium_storage_entity.getEntityAction<CaliumStorageAction>();
|
|
NullReferenceCheckHelper.throwIfNull(calium_storage_action, () => $"calium_storage_action is null !!! - {calium_storage_entity.toBasicString()}");
|
|
|
|
return await calium_storage_action.loadStorageAttribute();
|
|
}
|
|
} |