aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules
diff options
context:
space:
mode:
authorDiva Canto2011-05-01 18:22:53 -0700
committerDiva Canto2011-05-01 18:22:53 -0700
commitf79400e94ca6f8b609f5d4cbe25c5bbc04b61b77 (patch)
tree72fd894344eb030fab78be76475afae17c90a02a /OpenSim/Region/CoreModules
parentChange GetTextureModule.cs to conform to the new IRegion module interface. NO... (diff)
downloadopensim-SC-f79400e94ca6f8b609f5d4cbe25c5bbc04b61b77.zip
opensim-SC-f79400e94ca6f8b609f5d4cbe25c5bbc04b61b77.tar.gz
opensim-SC-f79400e94ca6f8b609f5d4cbe25c5bbc04b61b77.tar.bz2
opensim-SC-f79400e94ca6f8b609f5d4cbe25c5bbc04b61b77.tar.xz
Broke down Caps.cs into a generic Caps object that simply registers/unregisters capabilities and a specific bunch of capability implementations in Linden space called BunchOfCaps.
Renamed a few methods that were misnomers. Compiles but doesn't work.
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r--OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs50
-rw-r--r--OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs4
2 files changed, 22 insertions, 32 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs b/OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs
index e684a0d..5e22c8c 100644
--- a/OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs
@@ -51,7 +51,7 @@ namespace OpenSim.Region.CoreModules.Framework
51 /// <summary> 51 /// <summary>
52 /// Each agent has its own capabilities handler. 52 /// Each agent has its own capabilities handler.
53 /// </summary> 53 /// </summary>
54 protected Dictionary<UUID, Caps> m_capsHandlers = new Dictionary<UUID, Caps>(); 54 protected Dictionary<UUID, Caps> m_capsObjects = new Dictionary<UUID, Caps>();
55 55
56 protected Dictionary<UUID, string> capsPaths = new Dictionary<UUID, string>(); 56 protected Dictionary<UUID, string> capsPaths = new Dictionary<UUID, string>();
57 protected Dictionary<UUID, Dictionary<ulong, string>> childrenSeeds 57 protected Dictionary<UUID, Dictionary<ulong, string>> childrenSeeds
@@ -95,19 +95,19 @@ namespace OpenSim.Region.CoreModules.Framework
95 get { return null; } 95 get { return null; }
96 } 96 }
97 97
98 public void AddCapsHandler(UUID agentId) 98 public void CreateCaps(UUID agentId)
99 { 99 {
100 if (m_scene.RegionInfo.EstateSettings.IsBanned(agentId)) 100 if (m_scene.RegionInfo.EstateSettings.IsBanned(agentId))
101 return; 101 return;
102 102
103 String capsObjectPath = GetCapsPath(agentId); 103 String capsObjectPath = GetCapsPath(agentId);
104 104
105 if (m_capsHandlers.ContainsKey(agentId)) 105 if (m_capsObjects.ContainsKey(agentId))
106 { 106 {
107 Caps oldCaps = m_capsHandlers[agentId]; 107 Caps oldCaps = m_capsObjects[agentId];
108 108
109 m_log.DebugFormat( 109 m_log.DebugFormat(
110 "[CAPS]: Reregistering caps for agent {0}. Old caps path {1}, new caps path {2}. ", 110 "[CAPS]: Recreating caps for agent {0}. Old caps path {1}, new caps path {2}. ",
111 agentId, oldCaps.CapsObjectPath, capsObjectPath); 111 agentId, oldCaps.CapsObjectPath, capsObjectPath);
112 // This should not happen. The caller code is confused. We need to fix that. 112 // This should not happen. The caller code is confused. We need to fix that.
113 // CAPs can never be reregistered, or the client will be confused. 113 // CAPs can never be reregistered, or the client will be confused.
@@ -115,39 +115,29 @@ namespace OpenSim.Region.CoreModules.Framework
115 //return; 115 //return;
116 } 116 }
117 117
118 Caps caps 118 Caps caps = new Caps(MainServer.Instance, m_scene.RegionInfo.ExternalHostName,
119 = new Caps(m_scene,
120 m_scene.AssetService, MainServer.Instance, m_scene.RegionInfo.ExternalHostName,
121 (MainServer.Instance == null) ? 0: MainServer.Instance.Port, 119 (MainServer.Instance == null) ? 0: MainServer.Instance.Port,
122 capsObjectPath, agentId, m_scene.DumpAssetsToFile, m_scene.RegionInfo.RegionName); 120 capsObjectPath, agentId, m_scene.RegionInfo.RegionName);
123 121
124 caps.RegisterHandlers(); 122 m_capsObjects[agentId] = caps;
125 123
126 m_scene.EventManager.TriggerOnRegisterCaps(agentId, caps); 124 m_scene.EventManager.TriggerOnRegisterCaps(agentId, caps);
127
128 caps.AddNewInventoryItem = m_scene.AddUploadedInventoryItem;
129 caps.ItemUpdatedCall = m_scene.CapsUpdateInventoryItemAsset;
130 caps.TaskScriptUpdatedCall = m_scene.CapsUpdateTaskInventoryScriptAsset;
131 caps.CAPSFetchInventoryDescendents = m_scene.HandleFetchInventoryDescendentsCAPS;
132 caps.GetClient = m_scene.SceneContents.GetControllingClient;
133
134 m_capsHandlers[agentId] = caps;
135 } 125 }
136 126
137 public void RemoveCapsHandler(UUID agentId) 127 public void RemoveCaps(UUID agentId)
138 { 128 {
139 if (childrenSeeds.ContainsKey(agentId)) 129 if (childrenSeeds.ContainsKey(agentId))
140 { 130 {
141 childrenSeeds.Remove(agentId); 131 childrenSeeds.Remove(agentId);
142 } 132 }
143 133
144 lock (m_capsHandlers) 134 lock (m_capsObjects)
145 { 135 {
146 if (m_capsHandlers.ContainsKey(agentId)) 136 if (m_capsObjects.ContainsKey(agentId))
147 { 137 {
148 m_capsHandlers[agentId].DeregisterHandlers(); 138 m_capsObjects[agentId].DeregisterHandlers();
149 m_scene.EventManager.TriggerOnDeregisterCaps(agentId, m_capsHandlers[agentId]); 139 m_scene.EventManager.TriggerOnDeregisterCaps(agentId, m_capsObjects[agentId]);
150 m_capsHandlers.Remove(agentId); 140 m_capsObjects.Remove(agentId);
151 } 141 }
152 else 142 else
153 { 143 {
@@ -158,20 +148,20 @@ namespace OpenSim.Region.CoreModules.Framework
158 } 148 }
159 } 149 }
160 150
161 public Caps GetCapsHandlerForUser(UUID agentId) 151 public Caps GetCapsForUser(UUID agentId)
162 { 152 {
163 lock (m_capsHandlers) 153 lock (m_capsObjects)
164 { 154 {
165 if (m_capsHandlers.ContainsKey(agentId)) 155 if (m_capsObjects.ContainsKey(agentId))
166 { 156 {
167 return m_capsHandlers[agentId]; 157 return m_capsObjects[agentId];
168 } 158 }
169 } 159 }
170 160
171 return null; 161 return null;
172 } 162 }
173 163
174 public void NewUserConnection(AgentCircuitData agent) 164 public void SetAgentCapsSeeds(AgentCircuitData agent)
175 { 165 {
176 capsPaths[agent.AgentID] = agent.CapsPath; 166 capsPaths[agent.AgentID] = agent.CapsPath;
177 childrenSeeds[agent.AgentID] 167 childrenSeeds[agent.AgentID]
@@ -241,7 +231,7 @@ namespace OpenSim.Region.CoreModules.Framework
241 System.Text.StringBuilder caps = new System.Text.StringBuilder(); 231 System.Text.StringBuilder caps = new System.Text.StringBuilder();
242 caps.AppendFormat("Region {0}:\n", m_scene.RegionInfo.RegionName); 232 caps.AppendFormat("Region {0}:\n", m_scene.RegionInfo.RegionName);
243 233
244 foreach (KeyValuePair<UUID, Caps> kvp in m_capsHandlers) 234 foreach (KeyValuePair<UUID, Caps> kvp in m_capsObjects)
245 { 235 {
246 caps.AppendFormat("** User {0}:\n", kvp.Key); 236 caps.AppendFormat("** User {0}:\n", kvp.Key);
247 for (IDictionaryEnumerator kvp2 = kvp.Value.CapsHandlers.CapsDetails.GetEnumerator(); kvp2.MoveNext(); ) 237 for (IDictionaryEnumerator kvp2 = kvp.Value.CapsHandlers.CapsDetails.GetEnumerator(); kvp2.MoveNext(); )
diff --git a/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs b/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs
index 2dd7767..07999d1 100644
--- a/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs
+++ b/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs
@@ -575,7 +575,7 @@ namespace OpenSim.Region.CoreModules.InterGrid
575 string derezAvatarPath = "/agent/" + AvatarRezCapUUID + "/rez_avatar/derez"; 575 string derezAvatarPath = "/agent/" + AvatarRezCapUUID + "/rez_avatar/derez";
576 // Get a reference to the user's cap so we can pull out the Caps Object Path 576 // Get a reference to the user's cap so we can pull out the Caps Object Path
577 Caps userCap 577 Caps userCap
578 = homeScene.CapsModule.GetCapsHandlerForUser(agentData.AgentID); 578 = homeScene.CapsModule.GetCapsForUser(agentData.AgentID);
579 579
580 string rezHttpProtocol = "http://"; 580 string rezHttpProtocol = "http://";
581 string regionCapsHttpProtocol = "http://"; 581 string regionCapsHttpProtocol = "http://";
@@ -700,7 +700,7 @@ namespace OpenSim.Region.CoreModules.InterGrid
700 { 700 {
701 // Get a referenceokay - to their Cap object so we can pull out the capobjectroot 701 // Get a referenceokay - to their Cap object so we can pull out the capobjectroot
702 Caps userCap 702 Caps userCap
703 = homeScene.CapsModule.GetCapsHandlerForUser(userData.AgentID); 703 = homeScene.CapsModule.GetCapsForUser(userData.AgentID);
704 704
705 //Update the circuit data in the region so this user is authorized 705 //Update the circuit data in the region so this user is authorized
706 homeScene.UpdateCircuitData(userData); 706 homeScene.UpdateCircuitData(userData);