From 42e54537aa3121aa7e6dd1466f8445a506caa337 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Wed, 11 Jun 2008 01:31:39 +0000 Subject: * 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 --- OpenSim/Region/Environment/Scenes/ScenePresence.cs | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'OpenSim') 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 public void MakeRootAgent(LLVector3 pos, bool isFlying) { // m_log.DebugFormat( -// "[SCENEPRESENCE]: Upgrading child agent {0}, {1} to a root agent in {2}", -// Name, UUID, m_scene.RegionInfo.RegionName); +// "[SCENE PRESENCE]: Upgrading child agent {0}, {1} to a root agent in {2} at pos {3}", +// Name, UUID, m_scene.RegionInfo.RegionName, pos); + + if (pos.X < 0 || pos.X > Constants.RegionSize || pos.Y < 0 || pos.Y > Constants.RegionSize || pos.Z < 0) + { + LLVector3 emergencyPos = new LLVector3(128, 128, 128); + + m_log.WarnFormat( + "[SCENE PRESENCE]: MakeRootAgent() was given an illegal position of {0} for avatar {2}, {3}. Substituting {4}", + pos, Name, UUID, emergencyPos); + + pos = emergencyPos; + } m_isChildAgent = false; @@ -599,7 +610,7 @@ namespace OpenSim.Region.Environment.Scenes localAVHeight = m_avHeight; } - float posZLimit = (float)m_scene.GetLandHeight((int)pos.X, (int)pos.Y); + float posZLimit = (float)m_scene.GetLandHeight((int)pos.X, (int)pos.Y); float newPosZ = posZLimit + localAVHeight; if (posZLimit >= (pos.Z - (localAVHeight / 2)) && !(Single.IsInfinity(newPosZ) || Single.IsNaN(newPosZ))) { -- cgit v1.1