Exemple #1
0
        private static void Add(this MabiPacket packet, MabiMail mail)
        {
            packet.PutLong(mail.MessageId);
            packet.PutByte(mail.Type);
            packet.PutByte(mail.Read);
            packet.PutLong(mail.Sent);
            packet.PutString(mail.SenderName);
            packet.PutString(mail.RecipientName);
            packet.PutString(mail.Text);
            packet.PutLong(mail.ItemId);

            if (mail.ItemId != 0)
            {
                packet.PutInt(mail.COD);

                var item = WorldDb.Instance.GetItem(mail.ItemId);
                packet.AddItemInfo(item, ItemPacketType.Private);
            }
        }
Exemple #2
0
 public void Return(string format, params object[] args)
 {
     MabiMail m = new MabiMail();
     m.COD = 0;
     m.ItemId = this.ItemId;
     m.SenderId = this.RecipientId;
     m.SenderName = this.RecipientName;
     m.RecipientId = this.SenderId;
     m.RecipientName = this.SenderName;
     m.Text = string.Format(format, args);
     m.Type = (byte)MailTypes.Return;
     this.Delete();
     m.Save(true);
 }
Exemple #3
0
        public static void SendMailResponse(WorldClient client, MabiMail mail)
        {
            var packet = new MabiPacket(Op.SendMailR, client.Character.Id);
            if (mail != null)
            {
                packet.PutByte(true);
                packet.Add(mail);
            }
            else
            {
                packet.PutByte(false);
            }

            client.Send(packet);
        }