aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorKitto Flora2010-04-05 23:25:46 -0400
committerKitto Flora2010-04-05 23:25:46 -0400
commita97a887ea45a756d4691bb18d655bf09653e7bde (patch)
treef9a161705c64b53bb516c63355be19f6f238aac6 /OpenSim/Region
parentMerge branch 'master' of ssh://3dhosting.de/var/git/careminster (diff)
parentMerge branch 'master' of ssh://3dhosting.de/var/git/careminster (diff)
downloadopensim-SC_OLD-a97a887ea45a756d4691bb18d655bf09653e7bde.zip
opensim-SC_OLD-a97a887ea45a756d4691bb18d655bf09653e7bde.tar.gz
opensim-SC_OLD-a97a887ea45a756d4691bb18d655bf09653e7bde.tar.bz2
opensim-SC_OLD-a97a887ea45a756d4691bb18d655bf09653e7bde.tar.xz
Merge branch 'master' of ssh://3dhosting.de/var/git/careminster
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Framework/Interfaces/ISnmpModule.cs11
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs48
2 files changed, 37 insertions, 22 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/ISnmpModule.cs b/OpenSim/Region/Framework/Interfaces/ISnmpModule.cs
new file mode 100644
index 0000000..9790fc7
--- /dev/null
+++ b/OpenSim/Region/Framework/Interfaces/ISnmpModule.cs
@@ -0,0 +1,11 @@
1///////////////////////////////////////////////////////////////////
2//
3// (c) Careminster LImited, Melanie Thielker and the Meta7 Team
4//
5// This file is not open source. All rights reserved
6//
7public interface ISnmpModule
8{
9 void Alert(string message);
10 void Trap(string message);
11}
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 0277ed8..13d1d4e 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -106,9 +106,9 @@ namespace OpenSim.Region.Framework.Scenes
106 private bool m_hasGroupChanged = false; 106 private bool m_hasGroupChanged = false;
107 private long timeFirstChanged = 0; 107 private long timeFirstChanged = 0;
108 private long timeLastChanged = 0; 108 private long timeLastChanged = 0;
109 long m_maxPersistTime = 0; 109 private long m_maxPersistTime = 0;
110 long m_minPersistTime = 0; 110 private long m_minPersistTime = 0;
111 Random m_rand; 111 private Random m_rand;
112 112
113 private System.Threading.ReaderWriterLockSlim m_partsLock = new System.Threading.ReaderWriterLockSlim(); 113 private System.Threading.ReaderWriterLockSlim m_partsLock = new System.Threading.ReaderWriterLockSlim();
114 114
@@ -186,27 +186,31 @@ namespace OpenSim.Region.Framework.Scenes
186 timeLastChanged = DateTime.Now.Ticks; 186 timeLastChanged = DateTime.Now.Ticks;
187 if (!m_hasGroupChanged) 187 if (!m_hasGroupChanged)
188 timeFirstChanged = DateTime.Now.Ticks; 188 timeFirstChanged = DateTime.Now.Ticks;
189 if (m_rand == null) 189 if (m_rootPart != null && m_rootPart.UUID != null && m_scene != null)
190 { 190 {
191 byte[] val = new byte[16]; 191 if (m_rand == null)
192 m_rootPart.UUID.ToBytes(val, 0); 192 {
193 m_rand = new Random(BitConverter.ToInt32(val, 0)); 193 byte[] val = new byte[16];
194 } 194 m_rootPart.UUID.ToBytes(val, 0);
195 if (Scene.GetRootAgentCount() == 0) 195 m_rand = new Random(BitConverter.ToInt32(val, 0));
196 { 196 }
197 //If the region is empty, this change has been made by an automated process 197
198 //and thus we delay the persist time by a random amount between 1.5 and 2.5. 198 if (m_scene.GetRootAgentCount() == 0)
199 {
200 //If the region is empty, this change has been made by an automated process
201 //and thus we delay the persist time by a random amount between 1.5 and 2.5.
199 202
200 float factor = 1.5f + (float)(m_rand.NextDouble()); 203 float factor = 1.5f + (float)(m_rand.NextDouble());
201 m_maxPersistTime = (long)((float)Scene.m_persistAfter * factor); 204 m_maxPersistTime = (long)((float)m_scene.m_persistAfter * factor);
202 m_minPersistTime = (long)((float)Scene.m_dontPersistBefore * factor); 205 m_minPersistTime = (long)((float)m_scene.m_dontPersistBefore * factor);
203 } 206 }
204 else 207 else
205 { 208 {
206 //If the region is not empty, we want to obey the minimum and maximum persist times 209 //If the region is not empty, we want to obey the minimum and maximum persist times
207 //but add a random factor so we stagger the object persistance a little 210 //but add a random factor so we stagger the object persistance a little
208 m_maxPersistTime = (long)((float)Scene.m_persistAfter * (1.0d - (m_rand.NextDouble() / 5.0d))); //Multiply by 1.0-1.5 211 m_maxPersistTime = (long)((float)m_scene.m_persistAfter * (1.0d - (m_rand.NextDouble() / 5.0d))); //Multiply by 1.0-1.5
209 m_minPersistTime = (long)((float)Scene.m_dontPersistBefore * (1.0d + (m_rand.NextDouble() / 2.0d))); //Multiply by 0.8-1.0 212 m_minPersistTime = (long)((float)m_scene.m_dontPersistBefore * (1.0d + (m_rand.NextDouble() / 2.0d))); //Multiply by 0.8-1.0
213 }
210 } 214 }
211 } 215 }
212 m_hasGroupChanged = value; 216 m_hasGroupChanged = value;