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.cs55
1 files changed, 37 insertions, 18 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index a229a9a..b03fee0 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -2758,8 +2758,6 @@ namespace OpenSim.Region.Framework.Scenes
2758 2758
2759 if (newPosition != Vector3.Zero) 2759 if (newPosition != Vector3.Zero)
2760 newObject.RootPart.GroupPosition = newPosition; 2760 newObject.RootPart.GroupPosition = newPosition;
2761 if (newObject.RootPart.KeyframeMotion != null)
2762 newObject.RootPart.KeyframeMotion.UpdateSceneObject(newObject);
2763 2761
2764 if (!AddSceneObject(newObject)) 2762 if (!AddSceneObject(newObject))
2765 { 2763 {
@@ -2787,6 +2785,9 @@ namespace OpenSim.Region.Framework.Scenes
2787 // before we restart the scripts, or else some functions won't work. 2785 // before we restart the scripts, or else some functions won't work.
2788 newObject.RootPart.ParentGroup.CreateScriptInstances(0, false, DefaultScriptEngine, GetStateSource(newObject)); 2786 newObject.RootPart.ParentGroup.CreateScriptInstances(0, false, DefaultScriptEngine, GetStateSource(newObject));
2789 newObject.ResumeScripts(); 2787 newObject.ResumeScripts();
2788
2789 if (newObject.RootPart.KeyframeMotion != null)
2790 newObject.RootPart.KeyframeMotion.UpdateSceneObject(newObject);
2790 } 2791 }
2791 2792
2792 // Do this as late as possible so that listeners have full access to the incoming object 2793 // Do this as late as possible so that listeners have full access to the incoming object
@@ -3611,7 +3612,7 @@ namespace OpenSim.Region.Framework.Scenes
3611 // TODO: We shouldn't use closeChildAgents here - it's being used by the NPC module to stop 3612 // TODO: We shouldn't use closeChildAgents here - it's being used by the NPC module to stop
3612 // unnecessary operations. This should go away once NPCs have no accompanying IClientAPI 3613 // unnecessary operations. This should go away once NPCs have no accompanying IClientAPI
3613 if (closeChildAgents && CapsModule != null) 3614 if (closeChildAgents && CapsModule != null)
3614 CapsModule.RemoveCaps(agentID); 3615 CapsModule.RemoveCaps(agentID, avatar.ControllingClient.CircuitCode);
3615 3616
3616// // REFACTORING PROBLEM -- well not really a problem, but just to point out that whatever 3617// // REFACTORING PROBLEM -- well not really a problem, but just to point out that whatever
3617// // this method is doing is HORRIBLE!!! 3618// // this method is doing is HORRIBLE!!!
@@ -3842,20 +3843,36 @@ namespace OpenSim.Region.Framework.Scenes
3842 return false; 3843 return false;
3843 } 3844 }
3844 3845
3845
3846 ScenePresence sp = GetScenePresence(agent.AgentID); 3846 ScenePresence sp = GetScenePresence(agent.AgentID);
3847 3847
3848 if (sp != null && !sp.IsChildAgent) 3848 // If we have noo presence here or if that presence is a zombie root
3849 // presence that will be kicled, we need a new CAPS object.
3850 if (sp == null || (sp != null && !sp.IsChildAgent))
3849 { 3851 {
3850 // We have a zombie from a crashed session. 3852 if (CapsModule != null)
3851 // Or the same user is trying to be root twice here, won't work. 3853 {
3852 // Kill it. 3854 lock (agent)
3853 m_log.WarnFormat( 3855 {
3854 "[SCENE]: Existing root scene presence detected for {0} {1} in {2} when connecting. Removing existing presence.", 3856 CapsModule.SetAgentCapsSeeds(agent);
3855 sp.Name, sp.UUID, RegionInfo.RegionName); 3857 CapsModule.CreateCaps(agent.AgentID, agent.circuitcode);
3858 }
3859 }
3860 }
3856 3861
3857 sp.ControllingClient.Close(true, true); 3862 if (sp != null)
3858 sp = null; 3863 {
3864 if (!sp.IsChildAgent)
3865 {
3866 // We have a zombie from a crashed session.
3867 // Or the same user is trying to be root twice here, won't work.
3868 // Kill it.
3869 m_log.WarnFormat(
3870 "[SCENE]: Existing root scene presence detected for {0} {1} in {2} when connecting. Removing existing presence.",
3871 sp.Name, sp.UUID, RegionInfo.RegionName);
3872
3873 sp.ControllingClient.Close(true, true);
3874 sp = null;
3875 }
3859 } 3876 }
3860 3877
3861 lock (agent) 3878 lock (agent)
@@ -3896,7 +3913,9 @@ namespace OpenSim.Region.Framework.Scenes
3896 if (vialogin || (!m_seeIntoBannedRegion)) 3913 if (vialogin || (!m_seeIntoBannedRegion))
3897 { 3914 {
3898 if (!AuthorizeUser(agent, out reason)) 3915 if (!AuthorizeUser(agent, out reason))
3916 {
3899 return false; 3917 return false;
3918 }
3900 } 3919 }
3901 } 3920 }
3902 catch (Exception e) 3921 catch (Exception e)
@@ -3911,11 +3930,6 @@ namespace OpenSim.Region.Framework.Scenes
3911 RegionInfo.RegionName, (agent.child ? "child" : "root"), agent.firstname, agent.lastname, 3930 RegionInfo.RegionName, (agent.child ? "child" : "root"), agent.firstname, agent.lastname,
3912 agent.AgentID, agent.circuitcode); 3931 agent.AgentID, agent.circuitcode);
3913 3932
3914 if (CapsModule != null)
3915 {
3916 CapsModule.SetAgentCapsSeeds(agent);
3917 CapsModule.CreateCaps(agent.AgentID);
3918 }
3919 } 3933 }
3920 else 3934 else
3921 { 3935 {
@@ -3941,6 +3955,11 @@ namespace OpenSim.Region.Framework.Scenes
3941 agent.teleportFlags = teleportFlags; 3955 agent.teleportFlags = teleportFlags;
3942 m_authenticateHandler.AddNewCircuit(agent.circuitcode, agent); 3956 m_authenticateHandler.AddNewCircuit(agent.circuitcode, agent);
3943 3957
3958 if (CapsModule != null)
3959 {
3960 CapsModule.ActivateCaps(agent.circuitcode);
3961 }
3962
3944 if (vialogin) 3963 if (vialogin)
3945 { 3964 {
3946// CleanDroppedAttachments(); 3965// CleanDroppedAttachments();