aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/Scene.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs49
1 files changed, 47 insertions, 2 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 3c6bab8..3eb4f3e 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -174,6 +174,7 @@ namespace OpenSim.Region.Framework.Scenes
174 private bool m_firstHeartbeat = true; 174 private bool m_firstHeartbeat = true;
175 175
176 private object m_deleting_scene_object = new object(); 176 private object m_deleting_scene_object = new object();
177 private object m_cleaningAttachments = new object();
177 178
178 private UpdatePrioritizationSchemes m_priorityScheme = UpdatePrioritizationSchemes.Time; 179 private UpdatePrioritizationSchemes m_priorityScheme = UpdatePrioritizationSchemes.Time;
179 private bool m_reprioritizationEnabled = true; 180 private bool m_reprioritizationEnabled = true;
@@ -3162,6 +3163,7 @@ namespace OpenSim.Region.Framework.Scenes
3162 } 3163 }
3163 3164
3164 m_eventManager.TriggerOnRemovePresence(agentID); 3165 m_eventManager.TriggerOnRemovePresence(agentID);
3166
3165 ForEachClient( 3167 ForEachClient(
3166 delegate(IClientAPI client) 3168 delegate(IClientAPI client)
3167 { 3169 {
@@ -3194,6 +3196,7 @@ namespace OpenSim.Region.Framework.Scenes
3194 } 3196 }
3195 3197
3196 m_authenticateHandler.RemoveCircuit(avatar.ControllingClient.CircuitCode); 3198 m_authenticateHandler.RemoveCircuit(avatar.ControllingClient.CircuitCode);
3199 CleanDroppedAttachments();
3197 //m_log.InfoFormat("[SCENE] Memory pre GC {0}", System.GC.GetTotalMemory(false)); 3200 //m_log.InfoFormat("[SCENE] Memory pre GC {0}", System.GC.GetTotalMemory(false));
3198 //m_log.InfoFormat("[SCENE] Memory post GC {0}", System.GC.GetTotalMemory(true)); 3201 //m_log.InfoFormat("[SCENE] Memory post GC {0}", System.GC.GetTotalMemory(true));
3199 } 3202 }
@@ -3408,6 +3411,8 @@ namespace OpenSim.Region.Framework.Scenes
3408 3411
3409 if (vialogin) 3412 if (vialogin)
3410 { 3413 {
3414 CleanDroppedAttachments();
3415
3411 if (TestBorderCross(agent.startpos, Cardinals.E)) 3416 if (TestBorderCross(agent.startpos, Cardinals.E))
3412 { 3417 {
3413 Border crossedBorder = GetCrossedBorder(agent.startpos, Cardinals.E); 3418 Border crossedBorder = GetCrossedBorder(agent.startpos, Cardinals.E);
@@ -3756,7 +3761,13 @@ namespace OpenSim.Region.Framework.Scenes
3756 3761
3757 // We have to wait until the viewer contacts this region after receiving EAC. 3762 // We have to wait until the viewer contacts this region after receiving EAC.
3758 // That calls AddNewClient, which finally creates the ScenePresence 3763 // That calls AddNewClient, which finally creates the ScenePresence
3759 m_log.Debug("ICADU -> pre wait"); 3764 ILandObject nearestParcel = GetNearestAllowedParcel(cAgentData.AgentID, Constants.RegionSize / 2, Constants.RegionSize / 2);
3765 if (nearestParcel == null)
3766 {
3767 m_log.DebugFormat("[SCENE]: Denying root agent entry to {0}: no allowed parcel", cAgentData.AgentID);
3768 return false;
3769 }
3770
3760 ScenePresence childAgentUpdate = WaitGetScenePresence(cAgentData.AgentID); 3771 ScenePresence childAgentUpdate = WaitGetScenePresence(cAgentData.AgentID);
3761 m_log.Debug("ICADU -> post wait"); 3772 m_log.Debug("ICADU -> post wait");
3762 if (childAgentUpdate != null) 3773 if (childAgentUpdate != null)
@@ -4738,7 +4749,6 @@ namespace OpenSim.Region.Framework.Scenes
4738 Vector3 nearestRegionEdgePoint = GetNearestRegionEdgePosition(avatar); 4749 Vector3 nearestRegionEdgePoint = GetNearestRegionEdgePosition(avatar);
4739 //Debug.WriteLine("They are really in a place they don't belong, sending them to: " + nearestRegionEdgePoint.ToString()); 4750 //Debug.WriteLine("They are really in a place they don't belong, sending them to: " + nearestRegionEdgePoint.ToString());
4740 return nearestRegionEdgePoint; 4751 return nearestRegionEdgePoint;
4741 return null;
4742 } 4752 }
4743 4753
4744 private Vector3 GetParcelCenterAtGround(ILandObject parcel) 4754 private Vector3 GetParcelCenterAtGround(ILandObject parcel)
@@ -4987,5 +4997,40 @@ namespace OpenSim.Region.Framework.Scenes
4987 throw new Exception(error); 4997 throw new Exception(error);
4988 } 4998 }
4989 } 4999 }
5000
5001 public void CleanDroppedAttachments()
5002 {
5003 List<SceneObjectGroup> objectsToDelete =
5004 new List<SceneObjectGroup>();
5005
5006 lock (m_cleaningAttachments)
5007 {
5008 ForEachSOG(delegate (SceneObjectGroup grp)
5009 {
5010 if (grp.RootPart.Shape.PCode == 0 && grp.RootPart.Shape.State != 0 && (!objectsToDelete.Contains(grp)))
5011 {
5012 UUID agentID = grp.OwnerID;
5013 if (agentID == UUID.Zero)
5014 {
5015 objectsToDelete.Add(grp);
5016 return;
5017 }
5018
5019 ScenePresence sp = GetScenePresence(agentID);
5020 if (sp == null)
5021 {
5022 objectsToDelete.Add(grp);
5023 return;
5024 }
5025 }
5026 });
5027 }
5028
5029 foreach (SceneObjectGroup grp in objectsToDelete)
5030 {
5031 m_log.InfoFormat("[SCENE]: Deleting dropped attachment {0} of user {1}", grp.UUID, grp.OwnerID);
5032 DeleteSceneObject(grp, true);
5033 }
5034 }
4990 } 5035 }
4991} 5036}