diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs | 35 |
1 files changed, 5 insertions, 30 deletions
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs index b0563c5..01f04d9 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs | |||
@@ -555,37 +555,12 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
555 | 555 | ||
556 | try | 556 | try |
557 | { | 557 | { |
558 | MemoryStream terrainStream = new MemoryStream(terrainData); | ||
559 | terr.LoadFromStream(filename, terrainStream); | ||
560 | terrainStream.Close(); | ||
558 | 561 | ||
559 | string localfilename = "terrain.raw"; | 562 | FileInfo x = new FileInfo(filename); |
560 | 563 | remoteClient.SendAlertMessage("Your terrain was loaded as a " + x.Extension + " file. It may take a few moments to appear."); | |
561 | if (terrainData.Length == 851968) | ||
562 | { | ||
563 | localfilename = Path.Combine(Util.dataDir(),"terrain.raw"); // It's a .LLRAW | ||
564 | } | ||
565 | |||
566 | if (terrainData.Length == 196662) // 24-bit 256x256 Bitmap | ||
567 | localfilename = Path.Combine(Util.dataDir(), "terrain.bmp"); | ||
568 | |||
569 | if (terrainData.Length == 256 * 256 * 4) // It's a .R32 | ||
570 | localfilename = Path.Combine(Util.dataDir(), "terrain.r32"); | ||
571 | |||
572 | if (terrainData.Length == 256 * 256 * 8) // It's a .R64 | ||
573 | localfilename = Path.Combine(Util.dataDir(), "terrain.r64"); | ||
574 | |||
575 | if (File.Exists(localfilename)) | ||
576 | { | ||
577 | File.Delete(localfilename); | ||
578 | } | ||
579 | |||
580 | FileStream input = new FileStream(localfilename, FileMode.CreateNew); | ||
581 | input.Write(terrainData, 0, terrainData.Length); | ||
582 | input.Close(); | ||
583 | |||
584 | FileInfo x = new FileInfo(localfilename); | ||
585 | |||
586 | terr.LoadFromFile(localfilename); | ||
587 | remoteClient.SendAlertMessage("Your terrain was loaded as a ." + x.Extension + " file. It may take a few moments to appear."); | ||
588 | |||
589 | } | 564 | } |
590 | catch (IOException e) | 565 | catch (IOException e) |
591 | { | 566 | { |