diff options
author | Melanie | 2010-01-29 07:20:13 +0000 |
---|---|---|
committer | Melanie | 2010-01-29 07:21:06 +0000 |
commit | a87a247f0548d39a8c39b1d28123d7da8db44598 (patch) | |
tree | 7f9f77c38a224bc6d4bea7ccced1d4710c8a91b1 /OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs | |
parent | Merge branch 'master' of melanie@opensimulator.org:/var/git/opensim (diff) | |
download | opensim-SC-a87a247f0548d39a8c39b1d28123d7da8db44598.zip opensim-SC-a87a247f0548d39a8c39b1d28123d7da8db44598.tar.gz opensim-SC-a87a247f0548d39a8c39b1d28123d7da8db44598.tar.bz2 opensim-SC-a87a247f0548d39a8c39b1d28123d7da8db44598.tar.xz |
Revert "Updates all IRegionModules to the new style region modules."
This reverts commit ec3c31e61e5e540f822891110df9bc978655bbaf.
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs | 54 |
1 files changed, 13 insertions, 41 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs index 7254180..086d4fe 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs | |||
@@ -31,7 +31,6 @@ using System.Collections.Generic; | |||
31 | using System.Net; | 31 | using System.Net; |
32 | using System.Reflection; | 32 | using System.Reflection; |
33 | using log4net; | 33 | using log4net; |
34 | using Mono.Addins; | ||
35 | using Nini.Config; | 34 | using Nini.Config; |
36 | using Nwc.XmlRpc; | 35 | using Nwc.XmlRpc; |
37 | using OpenMetaverse; | 36 | using OpenMetaverse; |
@@ -82,8 +81,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
82 | - Terminate Friendship messages (single) | 81 | - Terminate Friendship messages (single) |
83 | */ | 82 | */ |
84 | 83 | ||
85 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] | 84 | public class FriendsModule : IRegionModule, IFriendsModule |
86 | public class FriendsModule : ISharedRegionModule, IFriendsModule | ||
87 | { | 85 | { |
88 | private class Transaction | 86 | private class Transaction |
89 | { | 87 | { |
@@ -113,23 +111,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
113 | 111 | ||
114 | private IGridService m_gridServices = null; | 112 | private IGridService m_gridServices = null; |
115 | 113 | ||
116 | #region ISharedRegionModule Members | 114 | #region IRegionModule Members |
117 | 115 | ||
118 | public void Initialise(IConfigSource config) | 116 | public void Initialise(Scene scene, IConfigSource config) |
119 | { | ||
120 | |||
121 | } | ||
122 | |||
123 | public void PostInitialise() | ||
124 | { | ||
125 | } | ||
126 | |||
127 | public Type ReplaceableInterface | ||
128 | { | ||
129 | get { return null; } | ||
130 | } | ||
131 | |||
132 | public void AddRegion(Scene scene) | ||
133 | { | 117 | { |
134 | lock (m_scenes) | 118 | lock (m_scenes) |
135 | { | 119 | { |
@@ -144,9 +128,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
144 | if (!m_scenes.ContainsKey(scene.RegionInfo.RegionHandle)) | 128 | if (!m_scenes.ContainsKey(scene.RegionInfo.RegionHandle)) |
145 | m_scenes[scene.RegionInfo.RegionHandle] = scene; | 129 | m_scenes[scene.RegionInfo.RegionHandle] = scene; |
146 | } | 130 | } |
147 | 131 | ||
148 | scene.RegisterModuleInterface<IFriendsModule>(this); | 132 | scene.RegisterModuleInterface<IFriendsModule>(this); |
149 | 133 | ||
150 | scene.EventManager.OnNewClient += OnNewClient; | 134 | scene.EventManager.OnNewClient += OnNewClient; |
151 | scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage; | 135 | scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage; |
152 | scene.EventManager.OnAvatarEnteringNewParcel += AvatarEnteringParcel; | 136 | scene.EventManager.OnAvatarEnteringNewParcel += AvatarEnteringParcel; |
@@ -154,34 +138,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
154 | scene.EventManager.OnClientClosed += ClientClosed; | 138 | scene.EventManager.OnClientClosed += ClientClosed; |
155 | } | 139 | } |
156 | 140 | ||
157 | public void RegionLoaded(Scene scene) | 141 | public void PostInitialise() |
158 | { | 142 | { |
159 | if (m_scenes.Count > 0) | 143 | if (m_scenes.Count > 0) |
160 | { | 144 | { |
161 | m_TransferModule = scene.RequestModuleInterface<IMessageTransferModule>(); | 145 | m_TransferModule = m_initialScene.RequestModuleInterface<IMessageTransferModule>(); |
162 | m_gridServices = scene.GridService; | 146 | m_gridServices = m_initialScene.GridService; |
163 | } | 147 | } |
164 | if (m_TransferModule == null) | 148 | if (m_TransferModule == null) |
165 | m_log.Error("[FRIENDS]: Unable to find a message transfer module, friendship offers will not work"); | 149 | m_log.Error("[FRIENDS]: Unable to find a message transfer module, friendship offers will not work"); |
166 | } | 150 | } |
167 | 151 | ||
168 | public void RemoveRegion(Scene scene) | ||
169 | { | ||
170 | MainServer.Instance.RemoveXmlRPCHandler("presence_update_bulk"); | ||
171 | MainServer.Instance.RemoveXmlRPCHandler("terminate_friend"); | ||
172 | |||
173 | if (m_scenes.ContainsKey(scene.RegionInfo.RegionHandle)) | ||
174 | m_scenes.Remove(scene.RegionInfo.RegionHandle); | ||
175 | |||
176 | scene.UnregisterModuleInterface<IFriendsModule>(this); | ||
177 | |||
178 | scene.EventManager.OnNewClient -= OnNewClient; | ||
179 | scene.EventManager.OnIncomingInstantMessage -= OnGridInstantMessage; | ||
180 | scene.EventManager.OnAvatarEnteringNewParcel -= AvatarEnteringParcel; | ||
181 | scene.EventManager.OnMakeChildAgent -= MakeChildAgent; | ||
182 | scene.EventManager.OnClientClosed -= ClientClosed; | ||
183 | } | ||
184 | |||
185 | public void Close() | 152 | public void Close() |
186 | { | 153 | { |
187 | } | 154 | } |
@@ -191,6 +158,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
191 | get { return "FriendsModule"; } | 158 | get { return "FriendsModule"; } |
192 | } | 159 | } |
193 | 160 | ||
161 | public bool IsSharedModule | ||
162 | { | ||
163 | get { return true; } | ||
164 | } | ||
165 | |||
194 | #endregion | 166 | #endregion |
195 | 167 | ||
196 | #region IInterregionFriendsComms | 168 | #region IInterregionFriendsComms |