diff options
author | Justin Clark-Casey (justincc) | 2014-01-20 19:16:19 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2014-01-20 19:16:19 +0000 |
commit | 8e72b53edc435c2c2fbec0b8c91304e7f7a6a4f2 (patch) | |
tree | dc8b1c314f0e58be8a036dc2d56756564d4fc3c7 /OpenSim/Region/Framework/Scenes/Scene.cs | |
parent | Following on from 50ea2e0, only fetch scene presence for check if lightscript... (diff) | |
download | opensim-SC-8e72b53edc435c2c2fbec0b8c91304e7f7a6a4f2.zip opensim-SC-8e72b53edc435c2c2fbec0b8c91304e7f7a6a4f2.tar.gz opensim-SC-8e72b53edc435c2c2fbec0b8c91304e7f7a6a4f2.tar.bz2 opensim-SC-8e72b53edc435c2c2fbec0b8c91304e7f7a6a4f2.tar.xz |
Stop exceptions being generated on agent connection if a telehub object has been deleted or has no spawn points.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 50 |
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; |