aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/Scene.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs50
1 files changed, 35 insertions, 15 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index a9fe556..c3110a2 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -3951,32 +3951,52 @@ namespace OpenSim.Region.Framework.Scenes
3951 } 3951 }
3952 } 3952 }
3953 3953
3954// m_log.DebugFormat(
3955// "[SCENE]: Found telehub object {0} for new user connection {1} to {2}",
3956// RegionInfo.RegionSettings.TelehubObject, acd.Name, Name);
3957
3954 // Honor Estate teleport routing via Telehubs excluding ViaHome and GodLike TeleportFlags 3958 // Honor Estate teleport routing via Telehubs excluding ViaHome and GodLike TeleportFlags
3955 if (RegionInfo.RegionSettings.TelehubObject != UUID.Zero && 3959 if (RegionInfo.RegionSettings.TelehubObject != UUID.Zero &&
3956 RegionInfo.EstateSettings.AllowDirectTeleport == false && 3960 RegionInfo.EstateSettings.AllowDirectTeleport == false &&
3957 !viahome && !godlike) 3961 !viahome && !godlike)
3958 { 3962 {
3959 SceneObjectGroup telehub = GetSceneObjectGroup(RegionInfo.RegionSettings.TelehubObject); 3963 SceneObjectGroup telehub = GetSceneObjectGroup(RegionInfo.RegionSettings.TelehubObject);
3960 // Can have multiple SpawnPoints 3964
3961 List<SpawnPoint> spawnpoints = RegionInfo.RegionSettings.SpawnPoints(); 3965 if (telehub != null)
3962 if (spawnpoints.Count > 1)
3963 { 3966 {
3964 // We have multiple SpawnPoints, Route the agent to a random or sequential one 3967 // Can have multiple SpawnPoints
3965 if (SpawnPointRouting == "random") 3968 List<SpawnPoint> spawnpoints = RegionInfo.RegionSettings.SpawnPoints();
3966 acd.startpos = spawnpoints[Util.RandomClass.Next(spawnpoints.Count) - 1].GetLocation( 3969 if (spawnpoints.Count > 1)
3967 telehub.AbsolutePosition, 3970 {
3968 telehub.GroupRotation 3971 // We have multiple SpawnPoints, Route the agent to a random or sequential one
3969 ); 3972 if (SpawnPointRouting == "random")
3973 acd.startpos = spawnpoints[Util.RandomClass.Next(spawnpoints.Count) - 1].GetLocation(
3974 telehub.AbsolutePosition,
3975 telehub.GroupRotation
3976 );
3977 else
3978 acd.startpos = spawnpoints[SpawnPoint()].GetLocation(
3979 telehub.AbsolutePosition,
3980 telehub.GroupRotation
3981 );
3982 }
3983 else if (spawnpoints.Count == 1)
3984 {
3985 // We have a single SpawnPoint and will route the agent to it
3986 acd.startpos = spawnpoints[0].GetLocation(telehub.AbsolutePosition, telehub.GroupRotation);
3987 }
3970 else 3988 else
3971 acd.startpos = spawnpoints[SpawnPoint()].GetLocation( 3989 {
3972 telehub.AbsolutePosition, 3990 m_log.DebugFormat(
3973 telehub.GroupRotation 3991 "[SCENE]: No spawnpoints defined for telehub {0} for {1} in {2}. Continuing.",
3974 ); 3992 RegionInfo.RegionSettings.TelehubObject, acd.Name, Name);
3993 }
3975 } 3994 }
3976 else 3995 else
3977 { 3996 {
3978 // We have a single SpawnPoint and will route the agent to it 3997 m_log.DebugFormat(
3979 acd.startpos = spawnpoints[0].GetLocation(telehub.AbsolutePosition, telehub.GroupRotation); 3998 "[SCENE]: No telehub {0} found to direct {1} in {2}. Continuing.",
3999 RegionInfo.RegionSettings.TelehubObject, acd.Name, Name);
3980 } 4000 }
3981 4001
3982 return true; 4002 return true;