diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/Framework/Caps')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs | 57 |
1 files changed, 39 insertions, 18 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs b/OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs index 6545a99..de8925d 100644 --- a/OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs +++ b/OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs | |||
@@ -57,7 +57,7 @@ namespace OpenSim.Region.CoreModules.Framework | |||
57 | /// <summary> | 57 | /// <summary> |
58 | /// Each agent has its own capabilities handler. | 58 | /// Each agent has its own capabilities handler. |
59 | /// </summary> | 59 | /// </summary> |
60 | protected Dictionary<UUID, Caps> m_capsObjects = new Dictionary<UUID, Caps>(); | 60 | protected Dictionary<uint, Caps> m_capsObjects = new Dictionary<uint, Caps>(); |
61 | 61 | ||
62 | protected Dictionary<UUID, string> m_capsPaths = new Dictionary<UUID, string>(); | 62 | protected Dictionary<UUID, string> m_capsPaths = new Dictionary<UUID, string>(); |
63 | 63 | ||
@@ -118,9 +118,10 @@ namespace OpenSim.Region.CoreModules.Framework | |||
118 | get { return null; } | 118 | get { return null; } |
119 | } | 119 | } |
120 | 120 | ||
121 | public void CreateCaps(UUID agentId) | 121 | public void CreateCaps(UUID agentId, uint circuitCode) |
122 | { | 122 | { |
123 | if (m_scene.RegionInfo.EstateSettings.IsBanned(agentId)) | 123 | int flags = m_scene.GetUserFlags(agentId); |
124 | if (m_scene.RegionInfo.EstateSettings.IsBanned(agentId, flags)) | ||
124 | return; | 125 | return; |
125 | 126 | ||
126 | Caps caps; | 127 | Caps caps; |
@@ -128,9 +129,9 @@ namespace OpenSim.Region.CoreModules.Framework | |||
128 | 129 | ||
129 | lock (m_capsObjects) | 130 | lock (m_capsObjects) |
130 | { | 131 | { |
131 | if (m_capsObjects.ContainsKey(agentId)) | 132 | if (m_capsObjects.ContainsKey(circuitCode)) |
132 | { | 133 | { |
133 | Caps oldCaps = m_capsObjects[agentId]; | 134 | Caps oldCaps = m_capsObjects[circuitCode]; |
134 | 135 | ||
135 | //m_log.WarnFormat( | 136 | //m_log.WarnFormat( |
136 | // "[CAPS]: Recreating caps for agent {0} in region {1}. Old caps path {2}, new caps path {3}. ", | 137 | // "[CAPS]: Recreating caps for agent {0} in region {1}. Old caps path {2}, new caps path {3}. ", |
@@ -141,13 +142,12 @@ namespace OpenSim.Region.CoreModules.Framework | |||
141 | (MainServer.Instance == null) ? 0: MainServer.Instance.Port, | 142 | (MainServer.Instance == null) ? 0: MainServer.Instance.Port, |
142 | capsObjectPath, agentId, m_scene.RegionInfo.RegionName); | 143 | capsObjectPath, agentId, m_scene.RegionInfo.RegionName); |
143 | 144 | ||
144 | m_capsObjects[agentId] = caps; | 145 | m_capsObjects[circuitCode] = caps; |
145 | } | 146 | } |
146 | |||
147 | m_scene.EventManager.TriggerOnRegisterCaps(agentId, caps); | 147 | m_scene.EventManager.TriggerOnRegisterCaps(agentId, caps); |
148 | } | 148 | } |
149 | 149 | ||
150 | public void RemoveCaps(UUID agentId) | 150 | public void RemoveCaps(UUID agentId, uint circuitCode) |
151 | { | 151 | { |
152 | m_log.DebugFormat("[CAPS]: Remove caps for agent {0} in region {1}", agentId, m_scene.RegionInfo.RegionName); | 152 | m_log.DebugFormat("[CAPS]: Remove caps for agent {0} in region {1}", agentId, m_scene.RegionInfo.RegionName); |
153 | lock (m_childrenSeeds) | 153 | lock (m_childrenSeeds) |
@@ -160,11 +160,11 @@ namespace OpenSim.Region.CoreModules.Framework | |||
160 | 160 | ||
161 | lock (m_capsObjects) | 161 | lock (m_capsObjects) |
162 | { | 162 | { |
163 | if (m_capsObjects.ContainsKey(agentId)) | 163 | if (m_capsObjects.ContainsKey(circuitCode)) |
164 | { | 164 | { |
165 | m_capsObjects[agentId].DeregisterHandlers(); | 165 | m_capsObjects[circuitCode].DeregisterHandlers(); |
166 | m_scene.EventManager.TriggerOnDeregisterCaps(agentId, m_capsObjects[agentId]); | 166 | m_scene.EventManager.TriggerOnDeregisterCaps(agentId, m_capsObjects[circuitCode]); |
167 | m_capsObjects.Remove(agentId); | 167 | m_capsObjects.Remove(circuitCode); |
168 | } | 168 | } |
169 | else | 169 | else |
170 | { | 170 | { |
@@ -175,19 +175,30 @@ namespace OpenSim.Region.CoreModules.Framework | |||
175 | } | 175 | } |
176 | } | 176 | } |
177 | 177 | ||
178 | public Caps GetCapsForUser(UUID agentId) | 178 | public Caps GetCapsForUser(uint circuitCode) |
179 | { | 179 | { |
180 | lock (m_capsObjects) | 180 | lock (m_capsObjects) |
181 | { | 181 | { |
182 | if (m_capsObjects.ContainsKey(agentId)) | 182 | if (m_capsObjects.ContainsKey(circuitCode)) |
183 | { | 183 | { |
184 | return m_capsObjects[agentId]; | 184 | return m_capsObjects[circuitCode]; |
185 | } | 185 | } |
186 | } | 186 | } |
187 | 187 | ||
188 | return null; | 188 | return null; |
189 | } | 189 | } |
190 | 190 | ||
191 | public void ActivateCaps(uint circuitCode) | ||
192 | { | ||
193 | lock (m_capsObjects) | ||
194 | { | ||
195 | if (m_capsObjects.ContainsKey(circuitCode)) | ||
196 | { | ||
197 | m_capsObjects[circuitCode].Activate(); | ||
198 | } | ||
199 | } | ||
200 | } | ||
201 | |||
191 | public void SetAgentCapsSeeds(AgentCircuitData agent) | 202 | public void SetAgentCapsSeeds(AgentCircuitData agent) |
192 | { | 203 | { |
193 | lock (m_capsPaths) | 204 | lock (m_capsPaths) |
@@ -287,9 +298,9 @@ namespace OpenSim.Region.CoreModules.Framework | |||
287 | 298 | ||
288 | lock (m_capsObjects) | 299 | lock (m_capsObjects) |
289 | { | 300 | { |
290 | foreach (KeyValuePair<UUID, Caps> kvp in m_capsObjects) | 301 | foreach (KeyValuePair<uint, Caps> kvp in m_capsObjects) |
291 | { | 302 | { |
292 | capsReport.AppendFormat("** User {0}:\n", kvp.Key); | 303 | capsReport.AppendFormat("** Circuit {0}:\n", kvp.Key); |
293 | Caps caps = kvp.Value; | 304 | Caps caps = kvp.Value; |
294 | 305 | ||
295 | for (IDictionaryEnumerator kvp2 = caps.CapsHandlers.GetCapsDetails(false, null).GetEnumerator(); kvp2.MoveNext(); ) | 306 | for (IDictionaryEnumerator kvp2 = caps.CapsHandlers.GetCapsDetails(false, null).GetEnumerator(); kvp2.MoveNext(); ) |
@@ -337,6 +348,7 @@ namespace OpenSim.Region.CoreModules.Framework | |||
337 | 348 | ||
338 | private void BuildDetailedStatsByCapReport(StringBuilder sb, string capName) | 349 | private void BuildDetailedStatsByCapReport(StringBuilder sb, string capName) |
339 | { | 350 | { |
351 | /* | ||
340 | sb.AppendFormat("Capability name {0}\n", capName); | 352 | sb.AppendFormat("Capability name {0}\n", capName); |
341 | 353 | ||
342 | ConsoleDisplayTable cdt = new ConsoleDisplayTable(); | 354 | ConsoleDisplayTable cdt = new ConsoleDisplayTable(); |
@@ -382,10 +394,12 @@ namespace OpenSim.Region.CoreModules.Framework | |||
382 | } | 394 | } |
383 | 395 | ||
384 | sb.Append(cdt.ToString()); | 396 | sb.Append(cdt.ToString()); |
397 | */ | ||
385 | } | 398 | } |
386 | 399 | ||
387 | private void BuildSummaryStatsByCapReport(StringBuilder sb) | 400 | private void BuildSummaryStatsByCapReport(StringBuilder sb) |
388 | { | 401 | { |
402 | /* | ||
389 | ConsoleDisplayTable cdt = new ConsoleDisplayTable(); | 403 | ConsoleDisplayTable cdt = new ConsoleDisplayTable(); |
390 | cdt.AddColumn("Name", 34); | 404 | cdt.AddColumn("Name", 34); |
391 | cdt.AddColumn("Req Received", 12); | 405 | cdt.AddColumn("Req Received", 12); |
@@ -442,10 +456,12 @@ namespace OpenSim.Region.CoreModules.Framework | |||
442 | cdt.AddRow(kvp.Key, kvp.Value, handledStats[kvp.Key]); | 456 | cdt.AddRow(kvp.Key, kvp.Value, handledStats[kvp.Key]); |
443 | 457 | ||
444 | sb.Append(cdt.ToString()); | 458 | sb.Append(cdt.ToString()); |
459 | */ | ||
445 | } | 460 | } |
446 | 461 | ||
447 | private void HandleShowCapsStatsByUserCommand(string module, string[] cmdParams) | 462 | private void HandleShowCapsStatsByUserCommand(string module, string[] cmdParams) |
448 | { | 463 | { |
464 | /* | ||
449 | if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != m_scene) | 465 | if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != m_scene) |
450 | return; | 466 | return; |
451 | 467 | ||
@@ -476,10 +492,12 @@ namespace OpenSim.Region.CoreModules.Framework | |||
476 | } | 492 | } |
477 | 493 | ||
478 | MainConsole.Instance.Output(sb.ToString()); | 494 | MainConsole.Instance.Output(sb.ToString()); |
495 | */ | ||
479 | } | 496 | } |
480 | 497 | ||
481 | private void BuildDetailedStatsByUserReport(StringBuilder sb, ScenePresence sp) | 498 | private void BuildDetailedStatsByUserReport(StringBuilder sb, ScenePresence sp) |
482 | { | 499 | { |
500 | /* | ||
483 | sb.AppendFormat("Avatar name {0}, type {1}\n", sp.Name, sp.IsChildAgent ? "child" : "root"); | 501 | sb.AppendFormat("Avatar name {0}, type {1}\n", sp.Name, sp.IsChildAgent ? "child" : "root"); |
484 | 502 | ||
485 | ConsoleDisplayTable cdt = new ConsoleDisplayTable(); | 503 | ConsoleDisplayTable cdt = new ConsoleDisplayTable(); |
@@ -505,10 +523,12 @@ namespace OpenSim.Region.CoreModules.Framework | |||
505 | cdt.AddRow(ctr.Name, ctr.RequestsReceived, ctr.RequestsHandled); | 523 | cdt.AddRow(ctr.Name, ctr.RequestsReceived, ctr.RequestsHandled); |
506 | 524 | ||
507 | sb.Append(cdt.ToString()); | 525 | sb.Append(cdt.ToString()); |
526 | */ | ||
508 | } | 527 | } |
509 | 528 | ||
510 | private void BuildSummaryStatsByUserReport(StringBuilder sb) | 529 | private void BuildSummaryStatsByUserReport(StringBuilder sb) |
511 | { | 530 | { |
531 | /* | ||
512 | ConsoleDisplayTable cdt = new ConsoleDisplayTable(); | 532 | ConsoleDisplayTable cdt = new ConsoleDisplayTable(); |
513 | cdt.AddColumn("Name", 32); | 533 | cdt.AddColumn("Name", 32); |
514 | cdt.AddColumn("Type", 5); | 534 | cdt.AddColumn("Type", 5); |
@@ -548,6 +568,7 @@ namespace OpenSim.Region.CoreModules.Framework | |||
548 | ); | 568 | ); |
549 | 569 | ||
550 | sb.Append(cdt.ToString()); | 570 | sb.Append(cdt.ToString()); |
571 | */ | ||
551 | } | 572 | } |
552 | 573 | ||
553 | private class CapTableRow | 574 | private class CapTableRow |
@@ -564,4 +585,4 @@ namespace OpenSim.Region.CoreModules.Framework | |||
564 | } | 585 | } |
565 | } | 586 | } |
566 | } | 587 | } |
567 | } \ No newline at end of file | 588 | } |