aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/Scene.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Scene.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs33
1 files changed, 18 insertions, 15 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index c2eac60..ef7346d 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -151,15 +151,6 @@ namespace OpenSim.Region.Environment.Scenes
151 Avatars = new Dictionary<LLUUID, ScenePresence>(); 151 Avatars = new Dictionary<LLUUID, ScenePresence>();
152 Prims = new Dictionary<LLUUID, SceneObjectGroup>(); 152 Prims = new Dictionary<LLUUID, SceneObjectGroup>();
153 153
154 MainLog.Instance.Verbose("Loading objects from datastore");
155 List<SceneObjectGroup> PrimsFromDB = storageManager.DataStore.LoadObjects();
156 foreach (SceneObjectGroup prim in PrimsFromDB)
157 {
158 AddEntity(prim);
159 }
160 MainLog.Instance.Verbose("Loaded " + PrimsFromDB.Count.ToString() + " object(s)");
161
162
163 MainLog.Instance.Verbose("Creating LandMap"); 154 MainLog.Instance.Verbose("Creating LandMap");
164 Terrain = new TerrainEngine((int)this.RegionInfo.RegionLocX, (int)this.RegionInfo.RegionLocY); 155 Terrain = new TerrainEngine((int)this.RegionInfo.RegionLocX, (int)this.RegionInfo.RegionLocY);
165 156
@@ -238,7 +229,7 @@ namespace OpenSim.Region.Environment.Scenes
238 229
239 //backup scene data 230 //backup scene data
240 storageCount++; 231 storageCount++;
241 if (storageCount > 1200) //set to how often you want to backup 232 if (storageCount > 600) //set to how often you want to backup
242 { 233 {
243 Backup(); 234 Backup();
244 storageCount = 0; 235 storageCount = 0;
@@ -462,12 +453,13 @@ namespace OpenSim.Region.Environment.Scenes
462 /// </summary> 453 /// </summary>
463 public void LoadPrimsFromStorage() 454 public void LoadPrimsFromStorage()
464 { 455 {
465 MainLog.Instance.Verbose("World.cs: LoadPrimsFromStorage() - Loading primitives"); 456 MainLog.Instance.Verbose("Loading objects from datastore");
466 List<SceneObjectGroup> NewObjectsList = storageManager.DataStore.LoadObjects(); 457 List<SceneObjectGroup> PrimsFromDB = storageManager.DataStore.LoadObjects();
467 foreach (SceneObjectGroup obj in NewObjectsList) 458 foreach (SceneObjectGroup prim in PrimsFromDB)
468 { 459 {
469 this.Objects.Add(obj.UUID, obj); 460 AddEntityFromStorage(prim);
470 } 461 }
462 MainLog.Instance.Verbose("Loaded " + PrimsFromDB.Count.ToString() + " object(s)");
471 } 463 }
472 464
473 /// <summary> 465 /// <summary>
@@ -520,6 +512,17 @@ namespace OpenSim.Region.Environment.Scenes
520 } 512 }
521 } 513 }
522 514
515 public void AddEntityFromStorage(SceneObjectGroup sceneObject)
516 {
517 sceneObject.RegionHandle = this.m_regionHandle;
518 sceneObject.SetScene(this);
519 foreach (SceneObjectPart part in sceneObject.Children.Values)
520 {
521 part.LocalID = this.PrimIDAllocate();
522 }
523 this.AddEntity(sceneObject);
524 }
525
523 public void AddEntity(SceneObjectGroup sceneObject) 526 public void AddEntity(SceneObjectGroup sceneObject)
524 { 527 {
525 Entities.Add(sceneObject.UUID, sceneObject); 528 Entities.Add(sceneObject.UUID, sceneObject);
@@ -781,7 +784,7 @@ namespace OpenSim.Region.Environment.Scenes
781 { 784 {
782 if (ent is SceneObjectGroup) 785 if (ent is SceneObjectGroup)
783 { 786 {
784 // ((SceneObject) ent).SendAllChildPrimsToClient(client); 787 ((SceneObjectGroup) ent).SendFullUpdateToClient(client);
785 } 788 }
786 } 789 }
787 } 790 }