From b59ebf7341ed92680275e4ccdfd9a960b7b71ab5 Mon Sep 17 00:00:00 2001 From: Jim Radford Date: Sun, 8 Jun 2008 19:28:24 +0000 Subject: [PATCH] LIBOMV-262 Adds public method to parcel manager ReleaseParcel to abandon a parcel of land. git-svn-id: http://libopenmetaverse.googlecode.com/svn/trunk@1897 52acb1d6-8a22-11de-b505-999d5b087335 --- libsecondlife/ParcelManager.cs | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/libsecondlife/ParcelManager.cs b/libsecondlife/ParcelManager.cs index c844560b..45605548 100644 --- a/libsecondlife/ParcelManager.cs +++ b/libsecondlife/ParcelManager.cs @@ -846,7 +846,7 @@ namespace libsecondlife { if (refresh) { - lock (simulator.ParcelMap) + //lock (simulator.ParcelMap) for (int y = 0; y < 64; y++) for (int x = 0; x < 64; x++) simulator.ParcelMap[y, x] = 0; @@ -1253,6 +1253,21 @@ namespace libsecondlife Client.Network.SendPacket(frz); } + + /// + /// Abandon a parcel of land + /// + /// Simulator parcel is in + /// Simulator local ID of parcel + public void ReleaseParcel(Simulator simulator, int localID) + { + ParcelReleasePacket abandon = new ParcelReleasePacket(); + abandon.AgentData.AgentID = Client.Self.AgentID; + abandon.AgentData.SessionID = Client.Self.SessionID; + abandon.Data.LocalID = localID; + + Client.Network.SendPacket(abandon, simulator); + } #endregion Public Methods #region Packet Handlers @@ -1338,7 +1353,7 @@ namespace libsecondlife parcel.ClaimDate = Helpers.UnixTimeToDateTime((uint)parcelDataBlock["ClaimDate"].AsInteger()); parcel.ClaimPrice = parcelDataBlock["ClaimPrice"].AsInteger(); parcel.Desc = parcelDataBlock["Desc"].AsString(); - + // TODO: this probably needs to happen when the packet is deserialized. byte[] bytes = parcelDataBlock["ParcelFlags"].AsBinary(); if (BitConverter.IsLittleEndian)