Esempio n. 1
0
        private void Parcels_OnParcelProperties(Parcel parcel, ParcelManager.ParcelResult result, int sequenceID,
            bool snapSelection)
        {
            // Check if this is for a simulator we're concerned with
            if (!active_sims.Contains(parcel.Simulator)) return;

            // Warn about parcel property request errors and bail out
            if (result == ParcelManager.ParcelResult.NoData)
            {
                Client.Log("ParcelDownloader received a NoData response, sequenceID " + sequenceID,
                    Helpers.LogLevel.Warning);
                return;
            }

            // Warn about unexpected data and bail out
            if (!ParcelMarked.ContainsKey(parcel.Simulator))
            {
                Client.Log("ParcelDownloader received unexpected parcel data for " + parcel.Simulator,
                    Helpers.LogLevel.Warning);
                return;
            }

            int x, y, index, bit;
            int[,] markers = ParcelMarked[parcel.Simulator];

            // Add this parcel to the dictionary of LocalID -> Parcel mappings
            lock (Parcels[parcel.Simulator])
                if (!Parcels[parcel.Simulator].ContainsKey(parcel.LocalID))
                    Parcels[parcel.Simulator][parcel.LocalID] = parcel;

            // Request the access list for this parcel
            Client.Parcels.AccessListRequest(parcel.Simulator, parcel.LocalID, 
                ParcelManager.AccessList.Both, 0);

            // Mark this area as downloaded
            for (y = 0; y < 64; y++)
            {
                for (x = 0; x < 64; x++)
                {
                    if (markers[y, x] == 0)
                    {
                        index = (y * 64) + x;
                        bit = index % 8;
                        index >>= 3;

                        if ((parcel.Bitmap[index] & (1 << bit)) != 0)
                            markers[y, x] = parcel.LocalID;
                    }
                }
            }

            // Request parcel information for the next missing area
            for (y = 0; y < 64; y++)
            {
                for (x = 0; x < 64; x++)
                {
                    if (markers[y, x] == 0)
                    {
                        Client.Parcels.PropertiesRequest(parcel.Simulator,
                                                         (y + 1) * 4.0f, (x + 1) * 4.0f,
                                                         y * 4.0f, x * 4.0f, 0, false);

                        return;
                    }
                }
            }

            // If we get here, there are no more zeroes in the markers map
            lock (active_sims)
            {
                active_sims.Remove(parcel.Simulator);

                if (OnParcelsDownloaded != null)
                {
                    // This map is complete, fire callback
                    try { OnParcelsDownloaded(parcel.Simulator, Parcels[parcel.Simulator], markers); }
                    catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
                }
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Search Places - All Options
        /// </summary>
        /// <param name="findFlags">One of the Values from the DirFindFlags struct, ie: AgentOwned, GroupOwned, etc.</param>
        /// <param name="searchCategory">One of the values from the SearchCategory Struct, ie: Any, Linden, Newcomer</param>
        /// <param name="searchText">String Text to search for</param>
        /// <param name="simulatorName">String Simulator Name to search in</param>
        /// <param name="groupID">LLUID of group you want to recieve results for</param>
        /// <param name="transactionID">Transaction (Query) ID which can be associated with results from your request.</param>
        /// <returns>Transaction (Query) ID which can be associated with results from your request.</returns>
        public LLUUID StartPlacesSearch(DirFindFlags findFlags, Parcel.ParcelCategory searchCategory, string searchText, string simulatorName, LLUUID groupID, LLUUID transactionID)
        {
            PlacesQueryPacket find = new PlacesQueryPacket();
            find.AgentData.AgentID = Client.Self.AgentID;
            find.AgentData.SessionID = Client.Self.SessionID;
            find.AgentData.QueryID = groupID;

            find.TransactionData.TransactionID = transactionID;

            find.QueryData.QueryText = Helpers.StringToField(searchText);
            find.QueryData.QueryFlags = (uint)findFlags;
            find.QueryData.Category = (sbyte)searchCategory;
            find.QueryData.SimName = Helpers.StringToField(simulatorName);
            
            Client.Network.SendPacket(find);
            return transactionID;
        }
Esempio n. 3
0
        private void ParcelPropertiesHandler(Packet packet, Simulator simulator)
        {
            if (OnParcelProperties != null || Client.Settings.PARCEL_TRACKING == true)
            {
                ParcelPropertiesPacket properties = (ParcelPropertiesPacket)packet;

                Parcel parcel = new Parcel(simulator, properties.ParcelData.LocalID);

                parcel.AABBMax = properties.ParcelData.AABBMax;
                parcel.AABBMin = properties.ParcelData.AABBMin;
                parcel.Area = properties.ParcelData.Area;
                parcel.AuctionID = properties.ParcelData.AuctionID;
                parcel.AuthBuyerID = properties.ParcelData.AuthBuyerID;
                parcel.Bitmap = properties.ParcelData.Bitmap;
                parcel.Category = (Parcel.ParcelCategory)(sbyte)properties.ParcelData.Category;
                parcel.ClaimDate = Helpers.UnixTimeToDateTime((uint)properties.ParcelData.ClaimDate);
                // ClaimPrice seems to always be zero?
                parcel.ClaimPrice = properties.ParcelData.ClaimPrice;
                parcel.Desc = Helpers.FieldToUTF8String(properties.ParcelData.Desc);
                parcel.GroupID = properties.ParcelData.GroupID;
                parcel.GroupPrims = properties.ParcelData.GroupPrims;
                parcel.IsGroupOwned = properties.ParcelData.IsGroupOwned;
                parcel.LandingType = properties.ParcelData.LandingType;
                parcel.MaxPrims = properties.ParcelData.MaxPrims;
                parcel.MediaAutoScale = properties.ParcelData.MediaAutoScale;
                parcel.MediaID = properties.ParcelData.MediaID;
                parcel.MediaURL = Helpers.FieldToUTF8String(properties.ParcelData.MediaURL);
                parcel.MusicURL = Helpers.FieldToUTF8String(properties.ParcelData.MusicURL);
                parcel.Name = Helpers.FieldToUTF8String(properties.ParcelData.Name);
                parcel.OtherCleanTime = properties.ParcelData.OtherCleanTime;
                parcel.OtherCount = properties.ParcelData.OtherCount;
                parcel.OtherPrims = properties.ParcelData.OtherPrims;
                parcel.OwnerID = properties.ParcelData.OwnerID;
                parcel.OwnerPrims = properties.ParcelData.OwnerPrims;
                parcel.Flags = (Parcel.ParcelFlags)properties.ParcelData.ParcelFlags;
                parcel.ParcelPrimBonus = properties.ParcelData.ParcelPrimBonus;
                parcel.PassHours = properties.ParcelData.PassHours;
                parcel.PassPrice = properties.ParcelData.PassPrice;
                parcel.PublicCount = properties.ParcelData.PublicCount;
                parcel.RegionDenyAnonymous = properties.ParcelData.RegionDenyAnonymous;
                parcel.RegionDenyIdentified = properties.ParcelData.RegionDenyIdentified;
                parcel.RegionDenyTransacted = properties.ParcelData.RegionDenyTransacted;
                parcel.RegionPushOverride = properties.ParcelData.RegionPushOverride;
                parcel.RentPrice = properties.ParcelData.RentPrice;
                parcel.SalePrice = properties.ParcelData.SalePrice;
                parcel.SelectedPrims = properties.ParcelData.SelectedPrims;
                parcel.SelfCount = properties.ParcelData.SelfCount;
                parcel.SimWideMaxPrims = properties.ParcelData.SimWideMaxPrims;
                parcel.SimWideTotalPrims = properties.ParcelData.SimWideTotalPrims;
                parcel.SnapshotID = properties.ParcelData.SnapshotID;
                parcel.Status = (Parcel.ParcelStatus)(sbyte)properties.ParcelData.Status;
                parcel.TotalPrims = properties.ParcelData.TotalPrims;
                parcel.UserLocation = properties.ParcelData.UserLocation;
                parcel.UserLookAt = properties.ParcelData.UserLookAt;
                // store parcel in dictionary
                if (Client.Settings.PARCEL_TRACKING)
                {
                    lock (simulator.Parcels.Dictionary)
                        simulator.Parcels.Dictionary[parcel.LocalID] = parcel;

                    int y, x, index, bit;
                    for (y = 0; y < simulator.ParcelMap.GetLength(0); y++)
                    {
                        for (x = 0; x < simulator.ParcelMap.GetLength(1); x++)
                        {
                            if (simulator.ParcelMap[y, x] == 0)
                            {
                                index = (y * 64) + x;
                                bit = index % 8;
                                index >>= 3;

                                if ((parcel.Bitmap[index] & (1 << bit)) != 0)
                                    simulator.ParcelMap[y, x] = parcel.LocalID;
                            }
                        }

                    }
                }

                  // Fire the callback for parcel properties being received
                if (OnParcelProperties != null)
                {
                    try
                    {
                        OnParcelProperties(parcel, (ParcelResult)properties.ParcelData.RequestResult,
                            properties.ParcelData.SequenceID, properties.ParcelData.SnapSelection);
                    }
                    catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
                }

                // Check if all of the simulator parcels have been retrieved, if so fire another callback
                if (OnSimParcelsDownloaded != null && simulator.IsParcelMapFull())
                {
                    try { OnSimParcelsDownloaded(simulator, simulator.Parcels, simulator.ParcelMap); }
                    catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
                }
            }
        }
Esempio n. 4
0
 /// <summary>
 ///  Search Places 
 /// </summary>
 /// <param name="findFlags">One of the Values from the DirFindFlags struct, ie: AgentOwned, GroupOwned, etc.</param>
 /// <param name="searchCategory">One of the values from the SearchCategory Struct, ie: Any, Linden, Newcomer</param>
 /// <param name="groupID">LLUID of group you want to recieve results for</param>
 /// <param name="transactionID">Transaction (Query) ID which can be associated with results from your request.</param>
 /// <returns>Transaction (Query) ID which can be associated with results from your request.</returns>
 public LLUUID StartPlacesSearch(DirFindFlags findFlags, Parcel.ParcelCategory searchCategory, LLUUID groupID, LLUUID transactionID)
 {
     return StartPlacesSearch(findFlags, searchCategory, String.Empty, String.Empty, groupID, transactionID);
 }
Esempio n. 5
0
        private void ParcelPropertiesHandler(Packet packet, Simulator simulator)
        {
            if (OnParcelProperties != null)
            {
                ParcelPropertiesPacket properties = (ParcelPropertiesPacket)packet;

                Parcel parcel = new Parcel(simulator, properties.ParcelData.LocalID);

                parcel.AABBMax = properties.ParcelData.AABBMax;
                parcel.AABBMin = properties.ParcelData.AABBMin;
                parcel.Area = properties.ParcelData.Area;
                parcel.AuctionID = properties.ParcelData.AuctionID;
                parcel.AuthBuyerID = properties.ParcelData.AuthBuyerID;
                parcel.Bitmap = properties.ParcelData.Bitmap;
                parcel.Category = (Parcel.ParcelCategory)(sbyte)properties.ParcelData.Category;
                parcel.ClaimDate = Helpers.UnixTimeToDateTime((uint)properties.ParcelData.ClaimDate);
                // ClaimPrice seems to always be zero?
                parcel.ClaimPrice = properties.ParcelData.ClaimPrice;
                parcel.Desc = Helpers.FieldToUTF8String(properties.ParcelData.Desc);
                parcel.GroupID = properties.ParcelData.GroupID;
                parcel.GroupPrims = properties.ParcelData.GroupPrims;
                parcel.IsGroupOwned = properties.ParcelData.IsGroupOwned;
                parcel.LandingType = properties.ParcelData.LandingType;
                parcel.MaxPrims = properties.ParcelData.MaxPrims;
                parcel.MediaAutoScale = properties.ParcelData.MediaAutoScale;
                parcel.MediaID = properties.ParcelData.MediaID;
                parcel.MediaURL = Helpers.FieldToUTF8String(properties.ParcelData.MediaURL);
                parcel.MusicURL = Helpers.FieldToUTF8String(properties.ParcelData.MusicURL);
                parcel.Name = Helpers.FieldToUTF8String(properties.ParcelData.Name);
                parcel.OtherCleanTime = properties.ParcelData.OtherCleanTime;
                parcel.OtherCount = properties.ParcelData.OtherCount;
                parcel.OtherPrims = properties.ParcelData.OtherPrims;
                parcel.OwnerID = properties.ParcelData.OwnerID;
                parcel.OwnerPrims = properties.ParcelData.OwnerPrims;
                parcel.Flags = (Parcel.ParcelFlags)properties.ParcelData.ParcelFlags;
                parcel.ParcelPrimBonus = properties.ParcelData.ParcelPrimBonus;
                parcel.PassHours = properties.ParcelData.PassHours;
                parcel.PassPrice = properties.ParcelData.PassPrice;
                parcel.PublicCount = properties.ParcelData.PublicCount;
                parcel.RegionDenyAnonymous = properties.ParcelData.RegionDenyAnonymous;
                parcel.RegionDenyIdentified = properties.ParcelData.RegionDenyIdentified;
                parcel.RegionDenyTransacted = properties.ParcelData.RegionDenyTransacted;
                parcel.RegionPushOverride = properties.ParcelData.RegionPushOverride;
                parcel.RentPrice = properties.ParcelData.RentPrice;
                parcel.SalePrice = properties.ParcelData.SalePrice;
                parcel.SelectedPrims = properties.ParcelData.SelectedPrims;
                parcel.SelfCount = properties.ParcelData.SelfCount;
                parcel.SimWideMaxPrims = properties.ParcelData.SimWideMaxPrims;
                parcel.SimWideTotalPrims = properties.ParcelData.SimWideTotalPrims;
                parcel.SnapshotID = properties.ParcelData.SnapshotID;
                parcel.Status = (Parcel.ParcelStatus)(sbyte)properties.ParcelData.Status;
                parcel.TotalPrims = properties.ParcelData.TotalPrims;
                parcel.UserLocation = properties.ParcelData.UserLocation;
                parcel.UserLookAt = properties.ParcelData.UserLookAt;

                // Fire the callback
                try
                {
                    OnParcelProperties(parcel, (ParcelResult)properties.ParcelData.RequestResult,
                        properties.ParcelData.SequenceID, properties.ParcelData.SnapSelection);
                }
                catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
            }
        }
Esempio n. 6
0
        //Separate thread
        private void Parcels_OnParcelProperties(Parcel parcel, ParcelManager.ParcelResult result, int sequenceID, bool snapSelection)
        {
            StringBuilder sb = new StringBuilder();
            sb.Append("Parcel: ");
            sb.Append(parcel.Name);

            if ((parcel.Flags & Parcel.ParcelFlags.AllowFly) != Parcel.ParcelFlags.AllowFly)
                sb.Append(" (no fly)");

            if ((parcel.Flags & Parcel.ParcelFlags.CreateObjects) != Parcel.ParcelFlags.CreateObjects)
                sb.Append(" (no build)");

            if ((parcel.Flags & Parcel.ParcelFlags.AllowOtherScripts) != Parcel.ParcelFlags.AllowOtherScripts)
                sb.Append(" (no scripts)");

            if ((parcel.Flags & Parcel.ParcelFlags.RestrictPushObject) == Parcel.ParcelFlags.RestrictPushObject)
                sb.Append(" (no push)");

            if ((parcel.Flags & Parcel.ParcelFlags.AllowDamage) == Parcel.ParcelFlags.AllowDamage)
                sb.Append(" (damage)");

            BeginInvoke(new MethodInvoker(delegate()
            {
                tlblParcel.Text = sb.ToString();
            }));
        }
Esempio n. 7
0
 public void Parcels_OnParcelProperties(Parcel parcel, ParcelManager.ParcelResult result, int sequenceID, bool snapSelection)
 {
     if(result == ParcelManager.ParcelResult.NoData)
     {
         Hashtable message = new Hashtable();
         message.Add("MessageType", "ParcelPropertiesFailed");
         message.Add("LocalID", parcel.LocalID);
         message.Add("SequenceID", sequenceID);
         enqueue(message);
     }
     else
     {
         Hashtable message = new Hashtable();
         message.Add("MessageType", "ParcelProperties");
         message.Add("SequenceID", sequenceID);
         message.Add("LocalID", parcel.LocalID);
         message.Add("AABBMax", parcel.AABBMax);
         message.Add("AABBMin", parcel.AABBMin);
         message.Add("AccessList", parcel.AccessList);
         message.Add("Area", parcel.Area);
         message.Add("AuctionID", parcel.AuctionID);
         message.Add("AuthBuyerID", parcel.AuthBuyerID);
         message.Add("Category", parcel.Category);
         message.Add("ClaimDate", parcel.ClaimDate);
         message.Add("ClaimPrice", parcel.ClaimPrice);
         message.Add("Desc", parcel.Desc);
         message.Add("Dwell", parcel.Dwell);
         message.Add("Flags", (uint)parcel.Flags);
         message.Add("GroupID", parcel.GroupID);
         message.Add("GroupPrims", parcel.GroupPrims);
         message.Add("IsGroupOwned", parcel.IsGroupOwned);
         message.Add("LandingType", parcel.LandingType);
         message.Add("MaxPrims", parcel.MaxPrims);
         message.Add("MediaAutoScale", parcel.MediaAutoScale);
         message.Add("MediaDesc", parcel.MediaDesc);
         message.Add("MediaHeight", parcel.MediaHeight);
         message.Add("MediaID", parcel.MediaID);
         message.Add("MediaLoop", parcel.MediaLoop);
         message.Add("MediaType", parcel.MediaType);
         message.Add("MediaURL", parcel.MediaURL);
         message.Add("MediaWidth", parcel.MediaWidth);
         message.Add("MusicURL", parcel.MusicURL);
         message.Add("Name", parcel.Name);
         message.Add("ObscureMedia", parcel.ObscureMedia);
         message.Add("ObscureMusic", parcel.ObscureMusic);
         message.Add("OtherCleanTime", parcel.OtherCleanTime);
         message.Add("OtherPrims", parcel.OtherPrims);
         message.Add("OwnerPrims", parcel.OwnerPrims);
         message.Add("OwnerID", parcel.OwnerID);
         message.Add("PrimBonus", parcel.ParcelPrimBonus);
         message.Add("PassHours", parcel.PassHours);
         message.Add("PassPrice", parcel.PassPrice);
         message.Add("PublicCount", parcel.PublicCount);
         message.Add("RegionDenyAgeUnverified", parcel.RegionDenyAgeUnverified);
         message.Add("RegionDenyAnonymous", parcel.RegionDenyAnonymous);
         message.Add("RegionPushOverride", parcel.RegionPushOverride);
         message.Add("RentPrice", parcel.RentPrice);
         message.Add("SalePrice", parcel.SalePrice);
         message.Add("SelectedPrims", parcel.SelectedPrims);
         message.Add("SelfCount", parcel.SelfCount);
         message.Add("SimWideMaxPrims", parcel.SimWideMaxPrims);
         message.Add("SimWideTotalPrims", parcel.SimWideTotalPrims);
         message.Add("SnapshotID", parcel.SnapshotID);
         message.Add("Status", parcel.Status);
         message.Add("TotalPrims", parcel.TotalPrims);
         message.Add("UserLocation", parcel.UserLocation);
         message.Add("UserLookAt", parcel.UserLookAt);
         enqueue(message);
     }
 }
        /// <summary>
        /// ParcelProperties replies sent over CAPS
        /// </summary>
        /// <param name="capsKey">Not used (will always be ParcelProperties)</param>
        /// <param name="llsd">LLSD Structured data</param>
        /// <param name="simulator">Object representing simulator</param>
        private void ParcelPropertiesReplyHandler(string capsKey, LLSD llsd, Simulator simulator)
        {

            if (OnParcelProperties != null || Client.Settings.PARCEL_TRACKING == true)
            {

                LLSDMap map = (LLSDMap)llsd;
                LLSDMap parcelDataBlock = (LLSDMap)(((LLSDArray)map["ParcelData"])[0]);
                LLSDMap ageVerifyBlock = (LLSDMap)(((LLSDArray)map["AgeVerificationBlock"])[0]);
                LLSDMap mediaDataBlock = (LLSDMap)(((LLSDArray)map["MediaData"])[0]);

                Parcel parcel = new Parcel(simulator, parcelDataBlock["LocalID"].AsInteger());

                parcel.AABBMax.FromLLSD(parcelDataBlock["AABBMax"]);
                parcel.AABBMin.FromLLSD(parcelDataBlock["AABBMin"]);
                parcel.Area = parcelDataBlock["Area"].AsInteger();
                parcel.AuctionID = (uint)parcelDataBlock["AuctionID"].AsInteger();
                parcel.AuthBuyerID = parcelDataBlock["AuthBuyerID"].AsUUID();
                parcel.Bitmap = parcelDataBlock["Bitmap"].AsBinary();
                parcel.Category = (Parcel.ParcelCategory)parcelDataBlock["Category"].AsInteger();
                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)
                    Array.Reverse(bytes);
                parcel.Flags = (Parcel.ParcelFlags)BitConverter.ToUInt32(bytes, 0);
                parcel.GroupID = parcelDataBlock["GroupID"].AsUUID();
                parcel.GroupPrims = parcelDataBlock["GroupPrims"].AsInteger();
                parcel.IsGroupOwned = parcelDataBlock["IsGroupOwned"].AsBoolean();
                parcel.LandingType = (byte)parcelDataBlock["LandingType"].AsInteger();
                parcel.LocalID = parcelDataBlock["LocalID"].AsInteger();
                parcel.MaxPrims = parcelDataBlock["MaxPrims"].AsInteger();
                parcel.MediaAutoScale = (byte)parcelDataBlock["MediaAutoScale"].AsInteger();
                parcel.MediaID = parcelDataBlock["MediaID"].AsUUID();
                parcel.MediaURL = parcelDataBlock["MediaURL"].AsString();
                parcel.MusicURL = parcelDataBlock["MusicURL"].AsString();
                parcel.Name = parcelDataBlock["Name"].AsString();
                parcel.OtherCleanTime = parcelDataBlock["OtherCleanTime"].AsInteger();
                parcel.OtherCount = parcelDataBlock["OtherCount"].AsInteger();
                parcel.OtherPrims = parcelDataBlock["OtherPrims"].AsInteger();
                parcel.OwnerID = parcelDataBlock["OwnerID"].AsUUID();
                parcel.OwnerPrims = parcelDataBlock["OwnerPrims"].AsInteger();
                parcel.ParcelPrimBonus = (float)parcelDataBlock["ParcelPrimBonus"].AsReal();
                parcel.PassHours = (float)parcelDataBlock["PassHours"].AsReal();
                parcel.PassPrice = parcelDataBlock["PassPrice"].AsInteger();
                parcel.PublicCount = parcelDataBlock["PublicCount"].AsInteger();
                parcel.RegionDenyAgeUnverified = ageVerifyBlock["RegionDenyAgeUnverified"].AsBoolean();
                parcel.RegionDenyAnonymous = parcelDataBlock["RegionDenyAnonymous"].AsBoolean();
                parcel.RegionPushOverride = parcelDataBlock["RegionPushOverride"].AsBoolean();
                parcel.RentPrice = parcelDataBlock["RentPrice"].AsInteger();
                parcel.RequestResult = parcelDataBlock["RequestResult"].AsInteger();
                parcel.SalePrice = parcelDataBlock["SalePrice"].AsInteger();
                parcel.SelectedPrims = parcelDataBlock["SelectedPrims"].AsInteger();
                parcel.SelfCount = parcelDataBlock["SelfCount"].AsInteger();
                parcel.SequenceID = parcelDataBlock["SequenceID"].AsInteger();
                parcel.Simulator = simulator;
                parcel.SimWideMaxPrims = parcelDataBlock["SimWideMaxPrims"].AsInteger();
                parcel.SimWideTotalPrims = parcelDataBlock["SimWideTotalPrims"].AsInteger();
                parcel.SnapSelection = parcelDataBlock["SnapSelection"].AsBoolean();
                parcel.SnapshotID = parcelDataBlock["SnapshotID"].AsUUID();
                parcel.Status = (Parcel.ParcelStatus)parcelDataBlock["Status"].AsInteger();
                parcel.TotalPrims = parcelDataBlock["TotalPrims"].AsInteger();
                parcel.UserLocation.FromLLSD(parcelDataBlock["UserLocation"]);
                parcel.UserLookAt.FromLLSD(parcelDataBlock["UserLookAt"]);
                parcel.MediaDesc = mediaDataBlock["MediaDesc"].AsString();
                parcel.MediaHeight = mediaDataBlock["MediaHeight"].AsInteger();
                parcel.MediaWidth = mediaDataBlock["MediaWidth"].AsInteger();
                parcel.MediaLoop = mediaDataBlock["MediaLoop"].AsBoolean();
                parcel.MediaType = mediaDataBlock["MediaType"].AsString();
                parcel.ObscureMedia = mediaDataBlock["ObscureMedia"].AsBoolean();
                parcel.ObscureMusic = mediaDataBlock["ObscureMusic"].AsBoolean();

                if (Client.Settings.PARCEL_TRACKING)
                {
                    lock (simulator.Parcels.Dictionary)
                        simulator.Parcels.Dictionary[parcel.LocalID] = parcel;

                    int y, x, index, bit;
                    for (y = 0; y < simulator.ParcelMap.GetLength(0); y++)
                    {
                        for (x = 0; x < simulator.ParcelMap.GetLength(1); x++)
                        {
                            if (simulator.ParcelMap[y, x] == 0)
                            {
                                index = (y * 64) + x;
                                bit = index % 8;
                                index >>= 3;

                                if ((parcel.Bitmap[index] & (1 << bit)) != 0)
                                    simulator.ParcelMap[y, x] = parcel.LocalID;
                            }
                        }

                    }
                }

                // auto request acl, will be stored in parcel tracking dictionary if enabled
                if (Client.Settings.ALWAYS_REQUEST_PARCEL_ACL)
                    Client.Parcels.AccessListRequest(simulator, parcel.LocalID,
                        AccessList.Both, parcel.SequenceID);

                // auto request dwell, will be stored in parcel tracking dictionary if enables
                if (Client.Settings.ALWAYS_REQUEST_PARCEL_DWELL)
                    Client.Parcels.DwellRequest(simulator, parcel.LocalID);

                // Fire the callback for parcel properties being received
                if (OnParcelProperties != null)
                {
                    try
                    {
                        OnParcelProperties(parcel, (ParcelResult)parcel.RequestResult,
                          parcel.SequenceID, parcel.SnapSelection);
                    }
                    catch (Exception e) { Logger.Log(e.Message, Helpers.LogLevel.Error, Client, e); }
                }

                // Check if all of the simulator parcels have been retrieved, if so fire another callback
                if (OnSimParcelsDownloaded != null && simulator.IsParcelMapFull())
                {
                    try { OnSimParcelsDownloaded(simulator, simulator.Parcels, simulator.ParcelMap); }
                    catch (Exception e) { Logger.Log(e.Message, Helpers.LogLevel.Error, Client, e); }
                }
            }
        }