aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs (renamed from OpenSim/Region/CoreModules/Agent/AgentTransfer/AgentTransferModule.cs)81
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs6
-rw-r--r--OpenSim/Region/Framework/Interfaces/IEntityTransferModule.cs (renamed from OpenSim/Region/Framework/Interfaces/IAgentTransferModule.cs)2
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs4
5 files changed, 55 insertions, 42 deletions
diff --git a/OpenSim/Region/CoreModules/Agent/AgentTransfer/AgentTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index 8e3d041..af004b0 100644
--- a/OpenSim/Region/CoreModules/Agent/AgentTransfer/AgentTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -44,9 +44,9 @@ using OpenMetaverse;
44using log4net; 44using log4net;
45using Nini.Config; 45using Nini.Config;
46 46
47namespace OpenSim.Region.CoreModules.Agent.AgentTransfer 47namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
48{ 48{
49 public class AgentTransferModule : ISharedRegionModule, IAgentTransferModule 49 public class AgentTransferModule : ISharedRegionModule, IEntityTransferModule
50 { 50 {
51 #region ISharedRegionModule 51 #region ISharedRegionModule
52 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 52 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@@ -92,7 +92,7 @@ namespace OpenSim.Region.CoreModules.Agent.AgentTransfer
92 if (m_aScene == null) 92 if (m_aScene == null)
93 m_aScene = scene; 93 m_aScene = scene;
94 94
95 scene.RegisterModuleInterface<IAgentTransferModule>(this); 95 scene.RegisterModuleInterface<IEntityTransferModule>(this);
96 } 96 }
97 97
98 public virtual void Close() 98 public virtual void Close()
@@ -192,6 +192,7 @@ namespace OpenSim.Region.CoreModules.Agent.AgentTransfer
192 uint oldRegionY = (((uint)(sp.Scene.RegionInfo.RegionHandle)) >> 8); 192 uint oldRegionY = (((uint)(sp.Scene.RegionInfo.RegionHandle)) >> 8);
193 193
194 ulong destinationHandle = GetRegionHandle(reg); 194 ulong destinationHandle = GetRegionHandle(reg);
195 GridRegion finalDestination = GetFinalDestination(reg);
195 196
196 if (eq == null) 197 if (eq == null)
197 sp.ControllingClient.SendTeleportLocationStart(); 198 sp.ControllingClient.SendTeleportLocationStart();
@@ -235,7 +236,7 @@ namespace OpenSim.Region.CoreModules.Agent.AgentTransfer
235 agentCircuit.child = true; 236 agentCircuit.child = true;
236 agentCircuit.Appearance = sp.Appearance; 237 agentCircuit.Appearance = sp.Appearance;
237 238
238 if (Util.IsOutsideView(oldRegionX, newRegionX, oldRegionY, newRegionY)) 239 if (NeedsNewAgent(oldRegionX, newRegionX, oldRegionY, newRegionY))
239 { 240 {
240 // brand new agent, let's create a new caps seed 241 // brand new agent, let's create a new caps seed
241 agentCircuit.CapsPath = CapsUtil.GetRandomCapsObjectPath(); 242 agentCircuit.CapsPath = CapsUtil.GetRandomCapsObjectPath();
@@ -244,7 +245,6 @@ namespace OpenSim.Region.CoreModules.Agent.AgentTransfer
244 string reason = String.Empty; 245 string reason = String.Empty;
245 246
246 // Let's create an agent there if one doesn't exist yet. 247 // Let's create an agent there if one doesn't exist yet.
247 //if (!m_commsProvider.InterRegion.InformRegionOfChildAgent(reg.RegionHandle, agentCircuit))
248 if (!m_aScene.SimulationService.CreateAgent(reg, agentCircuit, teleportFlags, out reason)) 248 if (!m_aScene.SimulationService.CreateAgent(reg, agentCircuit, teleportFlags, out reason))
249 { 249 {
250 sp.ControllingClient.SendTeleportFailed(String.Format("Destination is not accepting teleports: {0}", 250 sp.ControllingClient.SendTeleportFailed(String.Format("Destination is not accepting teleports: {0}",
@@ -255,7 +255,7 @@ namespace OpenSim.Region.CoreModules.Agent.AgentTransfer
255 // OK, it got this agent. Let's close some child agents 255 // OK, it got this agent. Let's close some child agents
256 sp.CloseChildAgents(newRegionX, newRegionY); 256 sp.CloseChildAgents(newRegionX, newRegionY);
257 257
258 if (Util.IsOutsideView(oldRegionX, newRegionX, oldRegionY, newRegionY)) 258 if (NeedsNewAgent(oldRegionX, newRegionX, oldRegionY, newRegionY))
259 { 259 {
260 #region IP Translation for NAT 260 #region IP Translation for NAT
261 IClientIPEndpoint ipepClient; 261 IClientIPEndpoint ipepClient;
@@ -427,6 +427,47 @@ namespace OpenSim.Region.CoreModules.Agent.AgentTransfer
427 } 427 }
428 } 428 }
429 429
430 protected void KillEntity(Scene scene, uint localID)
431 {
432 scene.SendKillObject(localID);
433 }
434
435 protected virtual ulong GetRegionHandle(GridRegion region)
436 {
437 return region.RegionHandle;
438 }
439
440 protected virtual GridRegion GetFinalDestination(GridRegion region)
441 {
442 return region;
443 }
444
445 protected virtual bool NeedsNewAgent(uint oldRegionX, uint newRegionX, uint oldRegionY, uint newRegionY)
446 {
447 return Util.IsOutsideView(oldRegionX, newRegionX, oldRegionY, newRegionY);
448 }
449
450 protected virtual bool NeedsClosing(uint oldRegionX, uint newRegionX, uint oldRegionY, uint newRegionY, GridRegion reg)
451 {
452 return Util.IsOutsideView(oldRegionX, newRegionX, oldRegionY, newRegionY);
453 }
454
455 protected virtual bool IsOutsideRegion(Scene s, Vector3 pos)
456 {
457
458 if (s.TestBorderCross(pos, Cardinals.N))
459 return true;
460 if (s.TestBorderCross(pos, Cardinals.S))
461 return true;
462 if (s.TestBorderCross(pos, Cardinals.E))
463 return true;
464 if (s.TestBorderCross(pos, Cardinals.W))
465 return true;
466
467 return false;
468 }
469
470
430 #endregion 471 #endregion
431 472
432 #region Enable Child Agent 473 #region Enable Child Agent
@@ -1115,20 +1156,6 @@ namespace OpenSim.Region.CoreModules.Agent.AgentTransfer
1115 1156
1116 1157
1117 #region Misc 1158 #region Misc
1118 protected bool IsOutsideRegion(Scene s, Vector3 pos)
1119 {
1120
1121 if (s.TestBorderCross(pos, Cardinals.N))
1122 return true;
1123 if (s.TestBorderCross(pos, Cardinals.S))
1124 return true;
1125 if (s.TestBorderCross(pos, Cardinals.E))
1126 return true;
1127 if (s.TestBorderCross(pos, Cardinals.W))
1128 return true;
1129
1130 return false;
1131 }
1132 1159
1133 protected bool WaitForCallback(UUID id) 1160 protected bool WaitForCallback(UUID id)
1134 { 1161 {
@@ -1167,20 +1194,6 @@ namespace OpenSim.Region.CoreModules.Agent.AgentTransfer
1167 return false; 1194 return false;
1168 } 1195 }
1169 1196
1170 protected void KillEntity(Scene scene, uint localID)
1171 {
1172 scene.SendKillObject(localID);
1173 }
1174
1175 protected virtual ulong GetRegionHandle(GridRegion region)
1176 {
1177 return region.RegionHandle;
1178 }
1179
1180 protected virtual bool NeedsClosing(uint oldRegionX, uint newRegionX, uint oldRegionY, uint newRegionY, GridRegion reg)
1181 {
1182 return Util.IsOutsideView(oldRegionX, newRegionX, oldRegionY, newRegionY);
1183 }
1184 1197
1185 #endregion 1198 #endregion
1186 1199
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs
index f4383f1..e913891 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs
@@ -43,13 +43,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
43 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 43 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
44 private List<Scene> m_sceneList = new List<Scene>(); 44 private List<Scene> m_sceneList = new List<Scene>();
45 45
46 private IAgentTransferModule m_AgentTransferModule; 46 private IEntityTransferModule m_AgentTransferModule;
47 protected IAgentTransferModule AgentTransferModule 47 protected IEntityTransferModule AgentTransferModule
48 { 48 {
49 get 49 get
50 { 50 {
51 if (m_AgentTransferModule == null) 51 if (m_AgentTransferModule == null)
52 m_AgentTransferModule = m_sceneList[0].RequestModuleInterface<IAgentTransferModule>(); 52 m_AgentTransferModule = m_sceneList[0].RequestModuleInterface<IEntityTransferModule>();
53 return m_AgentTransferModule; 53 return m_AgentTransferModule;
54 } 54 }
55 } 55 }
diff --git a/OpenSim/Region/Framework/Interfaces/IAgentTransferModule.cs b/OpenSim/Region/Framework/Interfaces/IEntityTransferModule.cs
index 76745d6..96884b3 100644
--- a/OpenSim/Region/Framework/Interfaces/IAgentTransferModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IEntityTransferModule.cs
@@ -34,7 +34,7 @@ using OpenSim.Region.Framework.Scenes;
34 34
35namespace OpenSim.Region.Framework.Interfaces 35namespace OpenSim.Region.Framework.Interfaces
36{ 36{
37 public interface IAgentTransferModule 37 public interface IEntityTransferModule
38 { 38 {
39 void Teleport(ScenePresence agent, ulong regionHandle, Vector3 position, 39 void Teleport(ScenePresence agent, ulong regionHandle, Vector3 position,
40 Vector3 lookAt, uint teleportFlags); 40 Vector3 lookAt, uint teleportFlags);
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index dcbbe08..62734ff 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -315,7 +315,7 @@ namespace OpenSim.Region.Framework.Scenes
315 protected IConfigSource m_config; 315 protected IConfigSource m_config;
316 protected IRegionSerialiserModule m_serialiser; 316 protected IRegionSerialiserModule m_serialiser;
317 protected IDialogModule m_dialogModule; 317 protected IDialogModule m_dialogModule;
318 protected IAgentTransferModule m_teleportModule; 318 protected IEntityTransferModule m_teleportModule;
319 319
320 protected ICapabilitiesModule m_capsModule; 320 protected ICapabilitiesModule m_capsModule;
321 public ICapabilitiesModule CapsModule 321 public ICapabilitiesModule CapsModule
@@ -1218,7 +1218,7 @@ namespace OpenSim.Region.Framework.Scenes
1218 m_serialiser = RequestModuleInterface<IRegionSerialiserModule>(); 1218 m_serialiser = RequestModuleInterface<IRegionSerialiserModule>();
1219 m_dialogModule = RequestModuleInterface<IDialogModule>(); 1219 m_dialogModule = RequestModuleInterface<IDialogModule>();
1220 m_capsModule = RequestModuleInterface<ICapabilitiesModule>(); 1220 m_capsModule = RequestModuleInterface<ICapabilitiesModule>();
1221 m_teleportModule = RequestModuleInterface<IAgentTransferModule>(); 1221 m_teleportModule = RequestModuleInterface<IEntityTransferModule>();
1222 } 1222 }
1223 1223
1224 #endregion 1224 #endregion
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 711f9d9..2c8c675 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -1110,7 +1110,7 @@ namespace OpenSim.Region.Framework.Scenes
1110 // Create child agents in neighbouring regions 1110 // Create child agents in neighbouring regions
1111 if (!m_isChildAgent) 1111 if (!m_isChildAgent)
1112 { 1112 {
1113 IAgentTransferModule m_agentTransfer = m_scene.RequestModuleInterface<IAgentTransferModule>(); 1113 IEntityTransferModule m_agentTransfer = m_scene.RequestModuleInterface<IEntityTransferModule>();
1114 if (m_agentTransfer != null) 1114 if (m_agentTransfer != null)
1115 m_agentTransfer.EnableChildAgents(this); 1115 m_agentTransfer.EnableChildAgents(this);
1116 else 1116 else
@@ -2193,7 +2193,7 @@ namespace OpenSim.Region.Framework.Scenes
2193 2193
2194 if (m_scene.SceneGridService != null) 2194 if (m_scene.SceneGridService != null)
2195 { 2195 {
2196 IAgentTransferModule m_agentTransfer = m_scene.RequestModuleInterface<IAgentTransferModule>(); 2196 IEntityTransferModule m_agentTransfer = m_scene.RequestModuleInterface<IEntityTransferModule>();
2197 if (m_agentTransfer != null) 2197 if (m_agentTransfer != null)
2198 m_agentTransfer.EnableChildAgents(this); 2198 m_agentTransfer.EnableChildAgents(this);
2199 } 2199 }