aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs16
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs19
-rw-r--r--OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs18
-rw-r--r--OpenSim/Region/Framework/Interfaces/IEntityTransferModule.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs5
5 files changed, 42 insertions, 18 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index 0ba67d3..d6f37ae 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -99,7 +99,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
99 99
100 protected virtual void OnNewClient(IClientAPI client) 100 protected virtual void OnNewClient(IClientAPI client)
101 { 101 {
102 client.OnTeleportHomeRequest += TeleportHome; 102 client.OnTeleportHomeRequest += TeleportHomeFired;
103 } 103 }
104 104
105 public virtual void Close() 105 public virtual void Close()
@@ -552,7 +552,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
552 552
553 #region Teleport Home 553 #region Teleport Home
554 554
555 public virtual void TeleportHome(UUID id, IClientAPI client) 555 public void TeleportHomeFired(UUID id, IClientAPI client)
556 {
557 TeleportHome(id, client);
558 }
559
560 public virtual bool TeleportHome(UUID id, IClientAPI client)
556 { 561 {
557 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Request to teleport {0} {1} home", client.FirstName, client.LastName); 562 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Request to teleport {0} {1} home", client.FirstName, client.LastName);
558 563
@@ -565,14 +570,14 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
565 { 570 {
566 // can't find the Home region: Tell viewer and abort 571 // can't find the Home region: Tell viewer and abort
567 client.SendTeleportFailed("You don't have a home position set."); 572 client.SendTeleportFailed("You don't have a home position set.");
568 return; 573 return false;
569 } 574 }
570 GridRegion regionInfo = m_aScene.GridService.GetRegionByUUID(UUID.Zero, uinfo.HomeRegionID); 575 GridRegion regionInfo = m_aScene.GridService.GetRegionByUUID(UUID.Zero, uinfo.HomeRegionID);
571 if (regionInfo == null) 576 if (regionInfo == null)
572 { 577 {
573 // can't find the Home region: Tell viewer and abort 578 // can't find the Home region: Tell viewer and abort
574 client.SendTeleportFailed("Your home region could not be found."); 579 client.SendTeleportFailed("Your home region could not be found.");
575 return; 580 return false;
576 } 581 }
577 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: User's home region is {0} {1} ({2}-{3})", 582 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: User's home region is {0} {1} ({2}-{3})",
578 regionInfo.RegionName, regionInfo.RegionID, regionInfo.RegionLocX / Constants.RegionSize, regionInfo.RegionLocY / Constants.RegionSize); 583 regionInfo.RegionName, regionInfo.RegionID, regionInfo.RegionLocX / Constants.RegionSize, regionInfo.RegionLocY / Constants.RegionSize);
@@ -586,8 +591,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
586 { 591 {
587 // can't find the Home region: Tell viewer and abort 592 // can't find the Home region: Tell viewer and abort
588 client.SendTeleportFailed("Your home region could not be found."); 593 client.SendTeleportFailed("Your home region could not be found.");
589 return; 594 return false;
590 } 595 }
596 return true;
591 } 597 }
592 598
593 #endregion 599 #endregion
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
index 1ac7508..47898cc 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
@@ -86,7 +86,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
86 86
87 protected override void OnNewClient(IClientAPI client) 87 protected override void OnNewClient(IClientAPI client)
88 { 88 {
89 client.OnTeleportHomeRequest += TeleportHome; 89 client.OnTeleportHomeRequest += TeleportHomeFired;
90 client.OnConnectionClosed += new Action<IClientAPI>(OnConnectionClosed); 90 client.OnConnectionClosed += new Action<IClientAPI>(OnConnectionClosed);
91 } 91 }
92 92
@@ -174,7 +174,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
174 return m_aScene.SimulationService.CreateAgent(reg, agentCircuit, teleportFlags, out reason); 174 return m_aScene.SimulationService.CreateAgent(reg, agentCircuit, teleportFlags, out reason);
175 } 175 }
176 176
177 public override void TeleportHome(UUID id, IClientAPI client) 177 public void TeleportHomeFired(UUID id, IClientAPI client)
178 {
179 TeleportHome(id, client);
180 }
181
182 public override bool TeleportHome(UUID id, IClientAPI client)
178 { 183 {
179 m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Request to teleport {0} {1} home", client.FirstName, client.LastName); 184 m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Request to teleport {0} {1} home", client.FirstName, client.LastName);
180 185
@@ -184,8 +189,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
184 { 189 {
185 // local grid user 190 // local grid user
186 m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: User is local"); 191 m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: User is local");
187 base.TeleportHome(id, client); 192 return base.TeleportHome(id, client);
188 return;
189 } 193 }
190 194
191 // Foreign user wants to go home 195 // Foreign user wants to go home
@@ -195,7 +199,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
195 { 199 {
196 client.SendTeleportFailed("Your information has been lost"); 200 client.SendTeleportFailed("Your information has been lost");
197 m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Unable to locate agent's gateway information"); 201 m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Unable to locate agent's gateway information");
198 return; 202 return false;
199 } 203 }
200 204
201 IUserAgentService userAgentService = new UserAgentServiceConnector(aCircuit.ServiceURLs["HomeURI"].ToString()); 205 IUserAgentService userAgentService = new UserAgentServiceConnector(aCircuit.ServiceURLs["HomeURI"].ToString());
@@ -205,7 +209,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
205 { 209 {
206 client.SendTeleportFailed("Your home region could not be found"); 210 client.SendTeleportFailed("Your home region could not be found");
207 m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Agent's home region not found"); 211 m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Agent's home region not found");
208 return; 212 return false;
209 } 213 }
210 214
211 ScenePresence sp = ((Scene)(client.Scene)).GetScenePresence(client.AgentId); 215 ScenePresence sp = ((Scene)(client.Scene)).GetScenePresence(client.AgentId);
@@ -213,7 +217,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
213 { 217 {
214 client.SendTeleportFailed("Internal error"); 218 client.SendTeleportFailed("Internal error");
215 m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Agent not found in the scene where it is supposed to be"); 219 m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Agent not found in the scene where it is supposed to be");
216 return; 220 return false;
217 } 221 }
218 222
219 IEventQueue eq = sp.Scene.RequestModuleInterface<IEventQueue>(); 223 IEventQueue eq = sp.Scene.RequestModuleInterface<IEventQueue>();
@@ -223,6 +227,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
223 aCircuit.firstname, aCircuit.lastname, finalDestination.RegionName, homeGatekeeper.ExternalHostName, homeGatekeeper.HttpPort, homeGatekeeper.RegionName); 227 aCircuit.firstname, aCircuit.lastname, finalDestination.RegionName, homeGatekeeper.ExternalHostName, homeGatekeeper.HttpPort, homeGatekeeper.RegionName);
224 228
225 DoTeleport(sp, homeGatekeeper, finalDestination, position, lookAt, (uint)(Constants.TeleportFlags.SetLastToTarget | Constants.TeleportFlags.ViaHome), eq); 229 DoTeleport(sp, homeGatekeeper, finalDestination, position, lookAt, (uint)(Constants.TeleportFlags.SetLastToTarget | Constants.TeleportFlags.ViaHome), eq);
230 return true;
226 } 231 }
227 #endregion 232 #endregion
228 233
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
index 171e0b9..8411d04 100644
--- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
@@ -345,7 +345,11 @@ namespace OpenSim.Region.CoreModules.World.Estate
345 { 345 {
346 if (!s.IsChildAgent) 346 if (!s.IsChildAgent)
347 { 347 {
348 m_scene.TeleportClientHome(user, s.ControllingClient); 348 if (!m_scene.TeleportClientHome(user, s.ControllingClient))
349 {
350 s.ControllingClient.Kick("Your access to the region was revoked and TP home failed - you have been logged out.");
351 s.ControllingClient.Close();
352 }
349 } 353 }
350 } 354 }
351 355
@@ -479,7 +483,11 @@ namespace OpenSim.Region.CoreModules.World.Estate
479 ScenePresence s = m_scene.GetScenePresence(prey); 483 ScenePresence s = m_scene.GetScenePresence(prey);
480 if (s != null) 484 if (s != null)
481 { 485 {
482 m_scene.TeleportClientHome(prey, s.ControllingClient); 486 if (!m_scene.TeleportClientHome(prey, s.ControllingClient))
487 {
488 s.ControllingClient.Kick("You were teleported home by the region owner, but the TP failed - you have been logged out.");
489 s.ControllingClient.Close();
490 }
483 } 491 }
484 } 492 }
485 } 493 }
@@ -498,7 +506,11 @@ namespace OpenSim.Region.CoreModules.World.Estate
498 // Also make sure they are actually in the region 506 // Also make sure they are actually in the region
499 if (p != null && !p.IsChildAgent) 507 if (p != null && !p.IsChildAgent)
500 { 508 {
501 m_scene.TeleportClientHome(p.UUID, p.ControllingClient); 509 if (!m_scene.TeleportClientHome(p.UUID, p.ControllingClient))
510 {
511 p.ControllingClient.Kick("You were teleported home by the region owner, but the TP failed - you have been logged out.");
512 p.ControllingClient.Close();
513 }
502 } 514 }
503 } 515 }
504 }); 516 });
diff --git a/OpenSim/Region/Framework/Interfaces/IEntityTransferModule.cs b/OpenSim/Region/Framework/Interfaces/IEntityTransferModule.cs
index e8738c4..45ca5c5 100644
--- a/OpenSim/Region/Framework/Interfaces/IEntityTransferModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IEntityTransferModule.cs
@@ -40,7 +40,7 @@ namespace OpenSim.Region.Framework.Interfaces
40 void Teleport(ScenePresence agent, ulong regionHandle, Vector3 position, 40 void Teleport(ScenePresence agent, ulong regionHandle, Vector3 position,
41 Vector3 lookAt, uint teleportFlags); 41 Vector3 lookAt, uint teleportFlags);
42 42
43 void TeleportHome(UUID id, IClientAPI client); 43 bool TeleportHome(UUID id, IClientAPI client);
44 44
45 void Cross(ScenePresence agent, bool isFlying); 45 void Cross(ScenePresence agent, bool isFlying);
46 46
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 957c4e8..736b696 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -2985,15 +2985,16 @@ namespace OpenSim.Region.Framework.Scenes
2985 /// </summary> 2985 /// </summary>
2986 /// <param name="agentId">The avatar's Unique ID</param> 2986 /// <param name="agentId">The avatar's Unique ID</param>
2987 /// <param name="client">The IClientAPI for the client</param> 2987 /// <param name="client">The IClientAPI for the client</param>
2988 public virtual void TeleportClientHome(UUID agentId, IClientAPI client) 2988 public virtual bool TeleportClientHome(UUID agentId, IClientAPI client)
2989 { 2989 {
2990 if (m_teleportModule != null) 2990 if (m_teleportModule != null)
2991 m_teleportModule.TeleportHome(agentId, client); 2991 return m_teleportModule.TeleportHome(agentId, client);
2992 else 2992 else
2993 { 2993 {
2994 m_log.DebugFormat("[SCENE]: Unable to teleport user home: no AgentTransferModule is active"); 2994 m_log.DebugFormat("[SCENE]: Unable to teleport user home: no AgentTransferModule is active");
2995 client.SendTeleportFailed("Unable to perform teleports on this simulator."); 2995 client.SendTeleportFailed("Unable to perform teleports on this simulator.");
2996 } 2996 }
2997 return false;
2997 } 2998 }
2998 2999
2999 /// <summary> 3000 /// <summary>