From b4b52f5f75d39e4b9b0dc9ad42c339bdc3dc75c2 Mon Sep 17 00:00:00 2001 From: onefang Date: Wed, 24 Jul 2019 16:27:08 +1000 Subject: Move the terrain.raw file out of tree to a sim specific name. --- .../CoreModules/World/Estate/EstateManagementModule.cs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs index 3c45b68..4b55860 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs @@ -1355,15 +1355,24 @@ namespace OpenSim.Region.CoreModules.World.Estate if (terr != null) { + string file = Util.cacheDir() + "/terrain_"; + try + { + file = file + Uri.EscapeDataString(Scene.Name) + ".raw"; + } + catch (Exception ex) + { + file = file + ".raw"; + } // m_log.Warn("[CLIENT]: Got Request to Send Terrain in region " + Scene.RegionInfo.RegionName); - if (File.Exists(Util.dataDir() + "/terrain.raw")) + if (File.Exists(file)) { - File.Delete(Util.dataDir() + "/terrain.raw"); + File.Delete(file); } - terr.SaveToFile(Util.dataDir() + "/terrain.raw"); + terr.SaveToFile(file); byte[] bdata; - using(FileStream input = new FileStream(Util.dataDir() + "/terrain.raw",FileMode.Open)) + using(FileStream input = new FileStream(file, FileMode.Open)) { bdata = new byte[input.Length]; input.Read(bdata, 0, (int)input.Length); -- cgit v1.1