diff options
author | Melanie Thielker | 2010-08-31 22:26:17 +0200 |
---|---|---|
committer | Melanie Thielker | 2010-08-31 22:26:17 +0200 |
commit | aca10cb027d3184788bc61e67fe26db85f9e748c (patch) | |
tree | cb6a7d3b806143d1c60252602befa07a211e9d72 /OpenSim/Region | |
parent | Adjust the "Magic numbers" we use because we can't reference the actual (diff) | |
parent | Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/ca... (diff) | |
download | opensim-SC_OLD-aca10cb027d3184788bc61e67fe26db85f9e748c.zip opensim-SC_OLD-aca10cb027d3184788bc61e67fe26db85f9e748c.tar.gz opensim-SC_OLD-aca10cb027d3184788bc61e67fe26db85f9e748c.tar.bz2 opensim-SC_OLD-aca10cb027d3184788bc61e67fe26db85f9e748c.tar.xz |
Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor
Diffstat (limited to '')
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 314e163..1cd2ff4 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() |
@@ -563,7 +563,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
563 | 563 | ||
564 | #region Teleport Home | 564 | #region Teleport Home |
565 | 565 | ||
566 | public virtual void TeleportHome(UUID id, IClientAPI client) | 566 | public void TeleportHomeFired(UUID id, IClientAPI client) |
567 | { | ||
568 | TeleportHome(id, client); | ||
569 | } | ||
570 | |||
571 | public virtual bool TeleportHome(UUID id, IClientAPI client) | ||
567 | { | 572 | { |
568 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Request to teleport {0} {1} home", client.FirstName, client.LastName); | 573 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Request to teleport {0} {1} home", client.FirstName, client.LastName); |
569 | 574 | ||
@@ -576,14 +581,14 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
576 | { | 581 | { |
577 | // can't find the Home region: Tell viewer and abort | 582 | // can't find the Home region: Tell viewer and abort |
578 | client.SendTeleportFailed("You don't have a home position set."); | 583 | client.SendTeleportFailed("You don't have a home position set."); |
579 | return; | 584 | return false; |
580 | } | 585 | } |
581 | GridRegion regionInfo = m_aScene.GridService.GetRegionByUUID(UUID.Zero, uinfo.HomeRegionID); | 586 | GridRegion regionInfo = m_aScene.GridService.GetRegionByUUID(UUID.Zero, uinfo.HomeRegionID); |
582 | if (regionInfo == null) | 587 | if (regionInfo == null) |
583 | { | 588 | { |
584 | // can't find the Home region: Tell viewer and abort | 589 | // can't find the Home region: Tell viewer and abort |
585 | client.SendTeleportFailed("Your home region could not be found."); | 590 | client.SendTeleportFailed("Your home region could not be found."); |
586 | return; | 591 | return false; |
587 | } | 592 | } |
588 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: User's home region is {0} {1} ({2}-{3})", | 593 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: User's home region is {0} {1} ({2}-{3})", |
589 | regionInfo.RegionName, regionInfo.RegionID, regionInfo.RegionLocX / Constants.RegionSize, regionInfo.RegionLocY / Constants.RegionSize); | 594 | regionInfo.RegionName, regionInfo.RegionID, regionInfo.RegionLocX / Constants.RegionSize, regionInfo.RegionLocY / Constants.RegionSize); |
@@ -597,8 +602,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
597 | { | 602 | { |
598 | // can't find the Home region: Tell viewer and abort | 603 | // can't find the Home region: Tell viewer and abort |
599 | client.SendTeleportFailed("Your home region could not be found."); | 604 | client.SendTeleportFailed("Your home region could not be found."); |
600 | return; | 605 | return false; |
601 | } | 606 | } |
607 | return true; | ||
602 | } | 608 | } |
603 | 609 | ||
604 | #endregion | 610 | #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 6e7971e..fb15d91 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 767d370..b950dbd 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -3009,15 +3009,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
3009 | /// </summary> | 3009 | /// </summary> |
3010 | /// <param name="agentId">The avatar's Unique ID</param> | 3010 | /// <param name="agentId">The avatar's Unique ID</param> |
3011 | /// <param name="client">The IClientAPI for the client</param> | 3011 | /// <param name="client">The IClientAPI for the client</param> |
3012 | public virtual void TeleportClientHome(UUID agentId, IClientAPI client) | 3012 | public virtual bool TeleportClientHome(UUID agentId, IClientAPI client) |
3013 | { | 3013 | { |
3014 | if (m_teleportModule != null) | 3014 | if (m_teleportModule != null) |
3015 | m_teleportModule.TeleportHome(agentId, client); | 3015 | return m_teleportModule.TeleportHome(agentId, client); |
3016 | else | 3016 | else |
3017 | { | 3017 | { |
3018 | m_log.DebugFormat("[SCENE]: Unable to teleport user home: no AgentTransferModule is active"); | 3018 | m_log.DebugFormat("[SCENE]: Unable to teleport user home: no AgentTransferModule is active"); |
3019 | client.SendTeleportFailed("Unable to perform teleports on this simulator."); | 3019 | client.SendTeleportFailed("Unable to perform teleports on this simulator."); |
3020 | } | 3020 | } |
3021 | return false; | ||
3021 | } | 3022 | } |
3022 | 3023 | ||
3023 | /// <summary> | 3024 | /// <summary> |