예제 #1
0
        public bool Receive()
        {
            if (!Sent)
            {
                return(false);       //mail not sent yet
            }
            if (RecipientInfo == null)
            {
                RecipientInfo = Envir.GetCharacterInfo(RecipientIndex);

                if (RecipientInfo == null)
                {
                    return(false);
                }
            }

            RecipientInfo.Mail.Add(this); //add to players inbox

            if (RecipientInfo.Player != null)
            {
                RecipientInfo.Player.NewMail = true; //notify player of new mail  --check in player process
            }

            Envir.Mail.Remove(this); //remove from postbox

            return(true);
        }
예제 #2
0
        public void Send()
        {
            if (Sent)
            {
                return;
            }

            Collected = true;

            if (Parcel)
            {
                if (Items.Count > 0 && Gold > 0)
                {
                    if (!Settings.MailAutoSendGold || !Settings.MailAutoSendItems)
                    {
                        Collected = false;
                    }
                }
                if (Items.Count > 0)
                {
                    if (!Settings.MailAutoSendItems)
                    {
                        Collected = false;
                    }
                }
                else
                {
                    if (!Settings.MailAutoSendGold)
                    {
                        Collected = false;
                    }
                }
            }

            if (RecipientInfo == null)
            {
                RecipientInfo = Envir.GetCharacterInfo(RecipientIndex);
            }

            RecipientInfo.Mail.Add(this); //add to players inbox

            if (RecipientInfo.Player != null)
            {
                RecipientInfo.Player.NewMail = true; //notify player of new mail  --check in player process
            }

            DateSent = Envir.Now;
        }