51 lines
1.7 KiB
C#
51 lines
1.7 KiB
C#
using Google.Protobuf.WellKnownTypes;
|
|
using ServerCommon;
|
|
using ServerCommon.Cache;
|
|
using ServerCore; using ServerBase;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace GameServer
|
|
{
|
|
public class DeleteFriendInterlockAction : FriendInterlockBase
|
|
{
|
|
public DeleteFriendInterlockAction(UserBase owner, string myGuid, string deleteGuid) : base(owner, myGuid ,deleteGuid)
|
|
{
|
|
|
|
}
|
|
|
|
public override async Task<Result> doAction()
|
|
{
|
|
var result = new Result();
|
|
|
|
var server_logic = GameServerApp.getServerLogic();
|
|
var owner = getOwner();
|
|
|
|
var friend_agent_action = owner.getEntityAction<FriendAgentAction>();
|
|
NullReferenceCheckHelper.throwIfNull(friend_agent_action, () => $"friend_agent_action is null !!! - {owner.toBasicString()}");
|
|
|
|
var friend_attribute = friend_agent_action.getFriendAttribute(getFriendGuid());
|
|
NullReferenceCheckHelper.throwIfNull(friend_attribute, () => $"friend_attribute is null !!! - {owner.toBasicString()}");
|
|
|
|
friend_attribute.deleteEntityAttribute();
|
|
|
|
var batch = new QueryBatchEx<QueryRunnerWithDocument>(owner, LogActionType.FriendDelete, server_logic.getDynamoDbClient());
|
|
{
|
|
batch.addQuery(new DBQDeleteFriend(getMyGuid(), getFriendGuid()));
|
|
}
|
|
var log_invoker = new DeleteFriendBusinessLog(getMyGuid(), getFriendGuid());
|
|
batch.appendBusinessLog(log_invoker);
|
|
|
|
result = await QueryHelper.sendQueryAndBusinessLog(batch);
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
}
|
|
}
|