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 aee621f..2f666c0 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -3930,32 +3930,52 @@ namespace OpenSim.Region.Framework.Scenes
3930 } 3930 }
3931 } 3931 }
3932 3932
3933// m_log.DebugFormat(
3934// "[SCENE]: Found telehub object {0} for new user connection {1} to {2}",
3935// RegionInfo.RegionSettings.TelehubObject, acd.Name, Name);
3936
3933 // Honor Estate teleport routing via Telehubs excluding ViaHome and GodLike TeleportFlags 3937 // Honor Estate teleport routing via Telehubs excluding ViaHome and GodLike TeleportFlags
3934 if (RegionInfo.RegionSettings.TelehubObject != UUID.Zero && 3938 if (RegionInfo.RegionSettings.TelehubObject != UUID.Zero &&
3935 RegionInfo.EstateSettings.AllowDirectTeleport == false && 3939 RegionInfo.EstateSettings.AllowDirectTeleport == false &&
3936 !viahome && !godlike) 3940 !viahome && !godlike)
3937 { 3941 {
3938 SceneObjectGroup telehub = GetSceneObjectGroup(RegionInfo.RegionSettings.TelehubObject); 3942 SceneObjectGroup telehub = GetSceneObjectGroup(RegionInfo.RegionSettings.TelehubObject);
3939 // Can have multiple SpawnPoints 3943
3940 List<SpawnPoint> spawnpoints = RegionInfo.RegionSettings.SpawnPoints(); 3944 if (telehub != null)
3941 if (spawnpoints.Count > 1)
3942 { 3945 {
3943 // We have multiple SpawnPoints, Route the agent to a random or sequential one 3946 // Can have multiple SpawnPoints
3944 if (SpawnPointRouting == "random") 3947 List<SpawnPoint> spawnpoints = RegionInfo.RegionSettings.SpawnPoints();
3945 acd.startpos = spawnpoints[Util.RandomClass.Next(spawnpoints.Count) - 1].GetLocation( 3948 if (spawnpoints.Count > 1)
3946 telehub.AbsolutePosition, 3949 {
3947 telehub.GroupRotation 3950 // We have multiple SpawnPoints, Route the agent to a random or sequential one
3948 ); 3951 if (SpawnPointRouting == "random")
3952 acd.startpos = spawnpoints[Util.RandomClass.Next(spawnpoints.Count) - 1].GetLocation(
3953 telehub.AbsolutePosition,
3954 telehub.GroupRotation
3955 );
3956 else
3957 acd.startpos = spawnpoints[SpawnPoint()].GetLocation(
3958 telehub.AbsolutePosition,
3959 telehub.GroupRotation
3960 );
3961 }
3962 else if (spawnpoints.Count == 1)
3963 {
3964 // We have a single SpawnPoint and will route the agent to it
3965 acd.startpos = spawnpoints[0].GetLocation(telehub.AbsolutePosition, telehub.GroupRotation);
3966 }
3949 else 3967 else
3950 acd.startpos = spawnpoints[SpawnPoint()].GetLocation( 3968 {
3951 telehub.AbsolutePosition, 3969 m_log.DebugFormat(
3952 telehub.GroupRotation 3970 "[SCENE]: No spawnpoints defined for telehub {0} for {1} in {2}. Continuing.",
3953 ); 3971 RegionInfo.RegionSettings.TelehubObject, acd.Name, Name);
3972 }
3954 } 3973 }
3955 else 3974 else
3956 { 3975 {
3957 // We have a single SpawnPoint and will route the agent to it 3976 m_log.DebugFormat(
3958 acd.startpos = spawnpoints[0].GetLocation(telehub.AbsolutePosition, telehub.GroupRotation); 3977 "[SCENE]: No telehub {0} found to direct {1} in {2}. Continuing.",
3978 RegionInfo.RegionSettings.TelehubObject, acd.Name, Name);
3959 } 3979 }
3960 3980
3961 return true; 3981 return true;