Example #1
0
        public override bool TakeAction()
        {
            PlayerFriendsLogic pf = new PlayerFriendsLogic();

            if (!pf.DeleteFriend(m_UserId, m_RequestPacket.PlayerId))
            {
                ErrorCode = (int)ErrorType.CannotOpenChance;
                ErrorInfo = "You don't have this friend";
                return(false);
            }
            var target = GameSession.Get(m_RequestPacket.PlayerId);

            if (target != null)
            {
                LCDeleteFriend sendPost = new LCDeleteFriend()
                {
                    DeletedPlayerId = m_UserId,
                    IsActive        = false
                };
                byte[] buffer = CustomActionDispatcher.GeneratePackageStream(3104, ProtoBufUtils.Serialize(sendPost));
                target.SendAsync(buffer, 0, buffer.Length);
            }


            m_ResponsePacket.DeletedPlayerId = m_RequestPacket.PlayerId;
            m_ResponsePacket.IsActive        = true;
            return(true);
        }
Example #2
0
 public Action3104(ActionGetter actionGetter)
     : base((short)3104, actionGetter)
 {
     m_RequestPacket  = null;
     m_ResponsePacket = new LCDeleteFriend();
     m_UserId         = 0;
 }