Exemplo n.º 1
0
        public void OnMarketDeleteItem(Packets.Client.MarketDeleteItem p)
        {
            /*
             * Expected packets:
             * SMSG_MarketDelete
             *
             * Additional expected packet:
             * SMSG_NewMailRecieved
             *
             * Approach: check if the selected itemid still exists in the database
             * if so send marketdelete packet with a 0 reason (successfull) and a new mail message
             *
             * If it fails you'ld need to send it with a failure reason, no clue which id's it are
             */
            uint            id   = p.GetItemId();
            MarketplaceItem item = MapServer.charDB.GetMarketItem(id);

            Packets.Server.MarketDeleteIem p1 = new SagaMap.Packets.Server.MarketDeleteIem();
            if (item == null)
            {
                p1.SetReason(1);
                this.netIO.SendPacket(p1, this.SessionID);
                return;
            }
            MapServer.charDB.DeleteMarketItem(item);
            Mail mail = new Mail();

            mail.content = "You've canceled a registered Auction at <Regenbogen> Market Place" +
                           ".\n  Here is the item you've handed to us.\n We are looking forward to see you at <Regenbogen> again!";
            mail.date       = DateTime.Now;
            mail.read       = 0;
            mail.receiver   = this.Char.Name;
            mail.sender     = "<Regenbogen>";
            mail.topic      = "You've canceled an auction at <Regenbogen>";
            mail.valid      = 30;
            mail.creator    = "";
            mail.durability = item.item.durability;
            mail.item       = (uint)item.item.id;
            mail.stack      = item.item.stack;
            MapServer.charDB.NewMail(mail);
            this.CheckNewMail();
            p1.SetReason(0);
            this.netIO.SendPacket(p1, this.SessionID);
        }
Exemplo n.º 2
0
 public void OnMarketDeleteItem(Packets.Client.MarketDeleteItem p)
 {
     /*
      * Expected packets:
      * SMSG_MarketDelete
      *
      * Additional expected packet:
      * SMSG_NewMailRecieved
      *
      * Approach: check if the selected itemid still exists in the database
      * if so send marketdelete packet with a 0 reason (successfull) and a new mail message
      *
      * If it fails you'ld need to send it with a failure reason, no clue which id's it are
      */
     uint id = p.GetItemId();
     MarketplaceItem item = MapServer.charDB.GetMarketItem(id);
     Packets.Server.MarketDeleteIem p1 = new SagaMap.Packets.Server.MarketDeleteIem();
     if (item == null)
     {
         p1.SetReason(1);
         this.netIO.SendPacket(p1, this.SessionID);
         return;
     }
     MapServer.charDB.DeleteMarketItem(item);
     Mail mail = new Mail();
     mail.content = "You've canceled a registered Auction at <Regenbogen> Market Place" +
          ".\n  Here is the item you've handed to us.\n We are looking forward to see you at <Regenbogen> again!";
     mail.date = DateTime.Now;
     mail.read = 0;
     mail.receiver = this.Char.Name;
     mail.sender = "<Regenbogen>";
     mail.topic = "You've canceled an auction at <Regenbogen>";
     mail.valid = 30;
     mail.creator = "";
     mail.durability = item.item.durability;
     mail.item = (uint)item.item.id;
     mail.stack = item.item.stack;
     MapServer.charDB.NewMail(mail);
     this.CheckNewMail();
     p1.SetReason(0);
     this.netIO.SendPacket(p1, this.SessionID);
 }