aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs')
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs45
1 files changed, 27 insertions, 18 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
index d39537d..e237ca2 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
@@ -48,16 +48,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
48 { 48 {
49 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 49 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
50 50
51 private IHypergridService m_HypergridService; 51 private bool m_Initialized = false;
52 private IHypergridService HyperGridService
53 {
54 get
55 {
56 if (m_HypergridService == null)
57 m_HypergridService = m_aScene.RequestModuleInterface<IHypergridService>();
58 return m_HypergridService;
59 }
60 }
61 52
62 private GatekeeperServiceConnector m_GatekeeperConnector; 53 private GatekeeperServiceConnector m_GatekeeperConnector;
63 private IHomeUsersSecurityService m_Security; 54 private IHomeUsersSecurityService m_Security;
@@ -78,7 +69,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
78 if (name == Name) 69 if (name == Name)
79 { 70 {
80 m_agentsInTransit = new List<UUID>(); 71 m_agentsInTransit = new List<UUID>();
81 m_GatekeeperConnector = new GatekeeperServiceConnector();
82 72
83 IConfig config = source.Configs["HGEntityTransferModule"]; 73 IConfig config = source.Configs["HGEntityTransferModule"];
84 if (config != null) 74 if (config != null)
@@ -108,6 +98,17 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
108 scene.RegisterModuleInterface<IHomeUsersSecurityService>(m_Security); 98 scene.RegisterModuleInterface<IHomeUsersSecurityService>(m_Security);
109 } 99 }
110 100
101 public override void RegionLoaded(Scene scene)
102 {
103 base.RegionLoaded(scene);
104 if (m_Enabled)
105 if (!m_Initialized)
106 {
107 m_GatekeeperConnector = new GatekeeperServiceConnector(scene.AssetService);
108 m_Initialized = true;
109 }
110
111 }
111 public override void RemoveRegion(Scene scene) 112 public override void RemoveRegion(Scene scene)
112 { 113 {
113 base.AddRegion(scene); 114 base.AddRegion(scene);
@@ -122,7 +123,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
122 123
123 protected override GridRegion GetFinalDestination(GridRegion region) 124 protected override GridRegion GetFinalDestination(GridRegion region)
124 { 125 {
125 return HyperGridService.GetHyperlinkRegion(region, region.RegionID); 126 int flags = m_aScene.GridService.GetRegionFlags(m_aScene.RegionInfo.ScopeID, region.RegionID);
127 if ((flags & (int)OpenSim.Data.RegionFlags.Hyperlink) != 0)
128 {
129 return m_GatekeeperConnector.GetHyperlinkRegion(region, region.RegionID);
130 }
131 return region;
126 } 132 }
127 133
128 protected override bool NeedsClosing(uint oldRegionX, uint newRegionX, uint oldRegionY, uint newRegionY, GridRegion reg) 134 protected override bool NeedsClosing(uint oldRegionX, uint newRegionX, uint oldRegionY, uint newRegionY, GridRegion reg)
@@ -133,13 +139,16 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
133 protected override bool CreateAgent(ScenePresence sp, GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, out string reason) 139 protected override bool CreateAgent(ScenePresence sp, GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, out string reason)
134 { 140 {
135 reason = string.Empty; 141 reason = string.Empty;
136 if (reg.RegionLocX != finalDestination.RegionLocX || reg.RegionLocY != finalDestination.RegionLocY) 142 int flags = m_aScene.GridService.GetRegionFlags(m_aScene.RegionInfo.ScopeID, reg.RegionID);
143 if ((flags & (int)OpenSim.Data.RegionFlags.Hyperlink) != 0)
137 { 144 {
138 // this user is going to another grid 145 // this user is going to another grid
139 reg.RegionName = finalDestination.RegionName; 146 // Take the IP address + port of the gatekeeper (reg) plus the info of finalDestination
140 reg.RegionID = finalDestination.RegionID; 147 GridRegion region = new GridRegion(reg);
141 reg.RegionLocX = finalDestination.RegionLocX; 148 region.RegionName = finalDestination.RegionName;
142 reg.RegionLocY = finalDestination.RegionLocY; 149 region.RegionID = finalDestination.RegionID;
150 region.RegionLocX = finalDestination.RegionLocX;
151 region.RegionLocY = finalDestination.RegionLocY;
143 152
144 // Log their session and remote endpoint in the home users security service 153 // Log their session and remote endpoint in the home users security service
145 IHomeUsersSecurityService security = sp.Scene.RequestModuleInterface<IHomeUsersSecurityService>(); 154 IHomeUsersSecurityService security = sp.Scene.RequestModuleInterface<IHomeUsersSecurityService>();
@@ -149,7 +158,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
149 // Log them out of this grid 158 // Log them out of this grid
150 sp.Scene.PresenceService.LogoutAgent(agentCircuit.SessionID, sp.AbsolutePosition, sp.Lookat); 159 sp.Scene.PresenceService.LogoutAgent(agentCircuit.SessionID, sp.AbsolutePosition, sp.Lookat);
151 160
152 return m_GatekeeperConnector.CreateAgent(reg, agentCircuit, teleportFlags, out reason); 161 return m_GatekeeperConnector.CreateAgent(region, agentCircuit, teleportFlags, out reason);
153 } 162 }
154 163
155 return m_aScene.SimulationService.CreateAgent(reg, agentCircuit, teleportFlags, out reason); 164 return m_aScene.SimulationService.CreateAgent(reg, agentCircuit, teleportFlags, out reason);