From 2844c56ef4c8cb671b481a356d6aac33851c0c04 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Sat, 21 Apr 2007 05:51:10 +0000 Subject: Terrain / Physics / Storage: * Added terrain "taint" - if terrain is tainted, the terrain is marked as needing to be saved. * Added check for taint in the Backup() routine, if taint is found, terrain is saved and physics engine is notified. --- OpenSim.RegionServer/world/World.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'OpenSim.RegionServer/world') diff --git a/OpenSim.RegionServer/world/World.cs b/OpenSim.RegionServer/world/World.cs index 56f5edb..4d57f14 100644 --- a/OpenSim.RegionServer/world/World.cs +++ b/OpenSim.RegionServer/world/World.cs @@ -282,7 +282,7 @@ namespace OpenSim.world Console.WriteLine("creating new terrain"); this.Terrain.hills(); - //this.localStorage.SaveMap(this.Terrain.map); + this.localStorage.SaveMap(this.Terrain.getHeights1D()); } else { @@ -423,7 +423,14 @@ namespace OpenSim.world public bool Backup() { - + if (Terrain.tainted > 0) + { + Terrain.tainted = 0; + OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs: Backup() - Terrain tainted, saving."); + localStorage.SaveMap(Terrain.getHeights1D()); + OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs: Backup() - Terrain saved, informing Physics."); + phyScene.SetTerrain(Terrain.getHeights1D()); + } OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs: Backup() - Backing up Primitives"); foreach (libsecondlife.LLUUID UUID in Entities.Keys) { -- cgit v1.1