Ejemplo n.º 1
0
        public void RemoveAuction(Auction auction)
        {
            if (auction == null || !auctions.ContainsKey(auction.AuctionId))
            {
                return;
            }
            auctions.Remove(auction.ItemLowId);
            items.Remove(auction.ItemLowId);
            AuctionMgr instance = Singleton <AuctionMgr> .Instance;
            ItemRecord record   = null;

            if (instance.AuctionItems.ContainsKey(auction.ItemLowId))
            {
                record = instance.AuctionItems[auction.ItemLowId];
                instance.AuctionItems.Remove(auction.ItemLowId);
            }

            ServerApp <RealmServer> .IOQueue.AddMessage(() =>
            {
                if (record != null)
                {
                    record.IsAuctioned = false;
                    record.Save();
                }

                auction.Delete();
            });
        }
Ejemplo n.º 2
0
        public void RemoveAuction(Auction auction)
        {
            if (auction == null)
            {
                return;
            }
            if (!auctions.ContainsKey(auction.AuctionId))
            {
                return;
            }
            auctions.Remove(auction.ItemLowId);
            items.Remove(auction.ItemLowId);
            AuctionMgr mgr    = AuctionMgr.Instance;
            ItemRecord record = null;

            if (mgr.AuctionItems.ContainsKey(auction.ItemLowId))
            {
                record = mgr.AuctionItems[auction.ItemLowId];
                mgr.AuctionItems.Remove(auction.ItemLowId);
            }


            //remove from database
            RealmServer.IOQueue.AddMessage(() => {
                if (record != null)
                {
                    record.IsAuctioned = false;
                    record.Save();
                }
                auction.Delete();
            });
        }