diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/EventManager.cs | 13 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 15 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 5 |
3 files changed, 28 insertions, 5 deletions
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index 8691b91..5b1c9f4 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs | |||
@@ -816,6 +816,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
816 | public event ParcelPrimCountTainted OnParcelPrimCountTainted; | 816 | public event ParcelPrimCountTainted OnParcelPrimCountTainted; |
817 | public event GetScriptRunning OnGetScriptRunning; | 817 | public event GetScriptRunning OnGetScriptRunning; |
818 | 818 | ||
819 | public delegate void ThrottleUpdate(ScenePresence scenePresence); | ||
820 | |||
821 | public event ThrottleUpdate OnThrottleUpdate; | ||
822 | |||
819 | /// <summary> | 823 | /// <summary> |
820 | /// RegisterCapsEvent is called by Scene after the Caps object | 824 | /// RegisterCapsEvent is called by Scene after the Caps object |
821 | /// has been instantiated and before it is return to the | 825 | /// has been instantiated and before it is return to the |
@@ -3130,5 +3134,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
3130 | } | 3134 | } |
3131 | } | 3135 | } |
3132 | } | 3136 | } |
3137 | |||
3138 | public void TriggerThrottleUpdate(ScenePresence scenePresence) | ||
3139 | { | ||
3140 | ThrottleUpdate handler = OnThrottleUpdate; | ||
3141 | if (handler != null) | ||
3142 | { | ||
3143 | handler(scenePresence); | ||
3144 | } | ||
3145 | } | ||
3133 | } | 3146 | } |
3134 | } | 3147 | } |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 74d2629..b9f9c86 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -112,7 +112,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
112 | private long timeLastChanged = 0; | 112 | private long timeLastChanged = 0; |
113 | private long m_maxPersistTime = 0; | 113 | private long m_maxPersistTime = 0; |
114 | private long m_minPersistTime = 0; | 114 | private long m_minPersistTime = 0; |
115 | private Random m_rand; | 115 | // private Random m_rand; |
116 | private List<ScenePresence> m_linkedAvatars = new List<ScenePresence>(); | 116 | private List<ScenePresence> m_linkedAvatars = new List<ScenePresence>(); |
117 | 117 | ||
118 | /// <summary> | 118 | /// <summary> |
@@ -130,6 +130,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
130 | { | 130 | { |
131 | if (value) | 131 | if (value) |
132 | { | 132 | { |
133 | |||
133 | if (m_isBackedUp) | 134 | if (m_isBackedUp) |
134 | { | 135 | { |
135 | m_scene.SceneGraph.FireChangeBackup(this); | 136 | m_scene.SceneGraph.FireChangeBackup(this); |
@@ -139,19 +140,21 @@ namespace OpenSim.Region.Framework.Scenes | |||
139 | timeFirstChanged = DateTime.Now.Ticks; | 140 | timeFirstChanged = DateTime.Now.Ticks; |
140 | if (m_rootPart != null && m_rootPart.UUID != null && m_scene != null) | 141 | if (m_rootPart != null && m_rootPart.UUID != null && m_scene != null) |
141 | { | 142 | { |
143 | /* | ||
142 | if (m_rand == null) | 144 | if (m_rand == null) |
143 | { | 145 | { |
144 | byte[] val = new byte[16]; | 146 | byte[] val = new byte[16]; |
145 | m_rootPart.UUID.ToBytes(val, 0); | 147 | m_rootPart.UUID.ToBytes(val, 0); |
146 | m_rand = new Random(BitConverter.ToInt32(val, 0)); | 148 | m_rand = new Random(BitConverter.ToInt32(val, 0)); |
147 | } | 149 | } |
148 | 150 | */ | |
149 | if (m_scene.GetRootAgentCount() == 0) | 151 | if (m_scene.GetRootAgentCount() == 0) |
150 | { | 152 | { |
151 | //If the region is empty, this change has been made by an automated process | 153 | //If the region is empty, this change has been made by an automated process |
152 | //and thus we delay the persist time by a random amount between 1.5 and 2.5. | 154 | //and thus we delay the persist time by a random amount between 1.5 and 2.5. |
153 | 155 | ||
154 | float factor = 1.5f + (float)(m_rand.NextDouble()); | 156 | // float factor = 1.5f + (float)(m_rand.NextDouble()); |
157 | float factor = 2.0f; | ||
155 | m_maxPersistTime = (long)((float)m_scene.m_persistAfter * factor); | 158 | m_maxPersistTime = (long)((float)m_scene.m_persistAfter * factor); |
156 | m_minPersistTime = (long)((float)m_scene.m_dontPersistBefore * factor); | 159 | m_minPersistTime = (long)((float)m_scene.m_dontPersistBefore * factor); |
157 | } | 160 | } |
@@ -159,8 +162,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
159 | { | 162 | { |
160 | //If the region is not empty, we want to obey the minimum and maximum persist times | 163 | //If the region is not empty, we want to obey the minimum and maximum persist times |
161 | //but add a random factor so we stagger the object persistance a little | 164 | //but add a random factor so we stagger the object persistance a little |
162 | m_maxPersistTime = (long)((float)m_scene.m_persistAfter * (1.0d - (m_rand.NextDouble() / 5.0d))); //Multiply by 1.0-1.5 | 165 | // m_maxPersistTime = (long)((float)m_scene.m_persistAfter * (1.0d - (m_rand.NextDouble() / 5.0d))); //Multiply by 1.0-1.5 |
163 | m_minPersistTime = (long)((float)m_scene.m_dontPersistBefore * (1.0d + (m_rand.NextDouble() / 2.0d))); //Multiply by 0.8-1.0 | 166 | // m_minPersistTime = (long)((float)m_scene.m_dontPersistBefore * (1.0d + (m_rand.NextDouble() / 2.0d))); //Multiply by 0.8-1.0 |
167 | m_maxPersistTime = m_scene.m_persistAfter; | ||
168 | m_minPersistTime = m_scene.m_dontPersistBefore; | ||
164 | } | 169 | } |
165 | } | 170 | } |
166 | } | 171 | } |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 2c18397..25a53b4 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -794,6 +794,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
794 | ControllingClient.OnChangeAnim += avnHandleChangeAnim; | 794 | ControllingClient.OnChangeAnim += avnHandleChangeAnim; |
795 | ControllingClient.OnForceReleaseControls += HandleForceReleaseControls; | 795 | ControllingClient.OnForceReleaseControls += HandleForceReleaseControls; |
796 | ControllingClient.OnAutoPilotGo += MoveToTarget; | 796 | ControllingClient.OnAutoPilotGo += MoveToTarget; |
797 | ControllingClient.OnUpdateThrottles += RaiseUpdateThrottles; | ||
797 | 798 | ||
798 | // ControllingClient.OnChildAgentStatus += new StatusChange(this.ChildStatusChange); | 799 | // ControllingClient.OnChildAgentStatus += new StatusChange(this.ChildStatusChange); |
799 | // ControllingClient.OnStopMovement += new GenericCall2(this.StopMovement); | 800 | // ControllingClient.OnStopMovement += new GenericCall2(this.StopMovement); |
@@ -3174,6 +3175,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
3174 | } | 3175 | } |
3175 | 3176 | ||
3176 | private static Vector3 marker = new Vector3(-1f, -1f, -1f); | 3177 | private static Vector3 marker = new Vector3(-1f, -1f, -1f); |
3178 | private void RaiseUpdateThrottles() | ||
3179 | { | ||
3180 | m_scene.EventManager.TriggerThrottleUpdate(this); | ||
3181 | } | ||
3177 | /// <summary> | 3182 | /// <summary> |
3178 | /// This updates important decision making data about a child agent | 3183 | /// This updates important decision making data about a child agent |
3179 | /// The main purpose is to figure out what objects to send to a child agent that's in a neighboring region | 3184 | /// The main purpose is to figure out what objects to send to a child agent that's in a neighboring region |