aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment
diff options
context:
space:
mode:
authorTeravus Ovares2008-11-10 23:56:58 +0000
committerTeravus Ovares2008-11-10 23:56:58 +0000
commitd1457001150d7af6faf2a11e59b895320c6e3e9b (patch)
treee330afa46bdbafb24ec7bd8893a9c582c6718f68 /OpenSim/Region/Environment
parentfix README.txt to be 0.6 (diff)
downloadopensim-SC_OLD-d1457001150d7af6faf2a11e59b895320c6e3e9b.zip
opensim-SC_OLD-d1457001150d7af6faf2a11e59b895320c6e3e9b.tar.gz
opensim-SC_OLD-d1457001150d7af6faf2a11e59b895320c6e3e9b.tar.bz2
opensim-SC_OLD-d1457001150d7af6faf2a11e59b895320c6e3e9b.tar.xz
* Commit allows downloading of the .raw terrain from the estate tools.
* Implements the SendInitiateDownload method in IClientAPI * Uses the ITerrainModule Interface to write a terrain file to disk then uses a FileStream to read the binary file from the disk and put it in a byte array. and save to the xFer list. * It then tells the client to download the file and the client initiates an Xfer request.
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r--OpenSim/Region/Environment/Modules/Agent/Xfer/XferModule.cs1
-rw-r--r--OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs26
-rw-r--r--OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs6
3 files changed, 32 insertions, 1 deletions
diff --git a/OpenSim/Region/Environment/Modules/Agent/Xfer/XferModule.cs b/OpenSim/Region/Environment/Modules/Agent/Xfer/XferModule.cs
index 3c69621..2f9a691 100644
--- a/OpenSim/Region/Environment/Modules/Agent/Xfer/XferModule.cs
+++ b/OpenSim/Region/Environment/Modules/Agent/Xfer/XferModule.cs
@@ -105,6 +105,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.Xfer
105 /// <param name="fileName"></param> 105 /// <param name="fileName"></param>
106 public void RequestXfer(IClientAPI remoteClient, ulong xferID, string fileName) 106 public void RequestXfer(IClientAPI remoteClient, ulong xferID, string fileName)
107 { 107 {
108
108 lock (NewFiles) 109 lock (NewFiles)
109 { 110 {
110 if (NewFiles.ContainsKey(fileName)) 111 if (NewFiles.ContainsKey(fileName))
diff --git a/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs
index 041bba5..c38d502 100644
--- a/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs
+++ b/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs
@@ -421,6 +421,31 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
421 } 421 }
422 } 422 }
423 423
424 private void handleTerrainRequest(IClientAPI remote_client, string clientFileName)
425 {
426 // Save terrain here
427 OpenSim.Region.Environment.Modules.World.Terrain.ITerrainModule terr = m_scene.RequestModuleInterface<OpenSim.Region.Environment.Modules.World.Terrain.ITerrainModule>();
428
429 if (terr != null)
430 {
431 m_log.Warn("[CLIENT]: Got Request to Send Terrain in region " + m_scene.RegionInfo.RegionName);
432 if (System.IO.File.Exists(Util.dataDir() + "/terrain.raw"))
433 {
434 System.IO.File.Delete(Util.dataDir() + "/terrain.raw");
435 }
436 terr.SaveToFile(Util.dataDir() + "/terrain.raw");
437
438 System.IO.FileStream input = new System.IO.FileStream(Util.dataDir() + "/terrain.raw", System.IO.FileMode.Open);
439 byte[] bdata = new byte[input.Length];
440 input.Read(bdata, 0, (int)input.Length);
441 remote_client.SendAlertMessage("Terrain file written, starting download...");
442 m_scene.XferManager.AddNewFile("terrain.raw", bdata);
443 // Tell client about it
444 m_log.Warn("[CLIENT]: Sending Terrain to " + remote_client.Name);
445 remote_client.SendInitiateDownload("terrain.raw", clientFileName);
446 }
447 }
448
424 private void HandleRegionInfoRequest(IClientAPI remote_client) 449 private void HandleRegionInfoRequest(IClientAPI remote_client)
425 { 450 {
426 451
@@ -767,6 +792,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
767 client.OnEstateDebugRegionRequest += handleEstateDebugRegionRequest; 792 client.OnEstateDebugRegionRequest += handleEstateDebugRegionRequest;
768 client.OnEstateTeleportOneUserHomeRequest += handleEstateTeleportOneUserHomeRequest; 793 client.OnEstateTeleportOneUserHomeRequest += handleEstateTeleportOneUserHomeRequest;
769 client.OnEstateTeleportAllUsersHomeRequest += handleEstateTeleportAllUsersHomeRequest; 794 client.OnEstateTeleportAllUsersHomeRequest += handleEstateTeleportAllUsersHomeRequest;
795 client.OnRequestTerrain += handleTerrainRequest;
770 796
771 client.OnRegionInfoRequest += HandleRegionInfoRequest; 797 client.OnRegionInfoRequest += HandleRegionInfoRequest;
772 client.OnEstateCovenantRequest += HandleEstateCovenantRequest; 798 client.OnEstateCovenantRequest += HandleEstateCovenantRequest;
diff --git a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs
index cf8ba94..7b077ec 100644
--- a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs
+++ b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs
@@ -268,7 +268,7 @@ namespace OpenSim.Region.Environment.Modules.World.NPC
268 public event ObjectDeselect OnObjectDeselect; 268 public event ObjectDeselect OnObjectDeselect;
269 public event RegionInfoRequest OnRegionInfoRequest; 269 public event RegionInfoRequest OnRegionInfoRequest;
270 public event EstateCovenantRequest OnEstateCovenantRequest; 270 public event EstateCovenantRequest OnEstateCovenantRequest;
271 271 public event RequestTerrain OnRequestTerrain;
272 public event ObjectDuplicateOnRay OnObjectDuplicateOnRay; 272 public event ObjectDuplicateOnRay OnObjectDuplicateOnRay;
273 273
274 public event FriendActionDelegate OnApproveFriendRequest; 274 public event FriendActionDelegate OnApproveFriendRequest;
@@ -698,6 +698,10 @@ namespace OpenSim.Region.Environment.Modules.World.NPC
698 { 698 {
699 } 699 }
700 700
701 public void SendInitiateDownload(string simFileName, string clientFileName)
702 {
703 }
704
701 public void SendImageFirstPart(ushort numParts, UUID ImageUUID, uint ImageSize, byte[] ImageData, byte imageCodec) 705 public void SendImageFirstPart(ushort numParts, UUID ImageUUID, uint ImageSize, byte[] ImageData, byte imageCodec)
702 { 706 {
703 } 707 }