aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/ScenePresence.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs52
1 files changed, 16 insertions, 36 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 453523a..9dbe332 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -875,40 +875,15 @@ namespace OpenSim.Region.Framework.Scenes
875 } 875 }
876 } 876 }
877 877
878 if (pos.X < 0 || pos.Y < 0 || pos.Z < 0) 878 if (pos.X < 0f || pos.Y < 0f || pos.Z < 0f)
879 { 879 {
880 Vector3 emergencyPos = new Vector3(((int)Constants.RegionSize * 0.5f), ((int)Constants.RegionSize * 0.5f), 128);
881
882 if (pos.X < 0)
883 {
884 emergencyPos.X = (int)Constants.RegionSize + pos.X;
885 if (!(pos.Y < 0))
886 emergencyPos.Y = pos.Y;
887 if (!(pos.Z < 0))
888 emergencyPos.X = pos.X;
889 }
890 if (pos.Y < 0)
891 {
892 emergencyPos.Y = (int)Constants.RegionSize + pos.Y;
893 if (!(pos.X < 0))
894 emergencyPos.X = pos.X;
895 if (!(pos.Z < 0))
896 emergencyPos.Z = pos.Z;
897 }
898 if (pos.Z < 0)
899 {
900 if (!(pos.X < 0))
901 emergencyPos.X = pos.X;
902 if (!(pos.Y < 0))
903 emergencyPos.Y = pos.Y;
904 //Leave as 128
905 }
906
907 m_log.WarnFormat( 880 m_log.WarnFormat(
908 "[SCENE PRESENCE]: MakeRootAgent() was given an illegal position of {0} for avatar {1}, {2}. Substituting {3}", 881 "[SCENE PRESENCE]: MakeRootAgent() was given an illegal position of {0} for avatar {1}, {2}. Clamping",
909 pos, Name, UUID, emergencyPos); 882 pos, Name, UUID);
910 883
911 pos = emergencyPos; 884 if (pos.X < 0f) pos.X = 0f;
885 if (pos.Y < 0f) pos.Y = 0f;
886 if (pos.Z < 0f) pos.Z = 0f;
912 } 887 }
913 888
914 float localAVHeight = 1.56f; 889 float localAVHeight = 1.56f;
@@ -919,7 +894,7 @@ namespace OpenSim.Region.Framework.Scenes
919 894
920 float posZLimit = 0; 895 float posZLimit = 0;
921 896
922 if (pos.X <Constants.RegionSize && pos.Y < Constants.RegionSize) 897 if (pos.X < Constants.RegionSize && pos.Y < Constants.RegionSize)
923 posZLimit = (float)m_scene.Heightmap[(int)pos.X, (int)pos.Y]; 898 posZLimit = (float)m_scene.Heightmap[(int)pos.X, (int)pos.Y];
924 899
925 float newPosZ = posZLimit + localAVHeight / 2; 900 float newPosZ = posZLimit + localAVHeight / 2;
@@ -2881,7 +2856,12 @@ namespace OpenSim.Region.Framework.Scenes
2881 /// </summary> 2856 /// </summary>
2882 protected void CheckForSignificantMovement() 2857 protected void CheckForSignificantMovement()
2883 { 2858 {
2884 if (Util.GetDistanceTo(AbsolutePosition, posLastSignificantMove) > 0.5) 2859 // Movement updates for agents in neighboring regions are sent directly to clients.
2860 // This value only affects how often agent positions are sent to neighbor regions
2861 // for things such as distance-based update prioritization
2862 const float SIGNIFICANT_MOVEMENT = 2.0f;
2863
2864 if (Util.GetDistanceTo(AbsolutePosition, posLastSignificantMove) > SIGNIFICANT_MOVEMENT)
2885 { 2865 {
2886 posLastSignificantMove = AbsolutePosition; 2866 posLastSignificantMove = AbsolutePosition;
2887 m_scene.EventManager.TriggerSignificantClientMovement(m_controllingClient); 2867 m_scene.EventManager.TriggerSignificantClientMovement(m_controllingClient);
@@ -2897,13 +2877,13 @@ namespace OpenSim.Region.Framework.Scenes
2897 cadu.AgentID = UUID.Guid; 2877 cadu.AgentID = UUID.Guid;
2898 cadu.alwaysrun = m_setAlwaysRun; 2878 cadu.alwaysrun = m_setAlwaysRun;
2899 cadu.AVHeight = m_avHeight; 2879 cadu.AVHeight = m_avHeight;
2900 sLLVector3 tempCameraCenter = new sLLVector3(new Vector3(m_CameraCenter.X, m_CameraCenter.Y, m_CameraCenter.Z)); 2880 Vector3 tempCameraCenter = m_CameraCenter;
2901 cadu.cameraPosition = tempCameraCenter; 2881 cadu.cameraPosition = tempCameraCenter;
2902 cadu.drawdistance = m_DrawDistance; 2882 cadu.drawdistance = m_DrawDistance;
2903 if (m_scene.Permissions.IsGod(new UUID(cadu.AgentID))) 2883 if (m_scene.Permissions.IsGod(new UUID(cadu.AgentID)))
2904 cadu.godlevel = m_godlevel; 2884 cadu.godlevel = m_godlevel;
2905 cadu.GroupAccess = 0; 2885 cadu.GroupAccess = 0;
2906 cadu.Position = new sLLVector3(AbsolutePosition); 2886 cadu.Position = AbsolutePosition;
2907 cadu.regionHandle = m_rootRegionHandle; 2887 cadu.regionHandle = m_rootRegionHandle;
2908 float multiplier = 1; 2888 float multiplier = 1;
2909 int innacurateNeighbors = m_scene.GetInaccurateNeighborCount(); 2889 int innacurateNeighbors = m_scene.GetInaccurateNeighborCount();
@@ -2918,7 +2898,7 @@ namespace OpenSim.Region.Framework.Scenes
2918 2898
2919 //m_log.Info("[NeighborThrottle]: " + m_scene.GetInaccurateNeighborCount().ToString() + " - m: " + multiplier.ToString()); 2899 //m_log.Info("[NeighborThrottle]: " + m_scene.GetInaccurateNeighborCount().ToString() + " - m: " + multiplier.ToString());
2920 cadu.throttles = ControllingClient.GetThrottlesPacked(multiplier); 2900 cadu.throttles = ControllingClient.GetThrottlesPacked(multiplier);
2921 cadu.Velocity = new sLLVector3(Velocity); 2901 cadu.Velocity = Velocity;
2922 2902
2923 AgentPosition agentpos = new AgentPosition(); 2903 AgentPosition agentpos = new AgentPosition();
2924 agentpos.CopyFrom(cadu); 2904 agentpos.CopyFrom(cadu);