diff options
author | Melanie Thielker | 2014-06-21 00:39:55 +0200 |
---|---|---|
committer | Melanie Thielker | 2014-06-21 00:39:55 +0200 |
commit | 159fcbf150b7da0e229b29aa7b94793484543d12 (patch) | |
tree | b8c0ff3b4c758a3fba8315b556c923ef4c02a185 /OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs | |
parent | Merge commit '68c8633ba18f0a11cfc0ed04d1d0c7c59e6cec76' (diff) | |
parent | Merge branch 'master' into careminster (diff) | |
download | opensim-SC_OLD-159fcbf150b7da0e229b29aa7b94793484543d12.zip opensim-SC_OLD-159fcbf150b7da0e229b29aa7b94793484543d12.tar.gz opensim-SC_OLD-159fcbf150b7da0e229b29aa7b94793484543d12.tar.bz2 opensim-SC_OLD-159fcbf150b7da0e229b29aa7b94793484543d12.tar.xz |
Merge branch 'master' of ssh://3dhosting.de/var/git/careminster
Conflicts:
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
Diffstat (limited to 'OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs | 73 |
1 files changed, 17 insertions, 56 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs index c8698ca..ab912ed 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs | |||
@@ -50,9 +50,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
50 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "RemoteSimulationConnectorModule")] | 50 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "RemoteSimulationConnectorModule")] |
51 | public class RemoteSimulationConnectorModule : ISharedRegionModule, ISimulationService | 51 | public class RemoteSimulationConnectorModule : ISharedRegionModule, ISimulationService |
52 | { | 52 | { |
53 | private bool initialized = false; | ||
54 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 53 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
55 | 54 | ||
55 | private bool initialized = false; | ||
56 | protected bool m_enabled = false; | 56 | protected bool m_enabled = false; |
57 | protected Scene m_aScene; | 57 | protected Scene m_aScene; |
58 | // RemoteSimulationConnector does not care about local regions; it delegates that to the Local module | 58 | // RemoteSimulationConnector does not care about local regions; it delegates that to the Local module |
@@ -64,27 +64,23 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
64 | 64 | ||
65 | #region Region Module interface | 65 | #region Region Module interface |
66 | 66 | ||
67 | public virtual void Initialise(IConfigSource config) | 67 | public virtual void Initialise(IConfigSource configSource) |
68 | { | 68 | { |
69 | 69 | IConfig moduleConfig = configSource.Configs["Modules"]; | |
70 | IConfig moduleConfig = config.Configs["Modules"]; | ||
71 | if (moduleConfig != null) | 70 | if (moduleConfig != null) |
72 | { | 71 | { |
73 | string name = moduleConfig.GetString("SimulationServices", ""); | 72 | string name = moduleConfig.GetString("SimulationServices", ""); |
74 | if (name == Name) | 73 | if (name == Name) |
75 | { | 74 | { |
76 | //IConfig userConfig = config.Configs["SimulationService"]; | 75 | m_localBackend = new LocalSimulationConnectorModule(); |
77 | //if (userConfig == null) | 76 | |
78 | //{ | 77 | m_localBackend.InitialiseService(configSource); |
79 | // m_log.Error("[AVATAR CONNECTOR]: SimulationService missing from OpenSim.ini"); | ||
80 | // return; | ||
81 | //} | ||
82 | 78 | ||
83 | m_remoteConnector = new SimulationServiceConnector(); | 79 | m_remoteConnector = new SimulationServiceConnector(); |
84 | 80 | ||
85 | m_enabled = true; | 81 | m_enabled = true; |
86 | 82 | ||
87 | m_log.Info("[SIMULATION CONNECTOR]: Remote simulation enabled"); | 83 | m_log.Info("[REMOTE SIMULATION CONNECTOR]: Remote simulation enabled."); |
88 | } | 84 | } |
89 | } | 85 | } |
90 | } | 86 | } |
@@ -142,8 +138,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
142 | } | 138 | } |
143 | 139 | ||
144 | protected virtual void InitOnce(Scene scene) | 140 | protected virtual void InitOnce(Scene scene) |
145 | { | 141 | { |
146 | m_localBackend = new LocalSimulationConnectorModule(); | ||
147 | m_aScene = scene; | 142 | m_aScene = scene; |
148 | //m_regionClient = new RegionToRegionClient(m_aScene, m_hyperlinkService); | 143 | //m_regionClient = new RegionToRegionClient(m_aScene, m_hyperlinkService); |
149 | m_thisIP = Util.GetHostFromDNS(scene.RegionInfo.ExternalHostName); | 144 | m_thisIP = Util.GetHostFromDNS(scene.RegionInfo.ExternalHostName); |
@@ -151,7 +146,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
151 | 146 | ||
152 | #endregion | 147 | #endregion |
153 | 148 | ||
154 | #region IInterregionComms | 149 | #region ISimulationService |
155 | 150 | ||
156 | public IScene GetScene(UUID regionId) | 151 | public IScene GetScene(UUID regionId) |
157 | { | 152 | { |
@@ -194,7 +189,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
194 | return false; | 189 | return false; |
195 | 190 | ||
196 | // Try local first | 191 | // Try local first |
197 | if (m_localBackend.IsLocalRegion(destination.RegionHandle)) | 192 | if (m_localBackend.IsLocalRegion(destination.RegionID)) |
198 | return m_localBackend.UpdateAgent(destination, cAgentData); | 193 | return m_localBackend.UpdateAgent(destination, cAgentData); |
199 | 194 | ||
200 | return m_remoteConnector.UpdateAgent(destination, cAgentData); | 195 | return m_remoteConnector.UpdateAgent(destination, cAgentData); |
@@ -206,30 +201,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
206 | return false; | 201 | return false; |
207 | 202 | ||
208 | // Try local first | 203 | // Try local first |
209 | if (m_localBackend.IsLocalRegion(destination.RegionHandle)) | 204 | if (m_localBackend.IsLocalRegion(destination.RegionID)) |
210 | return m_localBackend.UpdateAgent(destination, cAgentData); | 205 | return m_localBackend.UpdateAgent(destination, cAgentData); |
211 | 206 | ||
212 | return m_remoteConnector.UpdateAgent(destination, cAgentData); | 207 | return m_remoteConnector.UpdateAgent(destination, cAgentData); |
213 | } | 208 | } |
214 | 209 | ||
215 | public bool RetrieveAgent(GridRegion destination, UUID id, out IAgentData agent) | ||
216 | { | ||
217 | agent = null; | ||
218 | |||
219 | if (destination == null) | ||
220 | return false; | ||
221 | |||
222 | // Try local first | ||
223 | if (m_localBackend.RetrieveAgent(destination, id, out agent)) | ||
224 | return true; | ||
225 | |||
226 | // else do the remote thing | ||
227 | if (!m_localBackend.IsLocalRegion(destination.RegionHandle)) | ||
228 | return m_remoteConnector.RetrieveAgent(destination, id, out agent); | ||
229 | |||
230 | return false; | ||
231 | } | ||
232 | |||
233 | public bool QueryAccess(GridRegion destination, UUID id, Vector3 position, out string version, out string reason) | 210 | public bool QueryAccess(GridRegion destination, UUID id, Vector3 position, out string version, out string reason) |
234 | { | 211 | { |
235 | reason = "Communications failure"; | 212 | reason = "Communications failure"; |
@@ -262,34 +239,18 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
262 | return false; | 239 | return false; |
263 | } | 240 | } |
264 | 241 | ||
265 | public bool CloseChildAgent(GridRegion destination, UUID id) | 242 | public bool CloseAgent(GridRegion destination, UUID id, string auth_token) |
266 | { | ||
267 | if (destination == null) | ||
268 | return false; | ||
269 | |||
270 | // Try local first | ||
271 | if (m_localBackend.CloseChildAgent(destination, id)) | ||
272 | return true; | ||
273 | |||
274 | // else do the remote thing | ||
275 | if (!m_localBackend.IsLocalRegion(destination.RegionHandle)) | ||
276 | return m_remoteConnector.CloseChildAgent(destination, id); | ||
277 | |||
278 | return false; | ||
279 | } | ||
280 | |||
281 | public bool CloseAgent(GridRegion destination, UUID id) | ||
282 | { | 243 | { |
283 | if (destination == null) | 244 | if (destination == null) |
284 | return false; | 245 | return false; |
285 | 246 | ||
286 | // Try local first | 247 | // Try local first |
287 | if (m_localBackend.CloseAgent(destination, id)) | 248 | if (m_localBackend.CloseAgent(destination, id, auth_token)) |
288 | return true; | 249 | return true; |
289 | 250 | ||
290 | // else do the remote thing | 251 | // else do the remote thing |
291 | if (!m_localBackend.IsLocalRegion(destination.RegionHandle)) | 252 | if (!m_localBackend.IsLocalRegion(destination.RegionID)) |
292 | return m_remoteConnector.CloseAgent(destination, id); | 253 | return m_remoteConnector.CloseAgent(destination, id, auth_token); |
293 | 254 | ||
294 | return false; | 255 | return false; |
295 | } | 256 | } |
@@ -311,12 +272,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
311 | } | 272 | } |
312 | 273 | ||
313 | // else do the remote thing | 274 | // else do the remote thing |
314 | if (!m_localBackend.IsLocalRegion(destination.RegionHandle)) | 275 | if (!m_localBackend.IsLocalRegion(destination.RegionID)) |
315 | return m_remoteConnector.CreateObject(destination, newPosition, sog, isLocalCall); | 276 | return m_remoteConnector.CreateObject(destination, newPosition, sog, isLocalCall); |
316 | 277 | ||
317 | return false; | 278 | return false; |
318 | } | 279 | } |
319 | 280 | ||
320 | #endregion /* IInterregionComms */ | 281 | #endregion |
321 | } | 282 | } |
322 | } | 283 | } |