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