From ba98d6fffe03389d6538a11d5eec45c863964403 Mon Sep 17 00:00:00 2001 From: BlueWall Date: Fri, 17 Feb 2012 08:03:53 -0500 Subject: Fix missing telehub handling on login --- OpenSim/Region/Framework/Scenes/Scene.cs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 4c8e2d2..ecc553d 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -3427,6 +3427,27 @@ namespace OpenSim.Region.Framework.Scenes agent.startpos.Z = 720; } } + + // Honor Estate teleport routing via Telehubs + if (RegionInfo.RegionSettings.TelehubObject != UUID.Zero && RegionInfo.EstateSettings.AllowDirectTeleport == false) + { + SceneObjectGroup telehub = GetSceneObjectGroup(RegionInfo.RegionSettings.TelehubObject); + // Can have multiple SpawnPoints + List spawnpoints = RegionInfo.RegionSettings.SpawnPoints(); + if ( spawnpoints.Count > 1) + { + // We have multiple SpawnPoints, Route the agent to a random one + agent.startpos = spawnpoints[Util.RandomClass.Next(spawnpoints.Count)].GetLocation(telehub.AbsolutePosition, telehub.GroupRotation); + } + else + { + // We have a single SpawnPoint and will route the agent to it + agent.startpos = spawnpoints[0].GetLocation(telehub.AbsolutePosition, telehub.GroupRotation); + } + + return true; + } + // Honor parcel landing type and position. if (land != null) { -- cgit v1.1