From 8a24f61acd4623c9a78c9dca41ed7c0fddcdabc7 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Thu, 22 Jan 2009 17:51:47 +0000 Subject: * Change the currently misleading log message when capabilities are added twice, and provide some more information * No functional change * It strikes me that there may be caps problems if double registration is presented if cleanup failed for a previous agent (so a caps handler will remain in memory for that agent but with a different seed). This needs investigation --- .../Agent/Capabilities/CapabilitiesModule.cs | 31 +++++++++++----------- .../Hypergrid/HGSceneCommunicationService.cs | 2 +- 2 files changed, 17 insertions(+), 16 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Environment/Modules/Agent/Capabilities/CapabilitiesModule.cs b/OpenSim/Region/Environment/Modules/Agent/Capabilities/CapabilitiesModule.cs index 838851c..070736e 100644 --- a/OpenSim/Region/Environment/Modules/Agent/Capabilities/CapabilitiesModule.cs +++ b/OpenSim/Region/Environment/Modules/Agent/Capabilities/CapabilitiesModule.cs @@ -73,32 +73,33 @@ namespace OpenSim.Region.Environment.Modules.Agent.Capabilities String capsObjectPath = GetCapsPath(agentId); - Caps cap = null; - if (m_capsHandlers.TryGetValue(agentId, out cap)) + if (m_capsHandlers.ContainsKey(agentId)) { + Caps oldCaps = m_capsHandlers[agentId]; + m_log.DebugFormat( - "[CAPS]: Attempt at registering twice for the same agent {0}. {1}. Ignoring.", - agentId, capsObjectPath); + "[CAPS]: Reregistering caps for agent {0}. Old caps path {1}, new caps path {2}", + agentId, oldCaps.CapsObjectPath, capsObjectPath); //return; } - cap + Caps caps = new Caps( m_scene.AssetCache, m_scene.CommsManager.HttpServer, m_scene.RegionInfo.ExternalHostName, m_scene.CommsManager.HttpServer.Port, capsObjectPath, agentId, m_scene.DumpAssetsToFile, m_scene.RegionInfo.RegionName); - cap.RegisterHandlers(); + caps.RegisterHandlers(); - m_scene.EventManager.TriggerOnRegisterCaps(agentId, cap); + m_scene.EventManager.TriggerOnRegisterCaps(agentId, caps); - cap.AddNewInventoryItem = m_scene.AddUploadedInventoryItem; - cap.ItemUpdatedCall = m_scene.CapsUpdateInventoryItemAsset; - cap.TaskScriptUpdatedCall = m_scene.CapsUpdateTaskInventoryScriptAsset; - cap.CAPSFetchInventoryDescendents = m_scene.HandleFetchInventoryDescendentsCAPS; - cap.GetClient = m_scene.m_sceneGraph.GetControllingClient; + caps.AddNewInventoryItem = m_scene.AddUploadedInventoryItem; + caps.ItemUpdatedCall = m_scene.CapsUpdateInventoryItemAsset; + caps.TaskScriptUpdatedCall = m_scene.CapsUpdateTaskInventoryScriptAsset; + caps.CAPSFetchInventoryDescendents = m_scene.HandleFetchInventoryDescendentsCAPS; + caps.GetClient = m_scene.m_sceneGraph.GetControllingClient; - m_capsHandlers[agentId] = cap; + m_capsHandlers[agentId] = caps; } public void RemoveCapsHandler(UUID agentId) @@ -114,7 +115,6 @@ namespace OpenSim.Region.Environment.Modules.Agent.Capabilities { m_capsHandlers[agentId].DeregisterHandlers(); m_scene.EventManager.TriggerOnDeregisterCaps(agentId, m_capsHandlers[agentId]); - m_capsHandlers.Remove(agentId); } else @@ -142,7 +142,8 @@ namespace OpenSim.Region.Environment.Modules.Agent.Capabilities public void NewUserConnection(AgentCircuitData agent) { capsPaths[agent.AgentID] = agent.CapsPath; - childrenSeeds[agent.AgentID] = ((agent.ChildrenCapSeeds == null) ? new Dictionary() : agent.ChildrenCapSeeds); + childrenSeeds[agent.AgentID] + = ((agent.ChildrenCapSeeds == null) ? new Dictionary() : agent.ChildrenCapSeeds); } public string GetCapsPath(UUID agentId) diff --git a/OpenSim/Region/Environment/Scenes/Hypergrid/HGSceneCommunicationService.cs b/OpenSim/Region/Environment/Scenes/Hypergrid/HGSceneCommunicationService.cs index 76d1cba..5e3e03f 100644 --- a/OpenSim/Region/Environment/Scenes/Hypergrid/HGSceneCommunicationService.cs +++ b/OpenSim/Region/Environment/Scenes/Hypergrid/HGSceneCommunicationService.cs @@ -149,11 +149,11 @@ namespace OpenSim.Region.Environment.Scenes.Hypergrid if (destRegionUp) { - // Fixing a bug where teleporting while sitting results in the avatar ending up removed from // both regions if (avatar.ParentID != (uint)0) avatar.StandUp(); + if (!avatar.ValidateAttachments()) { avatar.ControllingClient.SendTeleportFailed("Inconsistent attachment state"); -- cgit v1.1