diff options
author | Justin Clarke Casey | 2008-04-03 15:44:20 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-04-03 15:44:20 +0000 |
commit | 042cd57e948f6e3695d1d5b2b2a473ee77a1e9c4 (patch) | |
tree | 347f7abdb075b4acba5ece213d667c7c562c99fb /OpenSim/Region/Environment/Scenes | |
parent | * Minor: fix doc glitch (diff) | |
download | opensim-SC-042cd57e948f6e3695d1d5b2b2a473ee77a1e9c4.zip opensim-SC-042cd57e948f6e3695d1d5b2b2a473ee77a1e9c4.tar.gz opensim-SC-042cd57e948f6e3695d1d5b2b2a473ee77a1e9c4.tar.bz2 opensim-SC-042cd57e948f6e3695d1d5b2b2a473ee77a1e9c4.tar.xz |
* From: Dr Scofield <hud@zurich.ibm.com>
* This patch removes voice code into a region module. This required the implementation of events and other code to allow region modules to register their own caps handlers, and should allow different voice module implementations.
* CAVEAT: This does not provide complete voice support, it merely provides the hooks so that it can be plugged in.
Diffstat (limited to 'OpenSim/Region/Environment/Scenes')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 6 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneEvents.cs | 34 |
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; | |||
29 | using System; | 29 | using System; |
30 | using OpenSim.Framework; | 30 | using OpenSim.Framework; |
31 | using OpenSim.Region.Environment.Interfaces; | 31 | using OpenSim.Region.Environment.Interfaces; |
32 | using Caps = OpenSim.Region.Capabilities.Caps; | ||
32 | 33 | ||
33 | namespace OpenSim.Region.Environment.Scenes | 34 | namespace 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 | } |