diff options
author | Justin Clark-Casey (justincc) | 2012-11-20 10:11:57 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-11-20 10:11:57 +0000 |
commit | ea65a64f7b1867780261c2a01a6323e057ddc097 (patch) | |
tree | e07abbcc4a3745d543f3aca4775a9e41a2b7cc82 /OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/RemotePresenceServiceConnector.cs | |
parent | Add Iain Oliver to CONTRIBUTORS.txt (diff) | |
download | opensim-SC_OLD-ea65a64f7b1867780261c2a01a6323e057ddc097.zip opensim-SC_OLD-ea65a64f7b1867780261c2a01a6323e057ddc097.tar.gz opensim-SC_OLD-ea65a64f7b1867780261c2a01a6323e057ddc097.tar.bz2 opensim-SC_OLD-ea65a64f7b1867780261c2a01a6323e057ddc097.tar.xz |
refactor: Move common presence connector code into BasePresenceServiceConnector
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/RemotePresenceServiceConnector.cs | 89 |
1 files changed, 3 insertions, 86 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/RemotePresenceServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/RemotePresenceServiceConnector.cs index be73932..6ca5c28 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/RemotePresenceServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/RemotePresenceServiceConnector.cs | |||
@@ -43,22 +43,12 @@ using Nini.Config; | |||
43 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence | 43 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence |
44 | { | 44 | { |
45 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "RemotePresenceServicesConnector")] | 45 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "RemotePresenceServicesConnector")] |
46 | public class RemotePresenceServicesConnector : ISharedRegionModule, IPresenceService | 46 | public class RemotePresenceServicesConnector : BasePresenceServiceConnector, ISharedRegionModule |
47 | { | 47 | { |
48 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 48 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
49 | 49 | ||
50 | #region ISharedRegionModule | 50 | #region ISharedRegionModule |
51 | 51 | ||
52 | private bool m_Enabled = false; | ||
53 | |||
54 | private PresenceDetector m_PresenceDetector; | ||
55 | private IPresenceService m_RemoteConnector; | ||
56 | |||
57 | public Type ReplaceableInterface | ||
58 | { | ||
59 | get { return null; } | ||
60 | } | ||
61 | |||
62 | public string Name | 52 | public string Name |
63 | { | 53 | { |
64 | get { return "RemotePresenceServicesConnector"; } | 54 | get { return "RemotePresenceServicesConnector"; } |
@@ -72,7 +62,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence | |||
72 | string name = moduleConfig.GetString("PresenceServices", ""); | 62 | string name = moduleConfig.GetString("PresenceServices", ""); |
73 | if (name == Name) | 63 | if (name == Name) |
74 | { | 64 | { |
75 | m_RemoteConnector = new PresenceServicesConnector(source); | 65 | m_PresenceService = new PresenceServicesConnector(source); |
76 | 66 | ||
77 | m_Enabled = true; | 67 | m_Enabled = true; |
78 | 68 | ||
@@ -81,81 +71,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence | |||
81 | m_log.Info("[REMOTE PRESENCE CONNECTOR]: Remote presence enabled"); | 71 | m_log.Info("[REMOTE PRESENCE CONNECTOR]: Remote presence enabled"); |
82 | } | 72 | } |
83 | } | 73 | } |
84 | |||
85 | } | ||
86 | |||
87 | public void PostInitialise() | ||
88 | { | ||
89 | } | ||
90 | |||
91 | public void Close() | ||
92 | { | ||
93 | } | ||
94 | |||
95 | public void AddRegion(Scene scene) | ||
96 | { | ||
97 | if (!m_Enabled) | ||
98 | return; | ||
99 | |||
100 | scene.RegisterModuleInterface<IPresenceService>(this); | ||
101 | m_PresenceDetector.AddRegion(scene); | ||
102 | |||
103 | m_log.InfoFormat("[REMOTE PRESENCE CONNECTOR]: Enabled remote presence for region {0}", scene.RegionInfo.RegionName); | ||
104 | |||
105 | } | ||
106 | |||
107 | public void RemoveRegion(Scene scene) | ||
108 | { | ||
109 | if (!m_Enabled) | ||
110 | return; | ||
111 | |||
112 | m_PresenceDetector.RemoveRegion(scene); | ||
113 | } | ||
114 | |||
115 | public void RegionLoaded(Scene scene) | ||
116 | { | ||
117 | if (!m_Enabled) | ||
118 | return; | ||
119 | |||
120 | } | ||
121 | |||
122 | #endregion | ||
123 | |||
124 | #region IPresenceService | ||
125 | |||
126 | public bool LoginAgent(string userID, UUID sessionID, UUID secureSessionID) | ||
127 | { | ||
128 | m_log.Warn("[REMOTE PRESENCE CONNECTOR]: LoginAgent connector not implemented at the simulators"); | ||
129 | return false; | ||
130 | } | ||
131 | |||
132 | public bool LogoutAgent(UUID sessionID) | ||
133 | { | ||
134 | return m_RemoteConnector.LogoutAgent(sessionID); | ||
135 | } | ||
136 | |||
137 | |||
138 | public bool LogoutRegionAgents(UUID regionID) | ||
139 | { | ||
140 | return m_RemoteConnector.LogoutRegionAgents(regionID); | ||
141 | } | ||
142 | |||
143 | public bool ReportAgent(UUID sessionID, UUID regionID) | ||
144 | { | ||
145 | return m_RemoteConnector.ReportAgent(sessionID, regionID); | ||
146 | } | ||
147 | |||
148 | public PresenceInfo GetAgent(UUID sessionID) | ||
149 | { | ||
150 | return m_RemoteConnector.GetAgent(sessionID); | ||
151 | } | ||
152 | |||
153 | public PresenceInfo[] GetAgents(string[] userIDs) | ||
154 | { | ||
155 | return m_RemoteConnector.GetAgents(userIDs); | ||
156 | } | 74 | } |
157 | 75 | ||
158 | #endregion | 76 | #endregion |
159 | |||
160 | } | 77 | } |
161 | } | 78 | } \ No newline at end of file |