59 lines
1.9 KiB
C#
59 lines
1.9 KiB
C#
using Google.Protobuf;
|
|
using Google.Protobuf.WellKnownTypes;
|
|
|
|
|
|
using ServerCore;
|
|
using ServerBase;
|
|
using ServerCommon;
|
|
using ServerCommon.BusinessLogDomain;
|
|
using MetaAssets;
|
|
|
|
|
|
|
|
namespace GameServer;
|
|
|
|
public class ReplyFriendRequestLockAction : FriendInterlockBase
|
|
{
|
|
private Int32 m_reply_type = 1;
|
|
public ReplyFriendRequestLockAction(UserBase owner, string myGuid, string friendGuid, int replyType) : base(owner, myGuid, friendGuid)
|
|
{
|
|
m_reply_type = replyType;
|
|
}
|
|
|
|
public override async Task<Result> doAction()
|
|
{
|
|
var server_logic = GameServerApp.getServerLogic();
|
|
var action = getOwner().getEntityAction<ReplyReceivedFriendRequestAction>();
|
|
|
|
var result = await action.replyReceivedFriendRequest(getMyGuid(), getFriendGuid(), m_reply_type);
|
|
if (result.isFail()) return result;
|
|
|
|
//거절은 딱히 DB 수정할것 없다.
|
|
if(m_reply_type == (int)FriendRequestReplyType.Accept)
|
|
{
|
|
var batch = new QueryBatchEx<QueryRunnerWithDocument>(getOwner(), LogActionType.FriendAdd, server_logic.getDynamoDbClient());
|
|
{
|
|
batch.addQuery(new DBQAddFriend(getOwner().getUserGuid(), getFriendGuid()));
|
|
}
|
|
var log_invoker = new AddFriendBusinessLog(getOwner().getUserGuid(), getFriendGuid());
|
|
batch.appendBusinessLog(log_invoker);
|
|
|
|
result = await QueryHelper.sendQueryAndBusinessLog(batch);
|
|
}
|
|
|
|
//거절 로그
|
|
if (m_reply_type == (int)FriendRequestReplyType.Refuse)
|
|
{
|
|
//log
|
|
List<ILogInvoker> invokers = new List<ILogInvoker>();
|
|
invokers.Add(new RefuseFriendRequestBusinessLog(getMyGuid(), getFriendGuid()));
|
|
var log_action = new LogActionEx(LogActionType.RefuseFriendRequest);
|
|
BusinessLogger.collectLogs(log_action, getOwner(), invokers);
|
|
}
|
|
|
|
return result;
|
|
}
|
|
}
|
|
|
|
|