diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/LocalPresenceServiceConnector.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/LocalPresenceServiceConnector.cs | 113 |
1 files changed, 8 insertions, 105 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/LocalPresenceServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/LocalPresenceServiceConnector.cs index 49dd633..db5c520 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/LocalPresenceServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/LocalPresenceServiceConnector.cs | |||
@@ -24,51 +24,29 @@ | |||
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 | |||
27 | using System; | 28 | using System; |
28 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
29 | using System.Reflection; | 30 | using System.Reflection; |
30 | 31 | using log4net; | |
32 | using Mono.Addins; | ||
33 | using Nini.Config; | ||
34 | using OpenMetaverse; | ||
31 | using OpenSim.Region.Framework.Interfaces; | 35 | using OpenSim.Region.Framework.Interfaces; |
32 | using OpenSim.Region.Framework.Scenes; | 36 | using OpenSim.Region.Framework.Scenes; |
33 | using OpenSim.Server.Base; | 37 | using OpenSim.Server.Base; |
34 | using OpenSim.Services.Interfaces; | 38 | using OpenSim.Services.Interfaces; |
35 | using PresenceInfo = OpenSim.Services.Interfaces.PresenceInfo; | 39 | using PresenceInfo = OpenSim.Services.Interfaces.PresenceInfo; |
36 | 40 | ||
37 | using OpenMetaverse; | ||
38 | using log4net; | ||
39 | using Nini.Config; | ||
40 | |||
41 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence | 41 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence |
42 | { | 42 | { |
43 | public class LocalPresenceServicesConnector : ISharedRegionModule, IPresenceService | 43 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "LocalPresenceServicesConnector")] |
44 | public class LocalPresenceServicesConnector : BasePresenceServiceConnector, ISharedRegionModule, IPresenceService | ||
44 | { | 45 | { |
45 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 46 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
46 | 47 | ||
47 | private bool m_Enabled = false; | ||
48 | |||
49 | private PresenceDetector m_PresenceDetector; | ||
50 | |||
51 | /// <summary> | ||
52 | /// Underlying presence service. Do not use directly. | ||
53 | /// </summary> | ||
54 | public IPresenceService m_PresenceService; | ||
55 | |||
56 | public LocalPresenceServicesConnector() | ||
57 | { | ||
58 | } | ||
59 | |||
60 | public LocalPresenceServicesConnector(IConfigSource source) | ||
61 | { | ||
62 | Initialise(source); | ||
63 | } | ||
64 | |||
65 | #region ISharedRegionModule | 48 | #region ISharedRegionModule |
66 | 49 | ||
67 | public Type ReplaceableInterface | ||
68 | { | ||
69 | get { return null; } | ||
70 | } | ||
71 | |||
72 | public string Name | 50 | public string Name |
73 | { | 51 | { |
74 | get { return "LocalPresenceServicesConnector"; } | 52 | get { return "LocalPresenceServicesConnector"; } |
@@ -119,81 +97,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence | |||
119 | } | 97 | } |
120 | } | 98 | } |
121 | 99 | ||
122 | public void PostInitialise() | ||
123 | { | ||
124 | } | ||
125 | |||
126 | public void Close() | ||
127 | { | ||
128 | } | ||
129 | |||
130 | public void AddRegion(Scene scene) | ||
131 | { | ||
132 | if (!m_Enabled) | ||
133 | return; | ||
134 | |||
135 | // m_log.DebugFormat( | ||
136 | // "[LOCAL PRESENCE CONNECTOR]: Registering IPresenceService to scene {0}", scene.RegionInfo.RegionName); | ||
137 | |||
138 | scene.RegisterModuleInterface<IPresenceService>(this); | ||
139 | m_PresenceDetector.AddRegion(scene); | ||
140 | |||
141 | m_log.InfoFormat("[LOCAL PRESENCE CONNECTOR]: Enabled local presence for region {0}", scene.RegionInfo.RegionName); | ||
142 | |||
143 | } | ||
144 | |||
145 | public void RemoveRegion(Scene scene) | ||
146 | { | ||
147 | if (!m_Enabled) | ||
148 | return; | ||
149 | |||
150 | m_PresenceDetector.RemoveRegion(scene); | ||
151 | } | ||
152 | |||
153 | public void RegionLoaded(Scene scene) | ||
154 | { | ||
155 | if (!m_Enabled) | ||
156 | return; | ||
157 | |||
158 | } | ||
159 | |||
160 | #endregion | ||
161 | |||
162 | #region IPresenceService | ||
163 | |||
164 | public bool LoginAgent(string userID, UUID sessionID, UUID secureSessionID) | ||
165 | { | ||
166 | m_log.Warn("[LOCAL PRESENCE CONNECTOR]: LoginAgent connector not implemented at the simulators"); | ||
167 | return false; | ||
168 | } | ||
169 | |||
170 | public bool LogoutAgent(UUID sessionID) | ||
171 | { | ||
172 | return m_PresenceService.LogoutAgent(sessionID); | ||
173 | } | ||
174 | |||
175 | |||
176 | public bool LogoutRegionAgents(UUID regionID) | ||
177 | { | ||
178 | return m_PresenceService.LogoutRegionAgents(regionID); | ||
179 | } | ||
180 | |||
181 | public bool ReportAgent(UUID sessionID, UUID regionID) | ||
182 | { | ||
183 | return m_PresenceService.ReportAgent(sessionID, regionID); | ||
184 | } | ||
185 | |||
186 | public PresenceInfo GetAgent(UUID sessionID) | ||
187 | { | ||
188 | return m_PresenceService.GetAgent(sessionID); | ||
189 | } | ||
190 | |||
191 | public PresenceInfo[] GetAgents(string[] userIDs) | ||
192 | { | ||
193 | return m_PresenceService.GetAgents(userIDs); | ||
194 | } | ||
195 | |||
196 | #endregion | 100 | #endregion |
197 | |||
198 | } | 101 | } |
199 | } | 102 | } \ No newline at end of file |