diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs | 48 |
1 files changed, 25 insertions, 23 deletions
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs index 8b15308..cc3db3f 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs | |||
@@ -1,4 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
@@ -24,17 +24,19 @@ | |||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | using System; | 27 | using System; |
28 | using System.Threading; | 28 | using System.Collections.Generic; |
29 | using System.Collections.Generic; | 29 | using System.IO; |
30 | using System.Reflection; | 30 | using System.Reflection; |
31 | using OpenMetaverse; | 31 | using System.Security; |
32 | using log4net; | 32 | using log4net; |
33 | using Nini.Config; | 33 | using Nini.Config; |
34 | using OpenSim.Framework; | 34 | using OpenMetaverse; |
35 | using OpenSim.Region.Framework.Interfaces; | 35 | using OpenSim.Framework; |
36 | using OpenSim.Region.Framework.Scenes; | 36 | using OpenSim.Region.CoreModules.World.Terrain; |
37 | 37 | using OpenSim.Region.Framework.Interfaces; | |
38 | using OpenSim.Region.Framework.Scenes; | ||
39 | |||
38 | namespace OpenSim.Region.CoreModules.World.Estate | 40 | namespace OpenSim.Region.CoreModules.World.Estate |
39 | { | 41 | { |
40 | public class EstateManagementModule : IEstateModule | 42 | public class EstateManagementModule : IEstateModule |
@@ -458,36 +460,36 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
458 | TerrainUploader = null; | 460 | TerrainUploader = null; |
459 | } | 461 | } |
460 | remoteClient.SendAlertMessage("Terrain Upload Complete. Loading...."); | 462 | remoteClient.SendAlertMessage("Terrain Upload Complete. Loading...."); |
461 | OpenSim.Region.CoreModules.World.Terrain.ITerrainModule terr = m_scene.RequestModuleInterface<OpenSim.Region.CoreModules.World.Terrain.ITerrainModule>(); | 463 | ITerrainModule terr = m_scene.RequestModuleInterface<ITerrainModule>(); |
462 | 464 | ||
463 | if (terr != null) | 465 | if (terr != null) |
464 | { | 466 | { |
465 | m_log.Warn("[CLIENT]: Got Request to Send Terrain in region " + m_scene.RegionInfo.RegionName); | 467 | m_log.Warn("[CLIENT]: Got Request to Send Terrain in region " + m_scene.RegionInfo.RegionName); |
466 | if (System.IO.File.Exists(Util.dataDir() + "/terrain.raw")) | 468 | if (File.Exists(Util.dataDir() + "/terrain.raw")) |
467 | { | 469 | { |
468 | System.IO.File.Delete(Util.dataDir() + "/terrain.raw"); | 470 | File.Delete(Util.dataDir() + "/terrain.raw"); |
469 | } | 471 | } |
470 | try | 472 | try |
471 | { | 473 | { |
472 | System.IO.FileStream input = new System.IO.FileStream(Util.dataDir() + "/terrain.raw", System.IO.FileMode.CreateNew); | 474 | FileStream input = new FileStream(Util.dataDir() + "/terrain.raw", FileMode.CreateNew); |
473 | input.Write(terrainData, 0, terrainData.Length); | 475 | input.Write(terrainData, 0, terrainData.Length); |
474 | input.Close(); | 476 | input.Close(); |
475 | } | 477 | } |
476 | catch (System.IO.IOException e) | 478 | catch (IOException e) |
477 | { | 479 | { |
478 | m_log.ErrorFormat("[TERRAIN]: Error Saving a terrain file uploaded via the estate tools. It gave us the following error: {0}", e.ToString()); | 480 | m_log.ErrorFormat("[TERRAIN]: Error Saving a terrain file uploaded via the estate tools. It gave us the following error: {0}", e.ToString()); |
479 | remoteClient.SendAlertMessage("There was an IO Exception loading your terrain. Please check free space"); | 481 | remoteClient.SendAlertMessage("There was an IO Exception loading your terrain. Please check free space"); |
480 | 482 | ||
481 | return; | 483 | return; |
482 | } | 484 | } |
483 | catch (System.Security.SecurityException e) | 485 | catch (SecurityException e) |
484 | { | 486 | { |
485 | m_log.ErrorFormat("[TERRAIN]: Error Saving a terrain file uploaded via the estate tools. It gave us the following error: {0}", e.ToString()); | 487 | m_log.ErrorFormat("[TERRAIN]: Error Saving a terrain file uploaded via the estate tools. It gave us the following error: {0}", e.ToString()); |
486 | remoteClient.SendAlertMessage("There was a security Exception loading your terrain. Please check the security on the simulator drive"); | 488 | remoteClient.SendAlertMessage("There was a security Exception loading your terrain. Please check the security on the simulator drive"); |
487 | 489 | ||
488 | return; | 490 | return; |
489 | } | 491 | } |
490 | catch (System.UnauthorizedAccessException e) | 492 | catch (UnauthorizedAccessException e) |
491 | { | 493 | { |
492 | m_log.ErrorFormat("[TERRAIN]: Error Saving a terrain file uploaded via the estate tools. It gave us the following error: {0}", e.ToString()); | 494 | m_log.ErrorFormat("[TERRAIN]: Error Saving a terrain file uploaded via the estate tools. It gave us the following error: {0}", e.ToString()); |
493 | remoteClient.SendAlertMessage("There was a security Exception loading your terrain. Please check the security on the simulator drive"); | 495 | remoteClient.SendAlertMessage("There was a security Exception loading your terrain. Please check the security on the simulator drive"); |
@@ -544,18 +546,18 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
544 | private void handleTerrainRequest(IClientAPI remote_client, string clientFileName) | 546 | private void handleTerrainRequest(IClientAPI remote_client, string clientFileName) |
545 | { | 547 | { |
546 | // Save terrain here | 548 | // Save terrain here |
547 | OpenSim.Region.CoreModules.World.Terrain.ITerrainModule terr = m_scene.RequestModuleInterface<OpenSim.Region.CoreModules.World.Terrain.ITerrainModule>(); | 549 | ITerrainModule terr = m_scene.RequestModuleInterface<ITerrainModule>(); |
548 | 550 | ||
549 | if (terr != null) | 551 | if (terr != null) |
550 | { | 552 | { |
551 | m_log.Warn("[CLIENT]: Got Request to Send Terrain in region " + m_scene.RegionInfo.RegionName); | 553 | m_log.Warn("[CLIENT]: Got Request to Send Terrain in region " + m_scene.RegionInfo.RegionName); |
552 | if (System.IO.File.Exists(Util.dataDir() + "/terrain.raw")) | 554 | if (File.Exists(Util.dataDir() + "/terrain.raw")) |
553 | { | 555 | { |
554 | System.IO.File.Delete(Util.dataDir() + "/terrain.raw"); | 556 | File.Delete(Util.dataDir() + "/terrain.raw"); |
555 | } | 557 | } |
556 | terr.SaveToFile(Util.dataDir() + "/terrain.raw"); | 558 | terr.SaveToFile(Util.dataDir() + "/terrain.raw"); |
557 | 559 | ||
558 | System.IO.FileStream input = new System.IO.FileStream(Util.dataDir() + "/terrain.raw", System.IO.FileMode.Open); | 560 | FileStream input = new FileStream(Util.dataDir() + "/terrain.raw", FileMode.Open); |
559 | byte[] bdata = new byte[input.Length]; | 561 | byte[] bdata = new byte[input.Length]; |
560 | input.Read(bdata, 0, (int)input.Length); | 562 | input.Read(bdata, 0, (int)input.Length); |
561 | remote_client.SendAlertMessage("Terrain file written, starting download..."); | 563 | remote_client.SendAlertMessage("Terrain file written, starting download..."); |