aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs40
1 files changed, 22 insertions, 18 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index 4988e93..361e453 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -73,6 +73,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
73 private ExpiringCache<UUID, ExpiringCache<ulong, DateTime>> m_bannedRegions = 73 private ExpiringCache<UUID, ExpiringCache<ulong, DateTime>> m_bannedRegions =
74 new ExpiringCache<UUID, ExpiringCache<ulong, DateTime>>(); 74 new ExpiringCache<UUID, ExpiringCache<ulong, DateTime>>();
75 75
76 private IEventQueue m_eqModule;
77
76 #region ISharedRegionModule 78 #region ISharedRegionModule
77 79
78 public Type ReplaceableInterface 80 public Type ReplaceableInterface
@@ -147,7 +149,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
147 149
148 public virtual void RemoveRegion(Scene scene) {} 150 public virtual void RemoveRegion(Scene scene) {}
149 151
150 public virtual void RegionLoaded(Scene scene) {} 152 public virtual void RegionLoaded(Scene scene)
153 {
154 if (!m_Enabled)
155 return;
156
157 m_eqModule = m_scene.RequestModuleInterface<IEventQueue>();
158 }
151 159
152 #endregion 160 #endregion
153 161
@@ -398,8 +406,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
398 return; 406 return;
399 } 407 }
400 408
401 IEventQueue eq = sp.Scene.RequestModuleInterface<IEventQueue>();
402
403 uint newRegionX = (uint)(reg.RegionHandle >> 40); 409 uint newRegionX = (uint)(reg.RegionHandle >> 40);
404 uint newRegionY = (((uint)(reg.RegionHandle)) >> 8); 410 uint newRegionY = (((uint)(reg.RegionHandle)) >> 8);
405 uint oldRegionX = (uint)(sp.Scene.RegionInfo.RegionHandle >> 40); 411 uint oldRegionX = (uint)(sp.Scene.RegionInfo.RegionHandle >> 40);
@@ -416,7 +422,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
416 { 422 {
417 sp.ControllingClient.SendTeleportFailed("Remote Region appears to be down"); 423 sp.ControllingClient.SendTeleportFailed("Remote Region appears to be down");
418 ResetFromTransit(sp.UUID); 424 ResetFromTransit(sp.UUID);
419 425
420 return; 426 return;
421 } 427 }
422 428
@@ -516,16 +522,16 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
516 #endregion 522 #endregion
517 capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath); 523 capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath);
518 524
519 if (eq != null) 525 if (m_eqModule != null)
520 { 526 {
521 eq.EnableSimulator(destinationHandle, endPoint, sp.UUID); 527 m_eqModule.EnableSimulator(destinationHandle, endPoint, sp.UUID);
522 528
523 // ES makes the client send a UseCircuitCode message to the destination, 529 // ES makes the client send a UseCircuitCode message to the destination,
524 // which triggers a bunch of things there. 530 // which triggers a bunch of things there.
525 // So let's wait 531 // So let's wait
526 Thread.Sleep(200); 532 Thread.Sleep(200);
527 533
528 eq.EstablishAgentCommunication(sp.UUID, endPoint, capsPath); 534 m_eqModule.EstablishAgentCommunication(sp.UUID, endPoint, capsPath);
529 535
530 } 536 }
531 else 537 else
@@ -564,10 +570,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
564 "[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} from {1} to {2}", 570 "[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} from {1} to {2}",
565 capsPath, sp.Scene.RegionInfo.RegionName, sp.Name); 571 capsPath, sp.Scene.RegionInfo.RegionName, sp.Name);
566 572
567 if (eq != null) 573 if (m_eqModule != null)
568 { 574 {
569 eq.TeleportFinishEvent(destinationHandle, 13, endPoint, 575 m_eqModule.TeleportFinishEvent(destinationHandle, 13, endPoint, 0, teleportFlags, capsPath, sp.UUID);
570 0, teleportFlags, capsPath, sp.UUID);
571 } 576 }
572 else 577 else
573 { 578 {
@@ -1122,11 +1127,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1122 1127
1123 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, agent.UUID); 1128 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, agent.UUID);
1124 1129
1125 IEventQueue eq = agent.Scene.RequestModuleInterface<IEventQueue>(); 1130 if (m_eqModule != null)
1126 if (eq != null)
1127 { 1131 {
1128 eq.CrossRegion(neighbourHandle, pos, vel2 /* agent.Velocity */, neighbourRegion.ExternalEndPoint, 1132 m_eqModule.CrossRegion(
1129 capsPath, agent.UUID, agent.ControllingClient.SessionId); 1133 neighbourHandle, pos, vel2 /* agent.Velocity */, neighbourRegion.ExternalEndPoint,
1134 capsPath, agent.UUID, agent.ControllingClient.SessionId);
1130 } 1135 }
1131 else 1136 else
1132 { 1137 {
@@ -1474,8 +1479,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1474 1479
1475 if (regionAccepted && newAgent) 1480 if (regionAccepted && newAgent)
1476 { 1481 {
1477 IEventQueue eq = sp.Scene.RequestModuleInterface<IEventQueue>(); 1482 if (m_eqModule != null)
1478 if (eq != null)
1479 { 1483 {
1480 #region IP Translation for NAT 1484 #region IP Translation for NAT
1481 IClientIPEndpoint ipepClient; 1485 IClientIPEndpoint ipepClient;
@@ -1489,8 +1493,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1489 "and EstablishAgentCommunication with seed cap {4}", 1493 "and EstablishAgentCommunication with seed cap {4}",
1490 scene.RegionInfo.RegionName, sp.Name, reg.RegionName, reg.RegionHandle, capsPath); 1494 scene.RegionInfo.RegionName, sp.Name, reg.RegionName, reg.RegionHandle, capsPath);
1491 1495
1492 eq.EnableSimulator(reg.RegionHandle, endPoint, sp.UUID); 1496 m_eqModule.EnableSimulator(reg.RegionHandle, endPoint, sp.UUID);
1493 eq.EstablishAgentCommunication(sp.UUID, endPoint, capsPath); 1497 m_eqModule.EstablishAgentCommunication(sp.UUID, endPoint, capsPath);
1494 } 1498 }
1495 else 1499 else
1496 { 1500 {