Example #1
0
 public void FromOSD(OSDMap map)
 {
     AuctionStart = map["AuctionStart"];
     Description = map["Description"];
     AuctionLength = map["AuctionLength"];
     foreach(OSD o in (OSDArray)map["AuctionBids"])
     {
         AuctionBid bid = new AuctionBid();
         bid.FromOSD((OSDMap)o);
         AuctionBids.Add(bid);
     }
 }
Example #2
0
 public void FromOSD(OSDMap map)
 {
     AuctionStart  = map["AuctionStart"];
     Description   = map["Description"];
     AuctionLength = map["AuctionLength"];
     foreach (OSD o in (OSDArray)map["AuctionBids"])
     {
         AuctionBid bid = new AuctionBid();
         bid.FromOSD((OSDMap)o);
         AuctionBids.Add(bid);
     }
 }
Example #3
0
        public void AuctionEnd(int LocalID)
        {
            IParcelManagementModule parcelManagement = m_scene.RequestModuleInterface<IParcelManagementModule>();
            if (parcelManagement != null)
            {
                ILandObject landObject = parcelManagement.GetLandObject(LocalID);
                if (landObject == null)
                    return;

                AuctionInfo info = GetAuctionInfo(LocalID);
                AuctionBid highestBid = new AuctionBid() { Amount = 0 };
                foreach (AuctionBid bid in info.AuctionBids)
                    if (highestBid.Amount < bid.Amount)
                        highestBid = bid;

                IOfflineMessagesConnector offlineMessages = Aurora.DataManager.DataManager.RequestPlugin<IOfflineMessagesConnector>();
                if (offlineMessages != null)
                    offlineMessages.AddOfflineMessage(new GridInstantMessage()
                    {
                        binaryBucket = new byte[0],
                        dialog = (byte)InstantMessageDialog.MessageBox,
                        fromAgentID = UUID.Zero,
                        fromAgentName = "System",
                        fromGroup = false,
                        imSessionID = UUID.Random(),
                        message = "You won the auction for the parcel " + landObject.LandData.Name + ", paying " + highestBid.Amount + " for it",
                        offline = 0,
                        ParentEstateID = 0,
                        Position = Vector3.Zero,
                        RegionID = m_scene.RegionInfo.RegionID,
                        timestamp = (uint)Util.UnixTimeSinceEpoch(),
                        toAgentID = highestBid.AuctionBidder
                    });
                landObject.UpdateLandSold(highestBid.AuctionBidder, UUID.Zero, false, landObject.LandData.AuctionID,
                    highestBid.Amount, landObject.LandData.Area);
            }
        }