aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/ScenePresence.cs
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-06-11 01:31:39 +0000
committerJustin Clarke Casey2008-06-11 01:31:39 +0000
commit42e54537aa3121aa7e6dd1466f8445a506caa337 (patch)
tree7bc94464aeb2a085ca8afdde44c3b18475649ec9 /OpenSim/Region/Environment/Scenes/ScenePresence.cs
parent* Add 'show info' command to all servers, which prints the directory in which... (diff)
downloadopensim-SC-42e54537aa3121aa7e6dd1466f8445a506caa337.zip
opensim-SC-42e54537aa3121aa7e6dd1466f8445a506caa337.tar.gz
opensim-SC-42e54537aa3121aa7e6dd1466f8445a506caa337.tar.bz2
opensim-SC-42e54537aa3121aa7e6dd1466f8445a506caa337.tar.xz
* From inspecting OSGrid WP logs, it appears one particular client is failing because they are giving an illegal initial position to ScenePresence.MakeRootAgent()
* If we detected an illegal position (x, y outside region bounds or z < 0), then print out the illegal position and substitute an emergency <128, 128, 128> instead
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/ScenePresence.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.cs17
1 files changed, 14 insertions, 3 deletions
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
index 99b2085..22bb9ad 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -588,8 +588,19 @@ namespace OpenSim.Region.Environment.Scenes
588 public void MakeRootAgent(LLVector3 pos, bool isFlying) 588 public void MakeRootAgent(LLVector3 pos, bool isFlying)
589 { 589 {
590// m_log.DebugFormat( 590// m_log.DebugFormat(
591// "[SCENEPRESENCE]: Upgrading child agent {0}, {1} to a root agent in {2}", 591// "[SCENE PRESENCE]: Upgrading child agent {0}, {1} to a root agent in {2} at pos {3}",
592// Name, UUID, m_scene.RegionInfo.RegionName); 592// Name, UUID, m_scene.RegionInfo.RegionName, pos);
593
594 if (pos.X < 0 || pos.X > Constants.RegionSize || pos.Y < 0 || pos.Y > Constants.RegionSize || pos.Z < 0)
595 {
596 LLVector3 emergencyPos = new LLVector3(128, 128, 128);
597
598 m_log.WarnFormat(
599 "[SCENE PRESENCE]: MakeRootAgent() was given an illegal position of {0} for avatar {2}, {3}. Substituting {4}",
600 pos, Name, UUID, emergencyPos);
601
602 pos = emergencyPos;
603 }
593 604
594 m_isChildAgent = false; 605 m_isChildAgent = false;
595 606
@@ -599,7 +610,7 @@ namespace OpenSim.Region.Environment.Scenes
599 localAVHeight = m_avHeight; 610 localAVHeight = m_avHeight;
600 } 611 }
601 612
602 float posZLimit = (float)m_scene.GetLandHeight((int)pos.X, (int)pos.Y); 613 float posZLimit = (float)m_scene.GetLandHeight((int)pos.X, (int)pos.Y);
603 float newPosZ = posZLimit + localAVHeight; 614 float newPosZ = posZLimit + localAVHeight;
604 if (posZLimit >= (pos.Z - (localAVHeight / 2)) && !(Single.IsInfinity(newPosZ) || Single.IsNaN(newPosZ))) 615 if (posZLimit >= (pos.Z - (localAVHeight / 2)) && !(Single.IsInfinity(newPosZ) || Single.IsNaN(newPosZ)))
605 { 616 {