aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/Scene.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs75
1 files changed, 56 insertions, 19 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index a63ed13..eae8b8e 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -2281,13 +2281,30 @@ namespace OpenSim.Region.Framework.Scenes
2281 /// <summary> 2281 /// <summary>
2282 /// Synchronously delete the given object from the scene. 2282 /// Synchronously delete the given object from the scene.
2283 /// </summary> 2283 /// </summary>
2284 /// <remarks>
2285 /// Scripts are also removed.
2286 /// </remarks>
2284 /// <param name="group">Object Id</param> 2287 /// <param name="group">Object Id</param>
2285 /// <param name="silent">Suppress broadcasting changes to other clients.</param> 2288 /// <param name="silent">Suppress broadcasting changes to other clients.</param>
2286 public void DeleteSceneObject(SceneObjectGroup group, bool silent) 2289 public void DeleteSceneObject(SceneObjectGroup group, bool silent)
2290 {
2291 DeleteSceneObject(group, silent, true);
2292 }
2293
2294 /// <summary>
2295 /// Synchronously delete the given object from the scene.
2296 /// </summary>
2297 /// <param name="group">Object Id</param>
2298 /// <param name="silent">Suppress broadcasting changes to other clients.</param>
2299 /// <param name="removeScripts">If true, then scripts are removed. If false, then they are only stopped.</para>
2300 public void DeleteSceneObject(SceneObjectGroup group, bool silent, bool removeScripts)
2287 { 2301 {
2288// m_log.DebugFormat("[SCENE]: Deleting scene object {0} {1}", group.Name, group.UUID); 2302// m_log.DebugFormat("[SCENE]: Deleting scene object {0} {1}", group.Name, group.UUID);
2289 2303
2290 group.RemoveScriptInstances(true); 2304 if (removeScripts)
2305 group.RemoveScriptInstances(true);
2306 else
2307 group.StopScriptInstances();
2291 2308
2292 SceneObjectPart[] partList = group.Parts; 2309 SceneObjectPart[] partList = group.Parts;
2293 2310
@@ -2595,7 +2612,16 @@ namespace OpenSim.Region.Framework.Scenes
2595 } 2612 }
2596 catch (Exception e) 2613 catch (Exception e)
2597 { 2614 {
2598 m_log.WarnFormat("[SCENE]: Problem casting object, exception {0}{1}", e.Message, e.StackTrace); 2615 m_log.WarnFormat("[INTERREGION]: Problem casting object, exception {0}{1}", e.Message, e.StackTrace);
2616 return false;
2617 }
2618
2619 // If the user is banned, we won't let any of their objects
2620 // enter. Period.
2621 //
2622 if (RegionInfo.EstateSettings.IsBanned(newObject.OwnerID, 36))
2623 {
2624 m_log.InfoFormat("[INTERREGION]: Denied prim crossing for banned avatar {0}", newObject.OwnerID);
2599 return false; 2625 return false;
2600 } 2626 }
2601 2627
@@ -2606,14 +2632,28 @@ namespace OpenSim.Region.Framework.Scenes
2606 2632
2607 if (!AddSceneObject(newObject)) 2633 if (!AddSceneObject(newObject))
2608 { 2634 {
2609 m_log.DebugFormat("[SCENE]: Problem adding scene object {0} in {1} ", sog.UUID, RegionInfo.RegionName); 2635 m_log.DebugFormat(
2636 "[INTERREGION]: Problem adding scene object {0} in {1} ", newObject.UUID, RegionInfo.RegionName);
2610 return false; 2637 return false;
2611 } 2638 }
2612 2639
2613 // For attachments, we need to wait until the agent is root
2614 // before we restart the scripts, or else some functions won't work.
2615 if (!newObject.IsAttachment) 2640 if (!newObject.IsAttachment)
2616 { 2641 {
2642 // FIXME: It would be better to never add the scene object at all rather than add it and then delete
2643 // it
2644 if (!Permissions.CanObjectEntry(newObject.UUID, true, newObject.AbsolutePosition))
2645 {
2646 // Deny non attachments based on parcel settings
2647 //
2648 m_log.Info("[INTERREGION]: Denied prim crossing because of parcel settings");
2649
2650 DeleteSceneObject(newObject, false);
2651
2652 return false;
2653 }
2654
2655 // For attachments, we need to wait until the agent is root
2656 // before we restart the scripts, or else some functions won't work.
2617 newObject.RootPart.ParentGroup.CreateScriptInstances(0, false, DefaultScriptEngine, GetStateSource(newObject)); 2657 newObject.RootPart.ParentGroup.CreateScriptInstances(0, false, DefaultScriptEngine, GetStateSource(newObject));
2618 newObject.ResumeScripts(); 2658 newObject.ResumeScripts();
2619 } 2659 }
@@ -2650,8 +2690,6 @@ namespace OpenSim.Region.Framework.Scenes
2650 return false; 2690 return false;
2651 } 2691 }
2652 2692
2653 sceneObject.SetScene(this);
2654
2655 // Force allocation of new LocalId 2693 // Force allocation of new LocalId
2656 // 2694 //
2657 SceneObjectPart[] parts = sceneObject.Parts; 2695 SceneObjectPart[] parts = sceneObject.Parts;
@@ -2707,18 +2745,6 @@ namespace OpenSim.Region.Framework.Scenes
2707 return false; 2745 return false;
2708 } 2746 }
2709 AddRestoredSceneObject(sceneObject, true, false); 2747 AddRestoredSceneObject(sceneObject, true, false);
2710
2711 if (!Permissions.CanObjectEntry(sceneObject.UUID,
2712 true, sceneObject.AbsolutePosition))
2713 {
2714 // Deny non attachments based on parcel settings
2715 //
2716 m_log.Info("[INTERREGION]: Denied prim crossing because of parcel settings");
2717
2718 DeleteSceneObject(sceneObject, false);
2719
2720 return false;
2721 }
2722 } 2748 }
2723 2749
2724 return true; 2750 return true;
@@ -4654,6 +4680,17 @@ namespace OpenSim.Region.Framework.Scenes
4654 } 4680 }
4655 4681
4656 /// <summary> 4682 /// <summary>
4683 /// Get all the scene object groups.
4684 /// </summary>
4685 /// <returns>
4686 /// The scene object groups. If the scene is empty then an empty list is returned.
4687 /// </returns>
4688 public List<SceneObjectGroup> GetSceneObjectGroups()
4689 {
4690 return m_sceneGraph.GetSceneObjectGroups();
4691 }
4692
4693 /// <summary>
4657 /// Get a group via its UUID 4694 /// Get a group via its UUID
4658 /// </summary> 4695 /// </summary>
4659 /// <param name="fullID"></param> 4696 /// <param name="fullID"></param>