diff options
HG Landmarks now working.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index ec084fb..1341533 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -52,6 +52,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
52 | 52 | ||
53 | protected bool m_Enabled = false; | 53 | protected bool m_Enabled = false; |
54 | protected Scene m_aScene; | 54 | protected Scene m_aScene; |
55 | protected List<Scene> m_Scenes = new List<Scene>(); | ||
55 | protected List<UUID> m_agentsInTransit; | 56 | protected List<UUID> m_agentsInTransit; |
56 | private ExpiringCache<UUID, ExpiringCache<ulong, DateTime>> m_bannedRegions = | 57 | private ExpiringCache<UUID, ExpiringCache<ulong, DateTime>> m_bannedRegions = |
57 | new ExpiringCache<UUID, ExpiringCache<ulong, DateTime>>(); | 58 | new ExpiringCache<UUID, ExpiringCache<ulong, DateTime>>(); |
@@ -96,6 +97,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
96 | if (m_aScene == null) | 97 | if (m_aScene == null) |
97 | m_aScene = scene; | 98 | m_aScene = scene; |
98 | 99 | ||
100 | m_Scenes.Add(scene); | ||
99 | scene.RegisterModuleInterface<IEntityTransferModule>(this); | 101 | scene.RegisterModuleInterface<IEntityTransferModule>(this); |
100 | scene.EventManager.OnNewClient += OnNewClient; | 102 | scene.EventManager.OnNewClient += OnNewClient; |
101 | } | 103 | } |
@@ -103,6 +105,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
103 | protected virtual void OnNewClient(IClientAPI client) | 105 | protected virtual void OnNewClient(IClientAPI client) |
104 | { | 106 | { |
105 | client.OnTeleportHomeRequest += TeleportHome; | 107 | client.OnTeleportHomeRequest += TeleportHome; |
108 | client.OnTeleportLandmarkRequest += RequestTeleportLandmark; | ||
106 | } | 109 | } |
107 | 110 | ||
108 | public virtual void Close() | 111 | public virtual void Close() |
@@ -118,6 +121,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
118 | return; | 121 | return; |
119 | if (scene == m_aScene) | 122 | if (scene == m_aScene) |
120 | m_aScene = null; | 123 | m_aScene = null; |
124 | |||
125 | m_Scenes.Remove(scene); | ||
121 | } | 126 | } |
122 | 127 | ||
123 | public virtual void RegionLoaded(Scene scene) | 128 | public virtual void RegionLoaded(Scene scene) |
@@ -127,7 +132,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
127 | 132 | ||
128 | } | 133 | } |
129 | 134 | ||
130 | |||
131 | #endregion | 135 | #endregion |
132 | 136 | ||
133 | #region Agent Teleports | 137 | #region Agent Teleports |
@@ -556,6 +560,29 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
556 | 560 | ||
557 | #endregion | 561 | #endregion |
558 | 562 | ||
563 | #region Landmark Teleport | ||
564 | /// <summary> | ||
565 | /// Tries to teleport agent to landmark. | ||
566 | /// </summary> | ||
567 | /// <param name="remoteClient"></param> | ||
568 | /// <param name="regionHandle"></param> | ||
569 | /// <param name="position"></param> | ||
570 | public virtual void RequestTeleportLandmark(IClientAPI remoteClient, AssetLandmark lm) | ||
571 | { | ||
572 | GridRegion info = m_aScene.GridService.GetRegionByUUID(UUID.Zero, lm.RegionID); | ||
573 | |||
574 | if (info == null) | ||
575 | { | ||
576 | // can't find the region: Tell viewer and abort | ||
577 | remoteClient.SendTeleportFailed("The teleport destination could not be found."); | ||
578 | return; | ||
579 | } | ||
580 | ((Scene)(remoteClient.Scene)).RequestTeleportLocation(remoteClient, info.RegionHandle, lm.Position, | ||
581 | Vector3.Zero, (uint)(Constants.TeleportFlags.SetLastToTarget | Constants.TeleportFlags.ViaLandmark)); | ||
582 | } | ||
583 | |||
584 | #endregion | ||
585 | |||
559 | #region Teleport Home | 586 | #region Teleport Home |
560 | 587 | ||
561 | public virtual void TeleportHome(UUID id, IClientAPI client) | 588 | public virtual void TeleportHome(UUID id, IClientAPI client) |