43 lines
1.5 KiB
C#
43 lines
1.5 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 RenameFriendFolderInterlockAction : FriendInterlockBase
|
|
{
|
|
private FriendAttribute m_friend_attrib;
|
|
string m_new_folder_name;
|
|
public RenameFriendFolderInterlockAction(UserBase owner, string myGuid, FriendAttribute friendAttibute, string newFolderName) : base(owner, myGuid, friendAttibute.FriendGuid)
|
|
{
|
|
m_friend_attrib = friendAttibute;
|
|
m_new_folder_name = newFolderName;
|
|
}
|
|
|
|
public override async Task<Result> doAction()
|
|
{
|
|
await Task.CompletedTask;
|
|
|
|
var player = getOwner();
|
|
|
|
var friend_agent_action = player.getEntityAction<FriendAgentAction>();
|
|
|
|
var friend = friend_agent_action.getFriend(getFriendGuid());
|
|
NullReferenceCheckHelper.throwIfNull(friend, () => $"friend is null !!!");
|
|
|
|
var friend_attribute = friend.getEntityAttribute<FriendAttribute>();
|
|
NullReferenceCheckHelper.throwIfNull(friend_attribute, () => $"friend_attribute is null !!!");
|
|
friend_attribute.FolderName = m_new_folder_name;
|
|
friend_attribute.modifiedEntityAttribute();//이것도 안해도될듯
|
|
|
|
return new();
|
|
}
|
|
}
|
|
}
|