diff options
author | MW | 2009-05-21 10:41:16 +0000 |
---|---|---|
committer | MW | 2009-05-21 10:41:16 +0000 |
commit | e4d68964ddee0ce26154d8d38c102a96e0adef10 (patch) | |
tree | e2a6c3ee1528c0b2f2b9cbd70fe43798c0bcded5 | |
parent | Put some meat on the bones of the REST console. NO user functionality yet (diff) | |
download | opensim-SC_OLD-e4d68964ddee0ce26154d8d38c102a96e0adef10.zip opensim-SC_OLD-e4d68964ddee0ce26154d8d38c102a96e0adef10.tar.gz opensim-SC_OLD-e4d68964ddee0ce26154d8d38c102a96e0adef10.tar.bz2 opensim-SC_OLD-e4d68964ddee0ce26154d8d38c102a96e0adef10.tar.xz |
Added ITeleportModule interface, and added a hook into scene so if a module has registered this interface then that handles teleport requests rather the SceneCommunicationService.
As by default there is no ITeleportModule registered, Teleports by default will still be handled by SceneCommunicationService.
-rw-r--r-- | OpenSim/Region/Framework/Interfaces/ITeleportModule.cs | 14 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 26 |
2 files changed, 27 insertions, 13 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/ITeleportModule.cs b/OpenSim/Region/Framework/Interfaces/ITeleportModule.cs new file mode 100644 index 0000000..5365094 --- /dev/null +++ b/OpenSim/Region/Framework/Interfaces/ITeleportModule.cs | |||
@@ -0,0 +1,14 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Text; | ||
4 | using OpenMetaverse; | ||
5 | using OpenSim.Region.Framework.Scenes; | ||
6 | |||
7 | namespace OpenSim.Region.Framework.Interfaces | ||
8 | { | ||
9 | public interface ITeleportModule | ||
10 | { | ||
11 | void RequestTeleportToLocation(ScenePresence avatar, ulong regionHandle, Vector3 position, | ||
12 | Vector3 lookAt, uint teleportFlags); | ||
13 | } | ||
14 | } | ||
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index a650ec5..f18d542 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -147,6 +147,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
147 | protected IInterregionCommsOut m_interregionCommsOut; | 147 | protected IInterregionCommsOut m_interregionCommsOut; |
148 | protected IInterregionCommsIn m_interregionCommsIn; | 148 | protected IInterregionCommsIn m_interregionCommsIn; |
149 | protected IDialogModule m_dialogModule; | 149 | protected IDialogModule m_dialogModule; |
150 | protected ITeleportModule m_teleportModule; | ||
150 | 151 | ||
151 | protected ICapabilitiesModule m_capsModule; | 152 | protected ICapabilitiesModule m_capsModule; |
152 | public ICapabilitiesModule CapsModule | 153 | public ICapabilitiesModule CapsModule |
@@ -808,6 +809,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
808 | m_interregionCommsIn = RequestModuleInterface<IInterregionCommsIn>(); | 809 | m_interregionCommsIn = RequestModuleInterface<IInterregionCommsIn>(); |
809 | m_dialogModule = RequestModuleInterface<IDialogModule>(); | 810 | m_dialogModule = RequestModuleInterface<IDialogModule>(); |
810 | m_capsModule = RequestModuleInterface<ICapabilitiesModule>(); | 811 | m_capsModule = RequestModuleInterface<ICapabilitiesModule>(); |
812 | m_teleportModule = RequestModuleInterface<ITeleportModule>(); | ||
811 | } | 813 | } |
812 | 814 | ||
813 | #endregion | 815 | #endregion |
@@ -2819,8 +2821,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
2819 | 2821 | ||
2820 | if (sp != null) | 2822 | if (sp != null) |
2821 | { | 2823 | { |
2822 | m_sceneGridService.RequestTeleportToLocation(sp, regionHandle, | 2824 | if (m_teleportModule != null) |
2823 | position, lookAt, teleportFlags); | 2825 | { |
2826 | m_teleportModule.RequestTeleportToLocation(sp, regionHandle, | ||
2827 | position, lookAt, teleportFlags); | ||
2828 | } | ||
2829 | else | ||
2830 | { | ||
2831 | m_sceneGridService.RequestTeleportToLocation(sp, regionHandle, | ||
2832 | position, lookAt, teleportFlags); | ||
2833 | } | ||
2824 | } | 2834 | } |
2825 | } | 2835 | } |
2826 | 2836 | ||
@@ -2841,17 +2851,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2841 | return; | 2851 | return; |
2842 | } | 2852 | } |
2843 | 2853 | ||
2844 | ScenePresence sp = null; | 2854 | RequestTeleportLocation(remoteClient, info.RegionHandle, position, Vector3.Zero, (uint)(TPFlags.SetLastToTarget | TPFlags.ViaLandmark)); |
2845 | lock (m_scenePresences) | ||
2846 | { | ||
2847 | if (m_scenePresences.ContainsKey(remoteClient.AgentId)) | ||
2848 | sp = m_scenePresences[remoteClient.AgentId]; | ||
2849 | } | ||
2850 | if (sp != null) | ||
2851 | { | ||
2852 | m_sceneGridService.RequestTeleportToLocation(sp, info.RegionHandle, | ||
2853 | position, Vector3.Zero, (uint)(TPFlags.SetLastToTarget | TPFlags.ViaLandmark)); | ||
2854 | } | ||
2855 | } | 2855 | } |
2856 | 2856 | ||
2857 | public void CrossAgentToNewRegion(ScenePresence agent, bool isFlying) | 2857 | public void CrossAgentToNewRegion(ScenePresence agent, bool isFlying) |