aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Scenes')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs6
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneEvents.cs34
2 files changed, 38 insertions, 2 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 2237922..64c443d 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -1737,14 +1737,14 @@ namespace OpenSim.Region.Environment.Scenes
1737 Caps cap = 1737 Caps cap =
1738 new Caps(AssetCache, m_httpListener, m_regInfo.ExternalHostName, m_httpListener.Port, 1738 new Caps(AssetCache, m_httpListener, m_regInfo.ExternalHostName, m_httpListener.Port,
1739 capsObjectPath, agentId, m_dumpAssetsToFile); 1739 capsObjectPath, agentId, m_dumpAssetsToFile);
1740
1741 cap.RegisterHandlers(); 1740 cap.RegisterHandlers();
1741
1742 EventManager.TriggerOnRegisterCaps(agentId, cap);
1742 1743
1743 cap.AddNewInventoryItem = AddInventoryItem; 1744 cap.AddNewInventoryItem = AddInventoryItem;
1744 cap.ItemUpdatedCall = CapsUpdateInventoryItemAsset; 1745 cap.ItemUpdatedCall = CapsUpdateInventoryItemAsset;
1745 cap.TaskScriptUpdatedCall = CapsUpdateTaskInventoryScriptAsset; 1746 cap.TaskScriptUpdatedCall = CapsUpdateTaskInventoryScriptAsset;
1746 cap.CAPSFetchInventoryDescendents = CommsManager.UserProfileCacheService.HandleFetchInventoryDescendentsCAPS; 1747 cap.CAPSFetchInventoryDescendents = CommsManager.UserProfileCacheService.HandleFetchInventoryDescendentsCAPS;
1747 cap.CAPSGetUserDetails = CommsManager.UserProfileCacheService.GetUserDetails;
1748 1748
1749 m_capsHandlers[agentId] = cap; 1749 m_capsHandlers[agentId] = cap;
1750 } 1750 }
@@ -1764,6 +1764,8 @@ namespace OpenSim.Region.Environment.Scenes
1764 agentId, RegionInfo.RegionName); 1764 agentId, RegionInfo.RegionName);
1765 1765
1766 m_capsHandlers[agentId].DeregisterHandlers(); 1766 m_capsHandlers[agentId].DeregisterHandlers();
1767 EventManager.TriggerOnDeregisterCaps(agentId, m_capsHandlers[agentId]);
1768
1767 m_capsHandlers.Remove(agentId); 1769 m_capsHandlers.Remove(agentId);
1768 } 1770 }
1769 else 1771 else
diff --git a/OpenSim/Region/Environment/Scenes/SceneEvents.cs b/OpenSim/Region/Environment/Scenes/SceneEvents.cs
index 809507c..c916009 100644
--- a/OpenSim/Region/Environment/Scenes/SceneEvents.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneEvents.cs
@@ -29,6 +29,7 @@ using libsecondlife;
29using System; 29using System;
30using OpenSim.Framework; 30using OpenSim.Framework;
31using OpenSim.Region.Environment.Interfaces; 31using OpenSim.Region.Environment.Interfaces;
32using Caps = OpenSim.Region.Capabilities.Caps;
32 33
33namespace OpenSim.Region.Environment.Scenes 34namespace OpenSim.Region.Environment.Scenes
34{ 35{
@@ -136,6 +137,19 @@ namespace OpenSim.Region.Environment.Scenes
136 137
137 public event OnNewPresenceDelegate OnMakeChildAgent; 138 public event OnNewPresenceDelegate OnMakeChildAgent;
138 139
140 /// <summary>
141 /// RegisterCapsEvent is called by Scene after the Caps object
142 /// has been instantiated and before it is return to the
143 /// client and provides region modules to add their caps.
144 /// </summary>
145 public delegate void RegisterCapsEvent(LLUUID agentID, Caps caps);
146 public event RegisterCapsEvent OnRegisterCaps;
147 /// <summary>
148 /// DeregisterCapsEvent is called by Scene when the caps
149 /// handler for an agent are removed.
150 /// </summary>
151 public delegate void DeregisterCapsEvent(LLUUID agentID, Caps caps);
152 public event DeregisterCapsEvent OnDeregisterCaps;
139 153
140 public class MoneyTransferArgs : System.EventArgs 154 public class MoneyTransferArgs : System.EventArgs
141 { 155 {
@@ -191,6 +205,8 @@ namespace OpenSim.Region.Environment.Scenes
191 private ClientClosed handlerClientClosed = null; //OnClientClosed; 205 private ClientClosed handlerClientClosed = null; //OnClientClosed;
192 private OnNewPresenceDelegate handlerMakeChildAgent = null; //OnMakeChildAgent; 206 private OnNewPresenceDelegate handlerMakeChildAgent = null; //OnMakeChildAgent;
193 private OnTerrainTickDelegate handlerTerrainTick = null; // OnTerainTick; 207 private OnTerrainTickDelegate handlerTerrainTick = null; // OnTerainTick;
208 private RegisterCapsEvent handlerRegisterCaps = null; // OnRegisterCaps;
209 private DeregisterCapsEvent handlerDeregisterCaps = null; // OnDeregisterCaps;
194 210
195 public void TriggerOnScriptChangedEvent(uint localID, uint change) 211 public void TriggerOnScriptChangedEvent(uint localID, uint change)
196 { 212 {
@@ -428,5 +444,23 @@ namespace OpenSim.Region.Environment.Scenes
428 handlerMakeChildAgent(presence); 444 handlerMakeChildAgent(presence);
429 } 445 }
430 } 446 }
447
448 public void TriggerOnRegisterCaps(LLUUID agentID, Caps caps)
449 {
450 handlerRegisterCaps = OnRegisterCaps;
451 if (handlerRegisterCaps != null)
452 {
453 handlerRegisterCaps(agentID, caps);
454 }
455 }
456
457 public void TriggerOnDeregisterCaps(LLUUID agentID, Caps caps)
458 {
459 handlerDeregisterCaps = OnDeregisterCaps;
460 if (handlerDeregisterCaps != null)
461 {
462 handlerDeregisterCaps(agentID, caps);
463 }
464 }
431 } 465 }
432} 466}