diff options
author | Justin Clark-Casey (justincc) | 2012-05-24 01:00:18 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-05-24 01:00:18 +0100 |
commit | 38ce9d45a523db277d3eb4d3ed310b7cd9ca6b43 (patch) | |
tree | 826a9d52e428bc3b792e7b80019dd39b5c5c6a24 /OpenSim | |
parent | If an agent is still registered as 'in transit' by the source region, don't a... (diff) | |
download | opensim-SC_OLD-38ce9d45a523db277d3eb4d3ed310b7cd9ca6b43.zip opensim-SC_OLD-38ce9d45a523db277d3eb4d3ed310b7cd9ca6b43.tar.gz opensim-SC_OLD-38ce9d45a523db277d3eb4d3ed310b7cd9ca6b43.tar.bz2 opensim-SC_OLD-38ce9d45a523db277d3eb4d3ed310b7cd9ca6b43.tar.xz |
Make ISimulationScene.GetScene() used the more efficient region id for lookup rather than the region handle.
Diffstat (limited to '')
6 files changed, 31 insertions, 13 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs index 270daad..026c6c8 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs | |||
@@ -160,16 +160,24 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
160 | 160 | ||
161 | #region ISimulation | 161 | #region ISimulation |
162 | 162 | ||
163 | public IScene GetScene(ulong regionhandle) | 163 | public IScene GetScene(UUID regionId) |
164 | { | 164 | { |
165 | foreach (Scene s in m_scenes.Values) | 165 | if (m_scenes.ContainsKey(regionId)) |
166 | { | 166 | { |
167 | if (s.RegionInfo.RegionHandle == regionhandle) | 167 | return m_scenes[regionId]; |
168 | return s; | ||
169 | } | 168 | } |
169 | else | ||
170 | { | ||
171 | // FIXME: This was pre-existing behaviour but possibly not a good idea, since it hides an error rather | ||
172 | // than making it obvious and fixable. Need to see if the error message comes up in practice. | ||
173 | Scene s = m_scenes.Values.ToArray()[0]; | ||
170 | 174 | ||
171 | // ? weird. should not happen | 175 | m_log.ErrorFormat( |
172 | return m_scenes.Values.ToArray()[0]; | 176 | "[LOCAL SIMULATION CONNECTOR]: Region with id {0} not found. Returning {1} {2} instead", |
177 | regionId, s.RegionInfo.RegionName, s.RegionInfo.RegionID); | ||
178 | |||
179 | return s; | ||
180 | } | ||
173 | } | 181 | } |
174 | 182 | ||
175 | public ISimulationService GetInnerService() | 183 | public ISimulationService GetInnerService() |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs index eaf9506..3d28518 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs | |||
@@ -151,9 +151,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
151 | 151 | ||
152 | #region IInterregionComms | 152 | #region IInterregionComms |
153 | 153 | ||
154 | public IScene GetScene(ulong handle) | 154 | public IScene GetScene(UUID regionId) |
155 | { | 155 | { |
156 | return m_localBackend.GetScene(handle); | 156 | return m_localBackend.GetScene(regionId); |
157 | } | 157 | } |
158 | 158 | ||
159 | public ISimulationService GetInnerService() | 159 | public ISimulationService GetInnerService() |
diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs index 5c9be8f..99ae7f0 100644 --- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs +++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs | |||
@@ -546,7 +546,7 @@ namespace OpenSim.Server.Handlers.Simulation | |||
546 | AgentData agent = new AgentData(); | 546 | AgentData agent = new AgentData(); |
547 | try | 547 | try |
548 | { | 548 | { |
549 | agent.Unpack(args, m_SimulationService.GetScene(destination.RegionHandle)); | 549 | agent.Unpack(args, m_SimulationService.GetScene(destination.RegionID)); |
550 | } | 550 | } |
551 | catch (Exception ex) | 551 | catch (Exception ex) |
552 | { | 552 | { |
@@ -566,7 +566,7 @@ namespace OpenSim.Server.Handlers.Simulation | |||
566 | AgentPosition agent = new AgentPosition(); | 566 | AgentPosition agent = new AgentPosition(); |
567 | try | 567 | try |
568 | { | 568 | { |
569 | agent.Unpack(args, m_SimulationService.GetScene(destination.RegionHandle)); | 569 | agent.Unpack(args, m_SimulationService.GetScene(destination.RegionID)); |
570 | } | 570 | } |
571 | catch (Exception ex) | 571 | catch (Exception ex) |
572 | { | 572 | { |
diff --git a/OpenSim/Server/Handlers/Simulation/ObjectHandlers.cs b/OpenSim/Server/Handlers/Simulation/ObjectHandlers.cs index f0d8f69..a4d03ba 100644 --- a/OpenSim/Server/Handlers/Simulation/ObjectHandlers.cs +++ b/OpenSim/Server/Handlers/Simulation/ObjectHandlers.cs | |||
@@ -161,7 +161,7 @@ namespace OpenSim.Server.Handlers.Simulation | |||
161 | if (args.ContainsKey("extra") && args["extra"] != null) | 161 | if (args.ContainsKey("extra") && args["extra"] != null) |
162 | extraStr = args["extra"].AsString(); | 162 | extraStr = args["extra"].AsString(); |
163 | 163 | ||
164 | IScene s = m_SimulationService.GetScene(destination.RegionHandle); | 164 | IScene s = m_SimulationService.GetScene(destination.RegionID); |
165 | ISceneObject sog = null; | 165 | ISceneObject sog = null; |
166 | try | 166 | try |
167 | { | 167 | { |
diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs index cb003d1..cc46ba8 100644 --- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs +++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs | |||
@@ -62,7 +62,7 @@ namespace OpenSim.Services.Connectors.Simulation | |||
62 | //m_Region = region; | 62 | //m_Region = region; |
63 | } | 63 | } |
64 | 64 | ||
65 | public IScene GetScene(ulong regionHandle) | 65 | public IScene GetScene(UUID regionId) |
66 | { | 66 | { |
67 | return null; | 67 | return null; |
68 | } | 68 | } |
diff --git a/OpenSim/Services/Interfaces/ISimulationService.cs b/OpenSim/Services/Interfaces/ISimulationService.cs index 36fd6fc..4e52532 100644 --- a/OpenSim/Services/Interfaces/ISimulationService.cs +++ b/OpenSim/Services/Interfaces/ISimulationService.cs | |||
@@ -35,7 +35,17 @@ namespace OpenSim.Services.Interfaces | |||
35 | { | 35 | { |
36 | public interface ISimulationService | 36 | public interface ISimulationService |
37 | { | 37 | { |
38 | IScene GetScene(ulong regionHandle); | 38 | /// <summary> |
39 | /// Retrieve the scene with the given region ID. | ||
40 | /// </summary> | ||
41 | /// <param name='regionId'> | ||
42 | /// Region identifier. | ||
43 | /// </param> | ||
44 | /// <returns> | ||
45 | /// The scene. | ||
46 | /// </returns> | ||
47 | IScene GetScene(UUID regionId); | ||
48 | |||
39 | ISimulationService GetInnerService(); | 49 | ISimulationService GetInnerService(); |
40 | 50 | ||
41 | #region Agents | 51 | #region Agents |