diff options
author | Melanie | 2013-02-18 21:09:14 +0100 |
---|---|---|
committer | Melanie | 2013-02-18 21:09:14 +0100 |
commit | 8c0b9080a4fb013d559966fc8c8175fb16162c2d (patch) | |
tree | 85c27f85105afcc6f9e6427550a1090c6a43f0c3 /OpenSim/Region/Framework | |
parent | Correctly remove https:// URLs from the http server. (diff) | |
download | opensim-SC-8c0b9080a4fb013d559966fc8c8175fb16162c2d.zip opensim-SC-8c0b9080a4fb013d559966fc8c8175fb16162c2d.tar.gz opensim-SC-8c0b9080a4fb013d559966fc8c8175fb16162c2d.tar.bz2 opensim-SC-8c0b9080a4fb013d559966fc8c8175fb16162c2d.tar.xz |
Fix an issue where the viewer would request the seed cap before
there was a handler for it.
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r-- | OpenSim/Region/Framework/Interfaces/ICapabilitiesModule.cs | 8 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 50 |
2 files changed, 39 insertions, 19 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/ICapabilitiesModule.cs b/OpenSim/Region/Framework/Interfaces/ICapabilitiesModule.cs index 522c82d..30d404e 100644 --- a/OpenSim/Region/Framework/Interfaces/ICapabilitiesModule.cs +++ b/OpenSim/Region/Framework/Interfaces/ICapabilitiesModule.cs | |||
@@ -40,19 +40,19 @@ namespace OpenSim.Region.Framework.Interfaces | |||
40 | /// </summary> | 40 | /// </summary> |
41 | /// <param name="agentId"></param> | 41 | /// <param name="agentId"></param> |
42 | /// <param name="capsObjectPath"></param> | 42 | /// <param name="capsObjectPath"></param> |
43 | void CreateCaps(UUID agentId); | 43 | void CreateCaps(UUID agentId, uint circuitCode); |
44 | 44 | ||
45 | /// <summary> | 45 | /// <summary> |
46 | /// Remove the caps handler for a given agent. | 46 | /// Remove the caps handler for a given agent. |
47 | /// </summary> | 47 | /// </summary> |
48 | /// <param name="agentId"></param> | 48 | /// <param name="agentId"></param> |
49 | void RemoveCaps(UUID agentId); | 49 | void RemoveCaps(UUID agentId, uint circuitCode); |
50 | 50 | ||
51 | /// <summary> | 51 | /// <summary> |
52 | /// Will return null if the agent doesn't have a caps handler registered | 52 | /// Will return null if the agent doesn't have a caps handler registered |
53 | /// </summary> | 53 | /// </summary> |
54 | /// <param name="agentId"></param> | 54 | /// <param name="agentId"></param> |
55 | Caps GetCapsForUser(UUID agentId); | 55 | Caps GetCapsForUser(uint circuitCode); |
56 | 56 | ||
57 | void SetAgentCapsSeeds(AgentCircuitData agent); | 57 | void SetAgentCapsSeeds(AgentCircuitData agent); |
58 | 58 | ||
@@ -65,5 +65,7 @@ namespace OpenSim.Region.Framework.Interfaces | |||
65 | void DropChildSeed(UUID agentID, ulong handle); | 65 | void DropChildSeed(UUID agentID, ulong handle); |
66 | 66 | ||
67 | string GetCapsPath(UUID agentId); | 67 | string GetCapsPath(UUID agentId); |
68 | |||
69 | void ActivateCaps(uint circuitCode); | ||
68 | } | 70 | } |
69 | } | 71 | } |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index e58aadc..7fcbed4 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -3622,7 +3622,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3622 | // TODO: We shouldn't use closeChildAgents here - it's being used by the NPC module to stop | 3622 | // TODO: We shouldn't use closeChildAgents here - it's being used by the NPC module to stop |
3623 | // unnecessary operations. This should go away once NPCs have no accompanying IClientAPI | 3623 | // unnecessary operations. This should go away once NPCs have no accompanying IClientAPI |
3624 | if (closeChildAgents && CapsModule != null) | 3624 | if (closeChildAgents && CapsModule != null) |
3625 | CapsModule.RemoveCaps(agentID); | 3625 | CapsModule.RemoveCaps(agentID, avatar.ControllingClient.CircuitCode); |
3626 | 3626 | ||
3627 | // // REFACTORING PROBLEM -- well not really a problem, but just to point out that whatever | 3627 | // // REFACTORING PROBLEM -- well not really a problem, but just to point out that whatever |
3628 | // // this method is doing is HORRIBLE!!! | 3628 | // // this method is doing is HORRIBLE!!! |
@@ -3853,20 +3853,36 @@ namespace OpenSim.Region.Framework.Scenes | |||
3853 | return false; | 3853 | return false; |
3854 | } | 3854 | } |
3855 | 3855 | ||
3856 | |||
3857 | ScenePresence sp = GetScenePresence(agent.AgentID); | 3856 | ScenePresence sp = GetScenePresence(agent.AgentID); |
3858 | 3857 | ||
3859 | if (sp != null && !sp.IsChildAgent) | 3858 | // If we have noo presence here or if that presence is a zombie root |
3859 | // presence that will be kicled, we need a new CAPS object. | ||
3860 | if (sp == null || (sp != null && !sp.IsChildAgent)) | ||
3860 | { | 3861 | { |
3861 | // We have a zombie from a crashed session. | 3862 | if (CapsModule != null) |
3862 | // Or the same user is trying to be root twice here, won't work. | 3863 | { |
3863 | // Kill it. | 3864 | lock (agent) |
3864 | m_log.WarnFormat( | 3865 | { |
3865 | "[SCENE]: Existing root scene presence detected for {0} {1} in {2} when connecting. Removing existing presence.", | 3866 | CapsModule.SetAgentCapsSeeds(agent); |
3866 | sp.Name, sp.UUID, RegionInfo.RegionName); | 3867 | CapsModule.CreateCaps(agent.AgentID, agent.circuitcode); |
3868 | } | ||
3869 | } | ||
3870 | } | ||
3871 | |||
3872 | if (sp != null) | ||
3873 | { | ||
3874 | if (!sp.IsChildAgent) | ||
3875 | { | ||
3876 | // We have a zombie from a crashed session. | ||
3877 | // Or the same user is trying to be root twice here, won't work. | ||
3878 | // Kill it. | ||
3879 | m_log.WarnFormat( | ||
3880 | "[SCENE]: Existing root scene presence detected for {0} {1} in {2} when connecting. Removing existing presence.", | ||
3881 | sp.Name, sp.UUID, RegionInfo.RegionName); | ||
3867 | 3882 | ||
3868 | sp.ControllingClient.Close(true, true); | 3883 | sp.ControllingClient.Close(true, true); |
3869 | sp = null; | 3884 | sp = null; |
3885 | } | ||
3870 | } | 3886 | } |
3871 | 3887 | ||
3872 | lock (agent) | 3888 | lock (agent) |
@@ -3907,7 +3923,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
3907 | if (vialogin || (!m_seeIntoBannedRegion)) | 3923 | if (vialogin || (!m_seeIntoBannedRegion)) |
3908 | { | 3924 | { |
3909 | if (!AuthorizeUser(agent, out reason)) | 3925 | if (!AuthorizeUser(agent, out reason)) |
3926 | { | ||
3910 | return false; | 3927 | return false; |
3928 | } | ||
3911 | } | 3929 | } |
3912 | } | 3930 | } |
3913 | catch (Exception e) | 3931 | catch (Exception e) |
@@ -3922,11 +3940,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
3922 | RegionInfo.RegionName, (agent.child ? "child" : "root"), agent.firstname, agent.lastname, | 3940 | RegionInfo.RegionName, (agent.child ? "child" : "root"), agent.firstname, agent.lastname, |
3923 | agent.AgentID, agent.circuitcode); | 3941 | agent.AgentID, agent.circuitcode); |
3924 | 3942 | ||
3925 | if (CapsModule != null) | ||
3926 | { | ||
3927 | CapsModule.SetAgentCapsSeeds(agent); | ||
3928 | CapsModule.CreateCaps(agent.AgentID); | ||
3929 | } | ||
3930 | } | 3943 | } |
3931 | else | 3944 | else |
3932 | { | 3945 | { |
@@ -3952,6 +3965,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
3952 | agent.teleportFlags = teleportFlags; | 3965 | agent.teleportFlags = teleportFlags; |
3953 | m_authenticateHandler.AddNewCircuit(agent.circuitcode, agent); | 3966 | m_authenticateHandler.AddNewCircuit(agent.circuitcode, agent); |
3954 | 3967 | ||
3968 | if (CapsModule != null) | ||
3969 | { | ||
3970 | CapsModule.ActivateCaps(agent.circuitcode); | ||
3971 | } | ||
3972 | |||
3955 | if (vialogin) | 3973 | if (vialogin) |
3956 | { | 3974 | { |
3957 | // CleanDroppedAttachments(); | 3975 | // CleanDroppedAttachments(); |