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); } }
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); } }
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 = Framework.Utilities.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, SessionID = 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); } }