aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules
diff options
context:
space:
mode:
authorOren Hurvitz2014-04-09 08:03:25 +0300
committerOren Hurvitz2014-04-09 09:22:20 +0100
commit06e0528d0b9929cbd8d2b360b0baa00288340d13 (patch)
tree0ffd33e5eda96badff712bdd78794ce6debbb392 /OpenSim/Region/CoreModules
parentLog when the presence service logs-out all the users in a region (diff)
downloadopensim-SC_OLD-06e0528d0b9929cbd8d2b360b0baa00288340d13.zip
opensim-SC_OLD-06e0528d0b9929cbd8d2b360b0baa00288340d13.tar.gz
opensim-SC_OLD-06e0528d0b9929cbd8d2b360b0baa00288340d13.tar.bz2
opensim-SC_OLD-06e0528d0b9929cbd8d2b360b0baa00288340d13.tar.xz
In teleports, pass the source region to the destination (similar to an HTTP referrer)
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs19
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs14
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs4
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs6
4 files changed, 25 insertions, 18 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index f7470bd..53be68f 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -111,6 +111,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
111 /// </remarks> 111 /// </remarks>
112 private Stat m_interRegionTeleportFailures; 112 private Stat m_interRegionTeleportFailures;
113 113
114 protected string m_ThisHomeURI;
115
114 protected bool m_Enabled = false; 116 protected bool m_Enabled = false;
115 117
116 public Scene Scene { get; private set; } 118 public Scene Scene { get; private set; }
@@ -207,6 +209,14 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
207 string transferVersionName = "SIMULATION"; 209 string transferVersionName = "SIMULATION";
208 float maxTransferVersion = 0.2f; 210 float maxTransferVersion = 0.2f;
209 211
212 IConfig hypergridConfig = source.Configs["Hypergrid"];
213 if (hypergridConfig != null)
214 {
215 m_ThisHomeURI = hypergridConfig.GetString("HomeURI", string.Empty);
216 if (m_ThisHomeURI != string.Empty && !m_ThisHomeURI.EndsWith("/"))
217 m_ThisHomeURI += '/';
218 }
219
210 IConfig transferConfig = source.Configs["EntityTransfer"]; 220 IConfig transferConfig = source.Configs["EntityTransfer"];
211 if (transferConfig != null) 221 if (transferConfig != null)
212 { 222 {
@@ -1296,8 +1306,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1296 1306
1297 protected virtual bool CreateAgent(ScenePresence sp, GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, out string reason, out bool logout) 1307 protected virtual bool CreateAgent(ScenePresence sp, GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, out string reason, out bool logout)
1298 { 1308 {
1309 GridRegion source = new GridRegion(Scene.RegionInfo);
1310 source.RawServerURI = m_ThisHomeURI;
1311
1299 logout = false; 1312 logout = false;
1300 bool success = Scene.SimulationService.CreateAgent(finalDestination, agentCircuit, teleportFlags, out reason); 1313 bool success = Scene.SimulationService.CreateAgent(source, finalDestination, agentCircuit, teleportFlags, out reason);
1301 1314
1302 if (success) 1315 if (success)
1303 sp.Scene.EventManager.TriggerTeleportStart(sp.ControllingClient, reg, finalDestination, teleportFlags, logout); 1316 sp.Scene.EventManager.TriggerTeleportStart(sp.ControllingClient, reg, finalDestination, teleportFlags, logout);
@@ -2262,7 +2275,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
2262 Thread.Sleep(500); 2275 Thread.Sleep(500);
2263 2276
2264 Scene scene = sp.Scene; 2277 Scene scene = sp.Scene;
2265 2278
2266 m_log.DebugFormat( 2279 m_log.DebugFormat(
2267 "[ENTITY TRANSFER MODULE]: Informing {0} {1} about neighbour {2} {3} at ({4},{5})", 2280 "[ENTITY TRANSFER MODULE]: Informing {0} {1} about neighbour {2} {3} at ({4},{5})",
2268 sp.Name, sp.UUID, reg.RegionName, endPoint, reg.RegionCoordX, reg.RegionCoordY); 2281 sp.Name, sp.UUID, reg.RegionName, endPoint, reg.RegionCoordX, reg.RegionCoordY);
@@ -2271,7 +2284,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
2271 2284
2272 string reason = String.Empty; 2285 string reason = String.Empty;
2273 2286
2274 bool regionAccepted = scene.SimulationService.CreateAgent(reg, a, (uint)TeleportFlags.Default, out reason); 2287 bool regionAccepted = scene.SimulationService.CreateAgent(null, reg, a, (uint)TeleportFlags.Default, out reason);
2275 2288
2276 if (regionAccepted && newAgent) 2289 if (regionAccepted && newAgent)
2277 { 2290 {
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
index 52e0d5a..79bff06 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
@@ -53,7 +53,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
53 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 53 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
54 54
55 private int m_levelHGTeleport = 0; 55 private int m_levelHGTeleport = 0;
56 private string m_ThisHomeURI;
57 56
58 private GatekeeperServiceConnector m_GatekeeperConnector; 57 private GatekeeperServiceConnector m_GatekeeperConnector;
59 private IUserAgentService m_UAS; 58 private IUserAgentService m_UAS;
@@ -145,14 +144,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
145 m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: {0} enabled.", Name); 144 m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: {0} enabled.", Name);
146 } 145 }
147 } 146 }
148
149 moduleConfig = source.Configs["Hypergrid"];
150 if (moduleConfig != null)
151 {
152 m_ThisHomeURI = moduleConfig.GetString("HomeURI", string.Empty);
153 if (m_ThisHomeURI != string.Empty && !m_ThisHomeURI.EndsWith("/"))
154 m_ThisHomeURI += '/';
155 }
156 } 147 }
157 148
158 public override void AddRegion(Scene scene) 149 public override void AddRegion(Scene scene)
@@ -296,7 +287,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
296 else 287 else
297 connector = new UserAgentServiceConnector(userAgentDriver); 288 connector = new UserAgentServiceConnector(userAgentDriver);
298 289
299 bool success = connector.LoginAgentToGrid(agentCircuit, reg, finalDestination, false, out reason); 290 GridRegion source = new GridRegion(Scene.RegionInfo);
291 source.RawServerURI = m_ThisHomeURI;
292
293 bool success = connector.LoginAgentToGrid(source, agentCircuit, reg, finalDestination, false, out reason);
300 logout = success; // flag for later logout from this grid; this is an HG TP 294 logout = success; // flag for later logout from this grid; this is an HG TP
301 295
302 if (success) 296 if (success)
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs
index dc06e4b..3348b42 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs
@@ -205,7 +205,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
205 * Agent-related communications 205 * Agent-related communications
206 */ 206 */
207 207
208 public bool CreateAgent(GridRegion destination, AgentCircuitData aCircuit, uint teleportFlags, out string reason) 208 public bool CreateAgent(GridRegion source, GridRegion destination, AgentCircuitData aCircuit, uint teleportFlags, out string reason)
209 { 209 {
210 if (destination == null) 210 if (destination == null)
211 { 211 {
@@ -217,7 +217,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
217 if (m_scenes.ContainsKey(destination.RegionID)) 217 if (m_scenes.ContainsKey(destination.RegionID))
218 { 218 {
219// m_log.DebugFormat("[LOCAL SIMULATION CONNECTOR]: Found region {0} to send SendCreateChildAgent", destination.RegionName); 219// m_log.DebugFormat("[LOCAL SIMULATION CONNECTOR]: Found region {0} to send SendCreateChildAgent", destination.RegionName);
220 return m_scenes[destination.RegionID].NewUserConnection(aCircuit, teleportFlags, out reason); 220 return m_scenes[destination.RegionID].NewUserConnection(aCircuit, teleportFlags, source, out reason);
221 } 221 }
222 222
223 reason = "Did not find region " + destination.RegionName; 223 reason = "Did not find region " + destination.RegionName;
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs
index 5f43f08..8436488 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs
@@ -162,7 +162,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
162 * Agent-related communications 162 * Agent-related communications
163 */ 163 */
164 164
165 public bool CreateAgent(GridRegion destination, AgentCircuitData aCircuit, uint teleportFlags, out string reason) 165 public bool CreateAgent(GridRegion source, GridRegion destination, AgentCircuitData aCircuit, uint teleportFlags, out string reason)
166 { 166 {
167 if (destination == null) 167 if (destination == null)
168 { 168 {
@@ -172,13 +172,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
172 } 172 }
173 173
174 // Try local first 174 // Try local first
175 if (m_localBackend.CreateAgent(destination, aCircuit, teleportFlags, out reason)) 175 if (m_localBackend.CreateAgent(source, destination, aCircuit, teleportFlags, out reason))
176 return true; 176 return true;
177 177
178 // else do the remote thing 178 // else do the remote thing
179 if (!m_localBackend.IsLocalRegion(destination.RegionID)) 179 if (!m_localBackend.IsLocalRegion(destination.RegionID))
180 { 180 {
181 return m_remoteConnector.CreateAgent(destination, aCircuit, teleportFlags, out reason); 181 return m_remoteConnector.CreateAgent(source, destination, aCircuit, teleportFlags, out reason);
182 } 182 }
183 return false; 183 return false;
184 } 184 }