diff options
author | Revolution | 2010-01-22 18:09:33 -0600 |
---|---|---|
committer | Melanie | 2010-01-23 15:18:52 +0000 |
commit | ec3c31e61e5e540f822891110df9bc978655bbaf (patch) | |
tree | b0b34a239eab48e163a3ca064edcd7567948423c /OpenSim/Region/CoreModules/Avatar/InstantMessage/PresenceModule.cs | |
parent | add a target position to agent updates to ScenePresence to support alternativ... (diff) | |
download | opensim-SC-ec3c31e61e5e540f822891110df9bc978655bbaf.zip opensim-SC-ec3c31e61e5e540f822891110df9bc978655bbaf.tar.gz opensim-SC-ec3c31e61e5e540f822891110df9bc978655bbaf.tar.bz2 opensim-SC-ec3c31e61e5e540f822891110df9bc978655bbaf.tar.xz |
Updates all IRegionModules to the new style region modules.
Signed-off-by: Melanie <melanie@t-data.com>
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/InstantMessage/PresenceModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/InstantMessage/PresenceModule.cs | 61 |
1 files changed, 41 insertions, 20 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/PresenceModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/PresenceModule.cs index f5ab454..f5498f4 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/PresenceModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/PresenceModule.cs | |||
@@ -24,11 +24,14 @@ | |||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | |||
28 | using System; | ||
27 | using System.Collections; | 29 | using System.Collections; |
28 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
29 | using System.Net; | 31 | using System.Net; |
30 | using System.Reflection; | 32 | using System.Reflection; |
31 | using log4net; | 33 | using log4net; |
34 | using Mono.Addins; | ||
32 | using Nini.Config; | 35 | using Nini.Config; |
33 | using Nwc.XmlRpc; | 36 | using Nwc.XmlRpc; |
34 | using OpenMetaverse; | 37 | using OpenMetaverse; |
@@ -39,7 +42,8 @@ using GridRegion = OpenSim.Services.Interfaces.GridRegion; | |||
39 | 42 | ||
40 | namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | 43 | namespace OpenSim.Region.CoreModules.Avatar.InstantMessage |
41 | { | 44 | { |
42 | public class PresenceModule : IRegionModule, IPresenceModule | 45 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] |
46 | public class PresenceModule : ISharedRegionModule, IPresenceModule | ||
43 | { | 47 | { |
44 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 48 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
45 | 49 | ||
@@ -59,7 +63,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
59 | public event PresenceChange OnPresenceChange; | 63 | public event PresenceChange OnPresenceChange; |
60 | public event BulkPresenceData OnBulkPresenceData; | 64 | public event BulkPresenceData OnBulkPresenceData; |
61 | 65 | ||
62 | public void Initialise(Scene scene, IConfigSource config) | 66 | public void Initialise(IConfigSource config) |
63 | { | 67 | { |
64 | lock (m_Scenes) | 68 | lock (m_Scenes) |
65 | { | 69 | { |
@@ -78,28 +82,38 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
78 | m_Gridmode = cnf.GetBoolean("gridmode", false); | 82 | m_Gridmode = cnf.GetBoolean("gridmode", false); |
79 | 83 | ||
80 | m_Enabled = true; | 84 | m_Enabled = true; |
81 | |||
82 | m_initialScene = scene; | ||
83 | } | 85 | } |
86 | } | ||
87 | } | ||
88 | |||
89 | public Type ReplaceableInterface | ||
90 | { | ||
91 | get { return null; } | ||
92 | } | ||
84 | 93 | ||
94 | public void AddRegion(Scene scene) | ||
95 | { | ||
96 | if (m_Enabled) | ||
97 | { | ||
98 | m_initialScene = scene; | ||
85 | if (m_Gridmode) | 99 | if (m_Gridmode) |
86 | NotifyMessageServerOfStartup(scene); | 100 | NotifyMessageServerOfStartup(scene); |
87 | 101 | ||
88 | m_Scenes.Add(scene); | 102 | m_Scenes.Add(scene); |
89 | } | ||
90 | 103 | ||
91 | scene.RegisterModuleInterface<IPresenceModule>(this); | 104 | scene.RegisterModuleInterface<IPresenceModule>(this); |
92 | 105 | ||
93 | scene.EventManager.OnNewClient += OnNewClient; | 106 | scene.EventManager.OnNewClient += OnNewClient; |
94 | scene.EventManager.OnSetRootAgentScene += OnSetRootAgentScene; | 107 | scene.EventManager.OnSetRootAgentScene += OnSetRootAgentScene; |
95 | scene.EventManager.OnMakeChildAgent += OnMakeChildAgent; | 108 | scene.EventManager.OnMakeChildAgent += OnMakeChildAgent; |
109 | } | ||
96 | } | 110 | } |
97 | 111 | ||
98 | public void PostInitialise() | 112 | public void RegionLoaded(Scene scene) |
99 | { | 113 | { |
100 | } | 114 | } |
101 | 115 | ||
102 | public void Close() | 116 | public void RemoveRegion(Scene scene) |
103 | { | 117 | { |
104 | if (!m_Gridmode || !m_Enabled) | 118 | if (!m_Gridmode || !m_Enabled) |
105 | return; | 119 | return; |
@@ -116,21 +130,28 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
116 | } | 130 | } |
117 | } | 131 | } |
118 | 132 | ||
119 | lock (m_Scenes) | 133 | NotifyMessageServerOfShutdown(scene); |
120 | { | 134 | if(m_Scenes.Contains(scene)) |
121 | foreach (Scene scene in m_Scenes) | 135 | m_Scenes.Remove(scene); |
122 | NotifyMessageServerOfShutdown(scene); | 136 | |
123 | } | 137 | scene.UnregisterModuleInterface<IPresenceModule>(this); |
138 | |||
139 | scene.EventManager.OnNewClient -= OnNewClient; | ||
140 | scene.EventManager.OnSetRootAgentScene -= OnSetRootAgentScene; | ||
141 | scene.EventManager.OnMakeChildAgent -= OnMakeChildAgent; | ||
124 | } | 142 | } |
125 | 143 | ||
126 | public string Name | 144 | public void PostInitialise() |
127 | { | 145 | { |
128 | get { return "PresenceModule"; } | ||
129 | } | 146 | } |
130 | 147 | ||
131 | public bool IsSharedModule | 148 | public void Close() |
132 | { | 149 | { |
133 | get { return true; } | 150 | } |
151 | |||
152 | public string Name | ||
153 | { | ||
154 | get { return "PresenceModule"; } | ||
134 | } | 155 | } |
135 | 156 | ||
136 | public void RequestBulkPresenceData(UUID[] users) | 157 | public void RequestBulkPresenceData(UUID[] users) |