private void CreateDefaultParcel() { SceneParcel parcel = new SceneParcel(); parcel.ID = UUID.Random(); parcel.LocalID = System.Threading.Interlocked.Increment(ref m_currentParcelID); parcel.Desc = String.Empty; parcel.Flags = ParcelFlags.AllowAPrimitiveEntry | ParcelFlags.AllowFly | ParcelFlags.AllowGroupScripts | ParcelFlags.AllowLandmark | ParcelFlags.AllowOtherScripts | ParcelFlags.AllowTerraform | ParcelFlags.AllowVoiceChat | ParcelFlags.CreateGroupObjects | ParcelFlags.CreateObjects | ParcelFlags.UseBanList; parcel.Landing = LandingType.Direct; parcel.MaxPrims = 250000; parcel.Name = m_scene.Name; parcel.Status = ParcelStatus.Leased; parcel.LandingLocation = new Vector3(128f, 128f, 0f); parcel.MaxPrims = (int)Math.Round(m_primsPerSquareMeter * 256f * 256f); parcel.Bitmap = new byte[512]; for (int i = 0; i < 512; i++) { parcel.Bitmap[i] = Byte.MaxValue; } for (int i = 0; i < m_parcelOverlay.Length; i++) { m_parcelOverlay[i] = parcel.LocalID; } // Add the default parcel to the list AddOrUpdateParcel(parcel); }
public static int GetParcelArea(SceneParcel parcel, out Vector3 aabbMin, out Vector3 aabbMax) { int minX = 64; int minY = 64; int maxX = 0; int maxY = 0; int area = 0; System.Diagnostics.Debug.Assert(parcel.Bitmap != null); System.Diagnostics.Debug.Assert(parcel.Bitmap.Length == 512); BitPack bitmap = new BitPack(parcel.Bitmap, 0); for (int y = 0; y < 64; y++) { for (int x = 0; x < 64; x++) { if (bitmap.UnpackBits(1) != 0) { int x4 = x * 4; int y4 = y * 4; if (minX > x4) minX = x4; if (minY > y4) minY = y4; if (maxX < x4) maxX = x4; if (maxX < y4) maxY = y4; area += 16; } } } aabbMin = new Vector3(minX, minY, 0f); aabbMax = new Vector3(maxX, maxY, 0f); return area; }
public void JoinParcels(IList <SceneParcel> parcels) { if (parcels.Count < 2) { return; } SceneParcel masterParcel = parcels[0]; for (int i = 1; i < parcels.Count; i++) { SceneParcel parcel = parcels[i]; // Remove the child parcels m_parcels.Remove(parcel.ID, parcel.LocalID); // Merge the child parcel bitmaps into the master parcel bitmap for (int j = 0; j < masterParcel.Bitmap.Length; j++) { masterParcel.Bitmap[j] |= parcel.Bitmap[j]; } } // Update parcel bitmaps UpdateParcelOverlay(masterParcel); // Update max prim count Vector3 aabbMin, aabbMax; int area = GetParcelArea(masterParcel, out aabbMin, out aabbMax); masterParcel.MaxPrims = (int)Math.Round((float)area * m_primsPerSquareMeter); Serialize(); }
public bool TryGetParcel(Vector3 position, out SceneParcel parcel) { // Clamp position to inside region boundaries int x = (int)Utils.Clamp(position.X, 0f, 255f) / 4; int y = (int)Utils.Clamp(position.Y, 0f, 255f) / 4; int parcelID = m_parcelOverlay[y * 64 + x]; return(TryGetParcel(parcelID, out parcel)); }
/// <summary> /// Copy constructor /// </summary> public SceneParcel(SceneParcel parcel) { if (parcel.AccessBlackList != null) { AccessBlackList = new List <ParcelAccessEntry>(parcel.AccessBlackList); } if (parcel.AccessWhiteList != null) { AccessWhiteList = new List <ParcelAccessEntry>(parcel.AccessWhiteList); } AuthBuyerID = parcel.AuthBuyerID; AutoReturnTime = parcel.AutoReturnTime; Bitmap = new byte[512]; Buffer.BlockCopy(parcel.Bitmap, 0, Bitmap, 0, 512); Category = parcel.Category; ClaimDate = parcel.ClaimDate; Desc = parcel.Desc; Dwell = parcel.Dwell; Flags = parcel.Flags; GroupID = parcel.GroupID; IsGroupOwned = parcel.IsGroupOwned; Landing = parcel.Landing; LocalID = parcel.LocalID; MaxPrims = parcel.MaxPrims; ParcelMedia oldMedia = parcel.Media; Media = new ParcelMedia { MediaAutoScale = oldMedia.MediaAutoScale, MediaDesc = oldMedia.MediaDesc, MediaHeight = oldMedia.MediaHeight, MediaID = oldMedia.MediaID, MediaLoop = oldMedia.MediaLoop, MediaType = oldMedia.MediaType, MediaURL = oldMedia.MediaURL, MediaWidth = oldMedia.MediaWidth }; MusicURL = parcel.MusicURL; Name = parcel.Name; ObscureMedia = parcel.ObscureMedia; ObscureMusic = parcel.ObscureMusic; OwnerID = parcel.OwnerID; PassHours = parcel.PassHours; PassPrice = parcel.PassPrice; DenyAgeUnverified = parcel.DenyAgeUnverified; DenyAnonymous = parcel.DenyAnonymous; PushOverride = parcel.PushOverride; SalePrice = parcel.SalePrice; SnapshotID = parcel.SnapshotID; Status = parcel.Status; LandingLocation = parcel.LandingLocation; LandingLookAt = parcel.LandingLookAt; }
private void UpdateParcelOverlay(SceneParcel parcel) { BitPack bitmap = new BitPack(parcel.Bitmap, 0); for (int y = 0; y < 64; y++) { for (int x = 0; x < 64; x++) { if (bitmap.UnpackBits(1) != 0) { m_parcelOverlay[y * 64 + x] = parcel.LocalID; } } } }
public static int GetParcelArea(SceneParcel parcel, out Vector3 aabbMin, out Vector3 aabbMax) { int minX = 64; int minY = 64; int maxX = 0; int maxY = 0; int area = 0; System.Diagnostics.Debug.Assert(parcel.Bitmap != null); System.Diagnostics.Debug.Assert(parcel.Bitmap.Length == 512); BitPack bitmap = new BitPack(parcel.Bitmap, 0); for (int y = 0; y < 64; y++) { for (int x = 0; x < 64; x++) { if (bitmap.UnpackBits(1) != 0) { int x4 = x * 4; int y4 = y * 4; if (minX > x4) { minX = x4; } if (minY > y4) { minY = y4; } if (maxX < x4) { maxX = x4; } if (maxX < y4) { maxY = y4; } area += 16; } } } aabbMin = new Vector3(minX, minY, 0f); aabbMax = new Vector3(maxX, maxY, 0f); return(area); }
public void AddOrUpdateParcel(SceneParcel parcel) { if (parcel.ID == UUID.Zero) { parcel.ID = UUID.Random(); } if (parcel.LocalID <= 0) { parcel.LocalID = System.Threading.Interlocked.Increment(ref m_currentParcelID); } UpdateParcelOverlay(parcel); m_parcels.Add(parcel.ID, parcel.LocalID, parcel); Serialize(); }
public bool CanEditParcel(IScenePresence presence, SceneParcel parcel) { // Check for superuser if (IsGridAdmin(presence) || IsEstateManager(presence)) { return(true); } if (presence.ID == parcel.OwnerID) { return(true); } if (parcel.IsGroupOwned && HasGroupPowers(presence, parcel.GroupID, GroupPowers.LandDivideJoin)) { return(true); } return(false); }
public bool TryGetParcel(Vector3 position, out SceneParcel parcel) { // Clamp position to inside region boundaries int x = (int)Utils.Clamp(position.X, 0f, 255f) / 4; int y = (int)Utils.Clamp(position.Y, 0f, 255f) / 4; int parcelID = m_parcelOverlay[y * 64 + x]; return TryGetParcel(parcelID, out parcel); }
private void CreateDefaultParcel() { SceneParcel parcel = new SceneParcel(); parcel.ID = UUID.Random(); parcel.LocalID = System.Threading.Interlocked.Increment(ref m_currentParcelID); parcel.Desc = String.Empty; parcel.Flags = ParcelFlags.AllowAPrimitiveEntry | ParcelFlags.AllowFly | ParcelFlags.AllowGroupScripts | ParcelFlags.AllowLandmark | ParcelFlags.AllowOtherScripts | ParcelFlags.AllowTerraform | ParcelFlags.AllowVoiceChat | ParcelFlags.CreateGroupObjects | ParcelFlags.CreateObjects | ParcelFlags.UseBanList; parcel.Landing = LandingType.Direct; parcel.MaxPrims = 250000; parcel.Name = m_scene.Name; parcel.Status = ParcelStatus.Leased; parcel.LandingLocation = new Vector3(128f, 128f, 0f); parcel.MaxPrims = (int)Math.Round(m_primsPerSquareMeter * 256f * 256f); parcel.Bitmap = new byte[512]; for (int i = 0; i < 512; i++) parcel.Bitmap[i] = Byte.MaxValue; for (int i = 0; i < m_parcelOverlay.Length; i++) m_parcelOverlay[i] = parcel.LocalID; // Add the default parcel to the list AddOrUpdateParcel(parcel); }
public bool TryGetParcel(UUID parcelID, out SceneParcel parcel) { return m_parcels.TryGetValue(parcelID, out parcel); }
public bool TryGetParcel(int parcelID, out SceneParcel parcel) { lock (m_parcels) return m_parcels.TryGetValue(parcelID, out parcel); }
public void AddOrUpdateParcel(SceneParcel parcel) { if (parcel.ID == UUID.Zero) parcel.ID = UUID.Random(); if (parcel.LocalID <= 0) parcel.LocalID = System.Threading.Interlocked.Increment(ref m_currentParcelID); UpdateParcelOverlay(parcel); m_parcels.Add(parcel.ID, parcel.LocalID, parcel); Serialize(); }
public void SplitParcel(SceneParcel parcel, int startX, int endX, int startY, int endY) { SceneParcel newParcel = new SceneParcel(parcel); newParcel.ID = UUID.Random(); newParcel.LocalID = System.Threading.Interlocked.Increment(ref m_currentParcelID); newParcel.ClaimDate = DateTime.UtcNow; newParcel.Dwell = 0f; m_parcels.Add(newParcel.ID, newParcel.LocalID, newParcel); // Update parcel bitmaps BitPack origParcelBitmap = new BitPack(parcel.Bitmap, 0); BitPack parcelBitmap = new BitPack(new byte[512], 0); BitPack newParcelBitmap = new BitPack(newParcel.Bitmap, 0); for (int y = 0; y < 64; y++) { for (int x = 0; x < 64; x++) { bool origParcelBit = (origParcelBitmap.UnpackBits(1) != 0); if (x >= startX && x <= endX && y >= startY && y <= endY) { // Inside the new parcel parcelBitmap.PackBit(false); newParcelBitmap.PackBit(true); m_parcelOverlay[y * 64 + x] = newParcel.LocalID; } else { // Not inside the new parcel parcelBitmap.PackBit(origParcelBit); newParcelBitmap.PackBit(false); } } } // Update parcel landing info SceneParcel landingParcel; if (TryGetParcel(newParcel.LandingLocation, out landingParcel) && landingParcel == parcel) { newParcel.Landing = LandingType.None; newParcel.LandingLocation = Vector3.Zero; } else { parcel.Landing = LandingType.None; parcel.LandingLocation = Vector3.Zero; } // Update max prim counts Vector3 aabbMin, aabbMax; int area = GetParcelArea(parcel, out aabbMin, out aabbMax); parcel.MaxPrims = (int)Math.Round((float)area * m_primsPerSquareMeter); area = GetParcelArea(newParcel, out aabbMin, out aabbMax); newParcel.MaxPrims = (int)Math.Round((float)area * m_primsPerSquareMeter); Serialize(); }
/// <summary> /// Copy constructor /// </summary> public SceneParcel(SceneParcel parcel) { if (parcel.AccessBlackList != null) AccessBlackList = new List<ParcelAccessEntry>(parcel.AccessBlackList); if (parcel.AccessWhiteList != null) AccessWhiteList = new List<ParcelAccessEntry>(parcel.AccessWhiteList); AuthBuyerID = parcel.AuthBuyerID; AutoReturnTime = parcel.AutoReturnTime; Bitmap = new byte[512]; Buffer.BlockCopy(parcel.Bitmap, 0, Bitmap, 0, 512); Category = parcel.Category; ClaimDate = parcel.ClaimDate; Desc = parcel.Desc; Dwell = parcel.Dwell; Flags = parcel.Flags; GroupID = parcel.GroupID; IsGroupOwned = parcel.IsGroupOwned; Landing = parcel.Landing; LocalID = parcel.LocalID; MaxPrims = parcel.MaxPrims; ParcelMedia oldMedia = parcel.Media; Media = new ParcelMedia { MediaAutoScale = oldMedia.MediaAutoScale, MediaDesc = oldMedia.MediaDesc, MediaHeight = oldMedia.MediaHeight, MediaID = oldMedia.MediaID, MediaLoop = oldMedia.MediaLoop, MediaType = oldMedia.MediaType, MediaURL = oldMedia.MediaURL, MediaWidth = oldMedia.MediaWidth }; MusicURL = parcel.MusicURL; Name = parcel.Name; ObscureMedia = parcel.ObscureMedia; ObscureMusic = parcel.ObscureMusic; OwnerID = parcel.OwnerID; PassHours = parcel.PassHours; PassPrice = parcel.PassPrice; DenyAgeUnverified = parcel.DenyAgeUnverified; DenyAnonymous = parcel.DenyAnonymous; PushOverride = parcel.PushOverride; SalePrice = parcel.SalePrice; SnapshotID = parcel.SnapshotID; Status = parcel.Status; LandingLocation = parcel.LandingLocation; LandingLookAt = parcel.LandingLookAt; }
public bool TryGetParcel(UUID parcelID, out SceneParcel parcel) { return(m_parcels.TryGetValue(parcelID, out parcel)); }
public bool CanEnterParcel(IScenePresence presence, SceneParcel parcel) { // Check for superuser if (IsGridAdmin(presence) || IsEstateManager(presence)) { return(true); } // Check for an unverified presence ban if ((parcel.Flags & ParcelFlags.DenyAnonymous) == ParcelFlags.DenyAnonymous && !presence.IsVerified) { return(false); } // Check if UseAccessGroup is enabled and if so, is the presence a member of the correct group if ((parcel.Flags & ParcelFlags.UseAccessGroup) == ParcelFlags.UseAccessGroup && !IsInGroup(presence, parcel.GroupID)) { return(false); } // Is the whitelist enabled? if ((parcel.Flags & ParcelFlags.UseAccessList) == ParcelFlags.UseAccessList) { // Check the whitelist if (parcel.AccessWhiteList != null) { lock (parcel.AccessWhiteList) { for (int i = 0; i < parcel.AccessWhiteList.Count; i++) { ParcelAccessEntry pae = parcel.AccessWhiteList[i]; if (pae.AgentID == presence.ID) { return(true); } } } } return(false); } // Is the blacklist enabled? if ((parcel.Flags & ParcelFlags.UseBanList) == ParcelFlags.UseBanList) { // Check the blacklist if (parcel.AccessBlackList != null) { lock (parcel.AccessBlackList) { for (int i = 0; i < parcel.AccessBlackList.Count; i++) { ParcelAccessEntry pae = parcel.AccessBlackList[i]; if (pae.AgentID == presence.ID) { return(false); } } } } } return(true); }
private void Deserialize() { if (m_dataStore != null) { IList <SerializedData> items = m_dataStore.Deserialize(m_scene.ID, "parcels"); foreach (SerializedData data in items) { OSDArray parcelData = OSDParser.DeserializeJson(Encoding.UTF8.GetString(data.Data)) as OSDArray; if (parcelData != null) { for (int i = 0; i < parcelData.Count; i++) { SceneParcel parcel = SceneParcel.FromOSD(parcelData[i] as OSDMap); UpdateParcelOverlay(parcel); m_parcels.Add(parcel.ID, parcel.LocalID, parcel); if (parcel.LocalID > m_currentParcelID) { m_currentParcelID = parcel.LocalID; } UpdateParcelOverlay(parcel); } } } #region Prune orphaned parcels List <SceneParcel> orphanList = new List <SceneParcel>(0); m_parcels.ForEach( delegate(SceneParcel parcel) { bool found = false; for (int i = 0; i < m_parcelOverlay.Length; i++) { if (m_parcelOverlay[i] == parcel.LocalID) { found = true; break; } } if (!found) { orphanList.Add(parcel); } } ); for (int i = 0; i < orphanList.Count; i++) { SceneParcel orphan = orphanList[i]; m_log.WarnFormat("Pruning orphaned parcel {0} (ID: {1}, LocalID: {2})", orphan.Name, orphan.ID, orphan.LocalID); m_parcels.Remove(orphan.ID, orphan.LocalID); } #endregion Prune orphaned parcels } }
public bool CanEditParcel(IScenePresence presence, SceneParcel parcel) { // Check for superuser if (IsGridAdmin(presence) || IsEstateManager(presence)) return true; if (presence.ID == parcel.OwnerID) return true; if (parcel.IsGroupOwned && HasGroupPowers(presence, parcel.GroupID, GroupPowers.LandDivideJoin)) return true; return false; }
public static SceneParcel FromOSD(OSDMap map) { SceneParcel parcel = new SceneParcel(); parcel.ID = map["id"].AsUUID(); parcel.LocalID = map["local_id"].AsInteger(); OSDArray blacklist = map["access_black_list"] as OSDArray; if (blacklist != null) { parcel.AccessBlackList = new List<ParcelAccessEntry>(blacklist.Count); for (int i = 0; i < blacklist.Count; i++) { if (blacklist[i] is OSDMap) parcel.AccessBlackList[i] = ParcelAccessEntry.FromOSD((OSDMap)blacklist[i]); } } OSDArray whitelist = map["access_white_list"] as OSDArray; if (whitelist != null) { parcel.AccessWhiteList = new List<ParcelAccessEntry>(whitelist.Count); for (int i = 0; i < whitelist.Count; i++) { if (whitelist[i] is OSDMap) parcel.AccessWhiteList[i] = ParcelAccessEntry.FromOSD((OSDMap)whitelist[i]); } } parcel.AuthBuyerID = map["auth_buyer_id"].AsUUID(); parcel.AutoReturnTime = map["auto_return_time"].AsInteger(); parcel.Bitmap = map["bitmap"].AsBinary(); parcel.Category = (ParcelCategory)map["category"].AsInteger(); parcel.ClaimDate = map["claim_date"].AsDate(); parcel.Desc = map["desc"].AsString(); parcel.Dwell = (float)map["dwell"].AsReal(); parcel.Flags = (ParcelFlags)map["flags"].AsInteger(); parcel.GroupID = map["group_id"].AsUUID(); parcel.IsGroupOwned = map["is_group_owned"].AsBoolean(); parcel.Landing = (LandingType)map["landing"].AsInteger(); parcel.MaxPrims = map["max_prims"].AsInteger(); OSDMap media = map["parcel_media"] as OSDMap; if (media != null) { parcel.Media.MediaAutoScale = media["auto_scale"].AsBoolean(); parcel.Media.MediaDesc = media["desc"].AsString(); parcel.Media.MediaHeight = media["height"].AsInteger(); parcel.Media.MediaID = media["id"].AsUUID(); parcel.Media.MediaLoop = media["loop"].AsBoolean(); parcel.Media.MediaType = media["type"].AsString(); parcel.Media.MediaURL = media["url"].AsString(); parcel.Media.MediaWidth = media["width"].AsInteger(); } parcel.MusicURL = map["music_url"].AsString(); parcel.Name = map["name"].AsString(); parcel.ObscureMedia = map["obscure_media"].AsBoolean(); parcel.ObscureMusic = map["obscure_music"].AsBoolean(); parcel.OwnerID = map["owner_id"].AsUUID(); parcel.PassHours = (float)map["pass_hours"].AsReal(); parcel.PassPrice = map["pass_price"].AsInteger(); parcel.DenyAgeUnverified = map["deny_age_unverified"].AsBoolean(); parcel.DenyAnonymous = map["deny_anonymous"].AsBoolean(); parcel.PushOverride = map["push_override"].AsBoolean(); parcel.SalePrice = map["sale_price"].AsInteger(); parcel.SnapshotID = map["snapshot_id"].AsUUID(); parcel.Status = (ParcelStatus)map["status"].AsInteger(); parcel.LandingLocation = map["landing_location"].AsVector3(); parcel.LandingLookAt = map["landing_look_at"].AsVector3(); return parcel; }
public void SplitParcel(SceneParcel parcel, int startX, int endX, int startY, int endY) { SceneParcel newParcel = new SceneParcel(parcel); newParcel.ID = UUID.Random(); newParcel.LocalID = System.Threading.Interlocked.Increment(ref m_currentParcelID); newParcel.ClaimDate = DateTime.UtcNow; newParcel.Dwell = 0f; m_parcels.Add(newParcel.ID, newParcel.LocalID, newParcel); // Update parcel bitmaps BitPack origParcelBitmap = new BitPack(parcel.Bitmap, 0); BitPack parcelBitmap = new BitPack(new byte[512], 0); BitPack newParcelBitmap = new BitPack(newParcel.Bitmap, 0); for (int y = 0; y < 64; y++) { for (int x = 0; x < 64; x++) { bool origParcelBit = (origParcelBitmap.UnpackBits(1) != 0); if (x >= startX && x <= endX && y >= startY && y <= endY) { // Inside the new parcel parcelBitmap.PackBit(false); newParcelBitmap.PackBit(true); m_parcelOverlay[y * 64 + x] = newParcel.LocalID; } else { // Not inside the new parcel parcelBitmap.PackBit(origParcelBit); newParcelBitmap.PackBit(false); } } } // Update parcel landing info SceneParcel landingParcel; if (TryGetParcel(newParcel.LandingLocation, out landingParcel) && landingParcel == parcel) { newParcel.Landing = LandingType.None; newParcel.LandingLocation = Vector3.Zero; } else { parcel.Landing = LandingType.None; parcel.LandingLocation = Vector3.Zero; } // Update max prim counts Vector3 aabbMin, aabbMax; int area = GetParcelArea(parcel, out aabbMin, out aabbMax); parcel.MaxPrims = (int)Math.Round((float)area * m_primsPerSquareMeter); area = GetParcelArea(newParcel, out aabbMin, out aabbMax); newParcel.MaxPrims = (int)Math.Round((float)area * m_primsPerSquareMeter); Serialize(); }
private void UpdateParcelOverlay(SceneParcel parcel) { BitPack bitmap = new BitPack(parcel.Bitmap, 0); for (int y = 0; y < 64; y++) { for (int x = 0; x < 64; x++) { if (bitmap.UnpackBits(1) != 0) m_parcelOverlay[y * 64 + x] = parcel.LocalID; } } }
public static SceneParcel FromOSD(OSDMap map) { SceneParcel parcel = new SceneParcel(); parcel.ID = map["id"].AsUUID(); parcel.LocalID = map["local_id"].AsInteger(); OSDArray blacklist = map["access_black_list"] as OSDArray; if (blacklist != null) { parcel.AccessBlackList = new List <ParcelAccessEntry>(blacklist.Count); for (int i = 0; i < blacklist.Count; i++) { if (blacklist[i] is OSDMap) { parcel.AccessBlackList[i] = ParcelAccessEntry.FromOSD((OSDMap)blacklist[i]); } } } OSDArray whitelist = map["access_white_list"] as OSDArray; if (whitelist != null) { parcel.AccessWhiteList = new List <ParcelAccessEntry>(whitelist.Count); for (int i = 0; i < whitelist.Count; i++) { if (whitelist[i] is OSDMap) { parcel.AccessWhiteList[i] = ParcelAccessEntry.FromOSD((OSDMap)whitelist[i]); } } } parcel.AuthBuyerID = map["auth_buyer_id"].AsUUID(); parcel.AutoReturnTime = map["auto_return_time"].AsInteger(); parcel.Bitmap = map["bitmap"].AsBinary(); parcel.Category = (ParcelCategory)map["category"].AsInteger(); parcel.ClaimDate = map["claim_date"].AsDate(); parcel.Desc = map["desc"].AsString(); parcel.Dwell = (float)map["dwell"].AsReal(); parcel.Flags = (ParcelFlags)map["flags"].AsInteger(); parcel.GroupID = map["group_id"].AsUUID(); parcel.IsGroupOwned = map["is_group_owned"].AsBoolean(); parcel.Landing = (LandingType)map["landing"].AsInteger(); parcel.MaxPrims = map["max_prims"].AsInteger(); OSDMap media = map["parcel_media"] as OSDMap; if (media != null) { parcel.Media.MediaAutoScale = media["auto_scale"].AsBoolean(); parcel.Media.MediaDesc = media["desc"].AsString(); parcel.Media.MediaHeight = media["height"].AsInteger(); parcel.Media.MediaID = media["id"].AsUUID(); parcel.Media.MediaLoop = media["loop"].AsBoolean(); parcel.Media.MediaType = media["type"].AsString(); parcel.Media.MediaURL = media["url"].AsString(); parcel.Media.MediaWidth = media["width"].AsInteger(); } parcel.MusicURL = map["music_url"].AsString(); parcel.Name = map["name"].AsString(); parcel.ObscureMedia = map["obscure_media"].AsBoolean(); parcel.ObscureMusic = map["obscure_music"].AsBoolean(); parcel.OwnerID = map["owner_id"].AsUUID(); parcel.PassHours = (float)map["pass_hours"].AsReal(); parcel.PassPrice = map["pass_price"].AsInteger(); parcel.DenyAgeUnverified = map["deny_age_unverified"].AsBoolean(); parcel.DenyAnonymous = map["deny_anonymous"].AsBoolean(); parcel.PushOverride = map["push_override"].AsBoolean(); parcel.SalePrice = map["sale_price"].AsInteger(); parcel.SnapshotID = map["snapshot_id"].AsUUID(); parcel.Status = (ParcelStatus)map["status"].AsInteger(); parcel.LandingLocation = map["landing_location"].AsVector3(); parcel.LandingLookAt = map["landing_look_at"].AsVector3(); return(parcel); }
public bool CanEnterParcel(IScenePresence presence, SceneParcel parcel) { // Check for superuser if (IsGridAdmin(presence) || IsEstateManager(presence)) return true; // Check for an unverified presence ban if ((parcel.Flags & ParcelFlags.DenyAnonymous) == ParcelFlags.DenyAnonymous && !presence.IsVerified) return false; // Check if UseAccessGroup is enabled and if so, is the presence a member of the correct group if ((parcel.Flags & ParcelFlags.UseAccessGroup) == ParcelFlags.UseAccessGroup && !IsInGroup(presence, parcel.GroupID)) return false; // Is the whitelist enabled? if ((parcel.Flags & ParcelFlags.UseAccessList) == ParcelFlags.UseAccessList) { // Check the whitelist if (parcel.AccessWhiteList != null) { lock (parcel.AccessWhiteList) { for (int i = 0; i < parcel.AccessWhiteList.Count; i++) { ParcelAccessEntry pae = parcel.AccessWhiteList[i]; if (pae.AgentID == presence.ID) return true; } } } return false; } // Is the blacklist enabled? if ((parcel.Flags & ParcelFlags.UseBanList) == ParcelFlags.UseBanList) { // Check the blacklist if (parcel.AccessBlackList != null) { lock (parcel.AccessBlackList) { for (int i = 0; i < parcel.AccessBlackList.Count; i++) { ParcelAccessEntry pae = parcel.AccessBlackList[i]; if (pae.AgentID == presence.ID) return false; } } } } return true; }
public bool TryGetParcel(int parcelID, out SceneParcel parcel) { lock (m_parcels) return(m_parcels.TryGetValue(parcelID, out parcel)); }