private bool EventManager_OnSceneGroupMove(UUID groupID, Vector3 pos) { IParcelManagementModule parcelManagment = m_Scene.RequestModuleInterface <IParcelManagementModule>(); ILandObject landObject = parcelManagment.GetLandObject(pos.X, pos.Y) ?? parcelManagment.GetNearestAllowedParcel(UUID.Zero, pos.X, pos.Y); if (landObject == null) { return(true); } ParcelCounts parcelCounts; if ((m_ParcelCounts.TryGetValue(landObject.LandData.GlobalID, out parcelCounts)) && (!parcelCounts.Objects.ContainsKey(groupID))) { m_Tainted = true; } return(true); }
// NOTE: Call under Taint Lock private void RemoveObject(ISceneEntity obj) { if (obj.IsAttachment) { return; } if (((obj.RootChild.Flags & PrimFlags.TemporaryOnRez) != 0)) { return; } IParcelManagementModule parcelManagment = m_Scene.RequestModuleInterface <IParcelManagementModule>(); Vector3 pos = obj.AbsolutePosition; ILandObject landObject = parcelManagment.GetLandObject(pos.X, pos.Y) ?? parcelManagment.GetNearestAllowedParcel(UUID.Zero, pos.X, pos.Y); if (landObject == null) { return; } LandData landData = landObject.LandData; ParcelCounts parcelCounts; if (m_ParcelCounts.TryGetValue(landData.GlobalID, out parcelCounts)) { UUID landOwner = landData.OwnerID; foreach (ISceneChildEntity child in obj.ChildrenEntities()) { bool foundit = false; if (!parcelCounts.Objects.ContainsKey(child.UUID)) { //was not found, lets look through all the parcels foreach (ILandObject parcel in parcelManagment.AllParcels()) { landData = parcel.LandData; if (!m_ParcelCounts.TryGetValue(landData.GlobalID, out parcelCounts)) { continue; } landOwner = landData.OwnerID; if (!parcelCounts.Objects.ContainsKey(child.UUID)) { continue; } foundit = true; break; } } else { foundit = true; } if (!foundit) { continue; } parcelCounts.Objects.Remove(child.UUID); if (m_SimwideCounts.ContainsKey(landOwner)) { m_SimwideCounts[landOwner] -= 1; } if (parcelCounts.Users.ContainsKey(obj.OwnerID)) { parcelCounts.Users[obj.OwnerID] -= 1; } if (landData.IsGroupOwned) { if (obj.OwnerID == landData.GroupID) { parcelCounts.Owner -= 1; } else if (obj.GroupID == landData.GroupID) { parcelCounts.Group -= 1; } else { parcelCounts.Others -= 1; } } else { if (obj.OwnerID == landData.OwnerID) { parcelCounts.Owner -= 1; } else if (obj.GroupID == landData.GroupID) { parcelCounts.Group -= 1; } else { parcelCounts.Others -= 1; } } } } }