aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/Scene.cs
diff options
context:
space:
mode:
authorlbsa712007-07-26 14:55:42 +0000
committerlbsa712007-07-26 14:55:42 +0000
commit39b64564dca0e5cb57a2a8e1b60979ccaaf11ef6 (patch)
tree81ab89a9749577c6fa1a3a19c1ed09c1942ec201 /OpenSim/Region/Environment/Scenes/Scene.cs
parentAdded the default shape to the OpenSim library. Now need to get the new ruth ... (diff)
downloadopensim-SC_OLD-39b64564dca0e5cb57a2a8e1b60979ccaaf11ef6.zip
opensim-SC_OLD-39b64564dca0e5cb57a2a8e1b60979ccaaf11ef6.tar.gz
opensim-SC_OLD-39b64564dca0e5cb57a2a8e1b60979ccaaf11ef6.tar.bz2
opensim-SC_OLD-39b64564dca0e5cb57a2a8e1b60979ccaaf11ef6.tar.xz
* Started renaming world to Scene
* Update and UpdateMovement now first stores array to avoid collection update exceptions * Ignored some bins
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Scene.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs24
1 files changed, 14 insertions, 10 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 0e25e54..39584ad 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -140,23 +140,23 @@ namespace OpenSim.Region.Environment.Scenes
140 m_eventManager = new EventManager(); 140 m_eventManager = new EventManager();
141 141
142 m_eventManager.OnParcelPrimCountAdd += 142 m_eventManager.OnParcelPrimCountAdd +=
143 new EventManager.OnParcelPrimCountAddDelegate(m_LandManager.addPrimToLandPrimCounts); 143 m_LandManager.addPrimToLandPrimCounts;
144 144
145 MainLog.Instance.Verbose("World.cs - creating new entitities instance"); 145 MainLog.Instance.Verbose("Creating new entitities instance");
146 Entities = new Dictionary<LLUUID, EntityBase>(); 146 Entities = new Dictionary<LLUUID, EntityBase>();
147 Avatars = new Dictionary<LLUUID, ScenePresence>(); 147 Avatars = new Dictionary<LLUUID, ScenePresence>();
148 Prims = new Dictionary<LLUUID, SceneObject>(); 148 Prims = new Dictionary<LLUUID, SceneObject>();
149 149
150 MainLog.Instance.Verbose("World.cs - loading objects from datastore"); 150 MainLog.Instance.Verbose("Loading objects from datastore");
151 List<SceneObject> PrimsFromDB = storageManager.DataStore.LoadObjects(); 151 List<SceneObject> PrimsFromDB = storageManager.DataStore.LoadObjects();
152 foreach (SceneObject prim in PrimsFromDB) 152 foreach (SceneObject prim in PrimsFromDB)
153 { 153 {
154 AddEntity(prim); 154 AddEntity(prim);
155 } 155 }
156 MainLog.Instance.Verbose("World.cs - loaded " + PrimsFromDB.Count.ToString() + " object(s)"); 156 MainLog.Instance.Verbose("Loaded " + PrimsFromDB.Count.ToString() + " object(s)");
157 157
158 158
159 MainLog.Instance.Verbose("World.cs - creating LandMap"); 159 MainLog.Instance.Verbose("Creating LandMap");
160 Terrain = new TerrainEngine(); 160 Terrain = new TerrainEngine();
161 161
162 ScenePresence.LoadAnims(); 162 ScenePresence.LoadAnims();
@@ -198,7 +198,7 @@ namespace OpenSim.Region.Environment.Scenes
198 } 198 }
199 199
200 /// <summary> 200 /// <summary>
201 /// Performs per-frame updates on the world, this should be the central world loop 201 /// Performs per-frame updates on the scene, this should be the central world loop
202 /// </summary> 202 /// </summary>
203 public override void Update() 203 public override void Update()
204 { 204 {
@@ -210,9 +210,11 @@ namespace OpenSim.Region.Environment.Scenes
210 phyScene.GetResults(); 210 phyScene.GetResults();
211 } 211 }
212 212
213 foreach (LLUUID UUID in Entities.Keys) 213 List<EntityBase> moveEntities = new List<EntityBase>( Entities.Values );
214
215 foreach (EntityBase entity in moveEntities)
214 { 216 {
215 Entities[UUID].updateMovement(); 217 entity.UpdateMovement();
216 } 218 }
217 219
218 lock (m_syncRoot) 220 lock (m_syncRoot)
@@ -220,9 +222,11 @@ namespace OpenSim.Region.Environment.Scenes
220 phyScene.Simulate(timeStep); 222 phyScene.Simulate(timeStep);
221 } 223 }
222 224
223 foreach (LLUUID UUID in Entities.Keys) 225 List<EntityBase> updateEntities = new List<EntityBase>(Entities.Values);
226
227 foreach (EntityBase entity in updateEntities)
224 { 228 {
225 Entities[UUID].Update(); 229 entity.Update();
226 } 230 }
227 231
228 // General purpose event manager 232 // General purpose event manager