예제 #1
0
        public override bool TakeAction()
        {
            receipt = GetTransfer.FindReceive(newid);
            if (receipt == null)
            {
                return(false);
            }

            return(true);
        }
예제 #2
0
        public override bool TakeAction()
        {
            if (GetTransfer.ReceiveCount >= 3)
            {
                receipt = TransferItemResult.ReceiveCountOut;
                return(true);
            }

            var receiveTransfer = GetTransfer.FindReceive(id);

            if (receiveTransfer == null)
            {
                receipt = TransferItemResult.Expire;
                return(true);
            }

            if (receiveTransfer.IsReceived)
            {
                receipt = TransferItemResult.Received;
                return(true);
            }

            var sendTransfer = UserHelper.FindUserTransfer(receiveTransfer.Sender).FindSend(id);

            if (sendTransfer.Password.CompareTo(passward) != 0)
            {
                receipt = TransferItemResult.ErrorPassword;
                return(true);
            }

            receiveTransfer.IsReceived = true;
            sendTransfer.IsReceived    = true;

            UserHelper.RewardsItem(Current.UserId, sendTransfer.AppendItem.ID, sendTransfer.AppendItem.Num);

            PushMessageHelper.ReceivedTransferItemNotification(GameSession.Get(receiveTransfer.Sender), id);

            GetTransfer.ReceiveCount++;
            receipt = TransferItemResult.Successfully;

            return(true);
        }