aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorMW2007-06-24 16:19:53 +0000
committerMW2007-06-24 16:19:53 +0000
commit1b8b75d80ae5d61fcbac60602cf9af6cef2c4003 (patch)
tree78fde772e1b93d75c8c72ff57905e8bde0086a0e /OpenSim
parentDisabled the CheckSum Server as it seems that isn't used by viewer 1.18. (diff)
downloadopensim-SC_OLD-1b8b75d80ae5d61fcbac60602cf9af6cef2c4003.zip
opensim-SC_OLD-1b8b75d80ae5d61fcbac60602cf9af6cef2c4003.tar.gz
opensim-SC_OLD-1b8b75d80ae5d61fcbac60602cf9af6cef2c4003.tar.bz2
opensim-SC_OLD-1b8b75d80ae5d61fcbac60602cf9af6cef2c4003.tar.xz
A bit more work on the AssetCache.
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/OpenSim.Caches/AssetCache.cs12
-rw-r--r--OpenSim/OpenSim.Region/Caps.cs14
-rw-r--r--OpenSim/OpenSim.Region/Scenes/Scene.cs5
-rw-r--r--OpenSim/OpenSim.RegionServer/ClientView.AgentAssetUpload.cs1
4 files changed, 17 insertions, 15 deletions
diff --git a/OpenSim/OpenSim.Caches/AssetCache.cs b/OpenSim/OpenSim.Caches/AssetCache.cs
index 44d22a9..f310752 100644
--- a/OpenSim/OpenSim.Caches/AssetCache.cs
+++ b/OpenSim/OpenSim.Caches/AssetCache.cs
@@ -571,17 +571,23 @@ namespace OpenSim.Caches
571 { 571 {
572 public AssetRequest request; 572 public AssetRequest request;
573 public event DownloadComplete OnComplete; 573 public event DownloadComplete OnComplete;
574 574 Thread m_thread;
575 public TextureSender(AssetRequest req) 575 public TextureSender(AssetRequest req)
576 { 576 {
577 request = req; 577 request = req;
578 //Console.WriteLine("creating worker thread for texture " + req.ImageInfo.FullID.ToStringHyphenated()); 578 //Console.WriteLine("creating worker thread for texture " + req.ImageInfo.FullID.ToStringHyphenated());
579 //Console.WriteLine("texture data length is " + req.ImageInfo.Data.Length); 579 //Console.WriteLine("texture data length is " + req.ImageInfo.Data.Length);
580 // Console.WriteLine("in " + req.NumPackets + " packets"); 580 // Console.WriteLine("in " + req.NumPackets + " packets");
581 ThreadPool.QueueUserWorkItem(new WaitCallback(SendTexture), new object()); 581 //ThreadPool.QueueUserWorkItem(new WaitCallback(SendTexture), new object());
582
583 //need some sort of custom threadpool here, as using the .net one, overloads it and stops the handling of incoming packets etc
584 //but don't really want to create a thread for every texture download
585 m_thread = new Thread(new ThreadStart(SendTexture));
586 m_thread.IsBackground = true;
587 m_thread.Start();
582 } 588 }
583 589
584 public void SendTexture(Object obj) 590 public void SendTexture()
585 { 591 {
586 //Console.WriteLine("starting to send sending texture " + request.ImageInfo.FullID.ToStringHyphenated()); 592 //Console.WriteLine("starting to send sending texture " + request.ImageInfo.FullID.ToStringHyphenated());
587 while (request.PacketCounter != request.NumPackets) 593 while (request.PacketCounter != request.NumPackets)
diff --git a/OpenSim/OpenSim.Region/Caps.cs b/OpenSim/OpenSim.Region/Caps.cs
index 5be481e..59f24e3 100644
--- a/OpenSim/OpenSim.Region/Caps.cs
+++ b/OpenSim/OpenSim.Region/Caps.cs
@@ -86,7 +86,6 @@ namespace OpenSim.Region
86 /// <returns></returns> 86 /// <returns></returns>
87 public string MapLayer(string request, string path, string param) 87 public string MapLayer(string request, string path, string param)
88 { 88 {
89
90 string res = "<llsd><map><key>AgentData</key><map><key>Flags</key><integer>0</integer></map><key>LayerData</key><array>"; 89 string res = "<llsd><map><key>AgentData</key><map><key>Flags</key><integer>0</integer></map><key>LayerData</key><array>";
91 res += this.BuildLLSDMapLayerResponse(); 90 res += this.BuildLLSDMapLayerResponse();
92 res += "</array></map></llsd>"; 91 res += "</array></map></llsd>";
@@ -119,12 +118,12 @@ namespace OpenSim.Region
119 118
120 public string NewAgentInventory(string request, string path, string param) 119 public string NewAgentInventory(string request, string path, string param)
121 { 120 {
122
123 //Console.WriteLine("received upload request:"+ request); 121 //Console.WriteLine("received upload request:"+ request);
124 string res = ""; 122 string res = "";
125 LLUUID newAsset = LLUUID.Random(); 123 LLUUID newAsset = LLUUID.Random();
126 string uploaderPath = capsObjectPath + Util.RandomClass.Next(5000, 7000).ToString("0000"); 124 LLUUID newInvItem = LLUUID.Random();
127 AssetUploader uploader = new AssetUploader(newAsset, uploaderPath, this.httpListener); 125 string uploaderPath = capsObjectPath + Util.RandomClass.Next(5000, 8000).ToString("0000");
126 AssetUploader uploader = new AssetUploader(newAsset,newInvItem, uploaderPath, this.httpListener);
128 httpListener.AddRestHandler("POST", "/CAPS/" + uploaderPath, uploader.uploaderCaps); 127 httpListener.AddRestHandler("POST", "/CAPS/" + uploaderPath, uploader.uploaderCaps);
129 string uploaderURL = "http://" + httpListenerAddress + ":" + httpListenPort.ToString() + "/CAPS/" + uploaderPath; 128 string uploaderURL = "http://" + httpListenerAddress + ":" + httpListenPort.ToString() + "/CAPS/" + uploaderPath;
130 Console.WriteLine("uploader url is " + uploaderURL); 129 Console.WriteLine("uploader url is " + uploaderURL);
@@ -157,11 +156,12 @@ namespace OpenSim.Region
157 156
158 private string uploaderPath = ""; 157 private string uploaderPath = "";
159 private LLUUID newAssetID; 158 private LLUUID newAssetID;
160 //private LLUUID inventoryItemID; 159 private LLUUID inventoryItemID;
161 private BaseHttpServer httpListener; 160 private BaseHttpServer httpListener;
162 public AssetUploader(LLUUID assetID, string path,BaseHttpServer httpServer) 161 public AssetUploader(LLUUID assetID, LLUUID inventoryItem, string path, BaseHttpServer httpServer)
163 { 162 {
164 newAssetID = assetID; 163 newAssetID = assetID;
164 inventoryItemID = inventoryItem;
165 uploaderPath = path; 165 uploaderPath = path;
166 httpListener = httpServer; 166 httpListener = httpServer;
167 167
@@ -172,7 +172,7 @@ namespace OpenSim.Region
172 Encoding _enc = System.Text.Encoding.UTF8; 172 Encoding _enc = System.Text.Encoding.UTF8;
173 byte[] data = _enc.GetBytes(request); 173 byte[] data = _enc.GetBytes(request);
174 //Console.WriteLine("recieved upload " + Util.FieldToString(data)); 174 //Console.WriteLine("recieved upload " + Util.FieldToString(data));
175 LLUUID inv = LLUUID.Random(); 175 LLUUID inv = this.inventoryItemID;
176 string res = ""; 176 string res = "";
177 res += "<llsd><map>"; 177 res += "<llsd><map>";
178 res += "<key>new_asset</key><string>" + newAssetID.ToStringHyphenated() + "</string>"; 178 res += "<key>new_asset</key><string>" + newAssetID.ToStringHyphenated() + "</string>";
diff --git a/OpenSim/OpenSim.Region/Scenes/Scene.cs b/OpenSim/OpenSim.Region/Scenes/Scene.cs
index 07b1ee4..ad6d336 100644
--- a/OpenSim/OpenSim.Region/Scenes/Scene.cs
+++ b/OpenSim/OpenSim.Region/Scenes/Scene.cs
@@ -422,10 +422,6 @@ namespace OpenSim.Region.Scenes
422 float[] map = this.localStorage.LoadWorld(); 422 float[] map = this.localStorage.LoadWorld();
423 if (map == null) 423 if (map == null)
424 { 424 {
425 // Console.WriteLine("creating new terrain");
426 // this.Terrain.hills();
427
428 // this.localStorage.SaveMap(this.Terrain.getHeights1D());
429 if (string.IsNullOrEmpty(this.m_regInfo.estateSettings.terrainFile)) 425 if (string.IsNullOrEmpty(this.m_regInfo.estateSettings.terrainFile))
430 { 426 {
431 Console.WriteLine("No default terrain, procedurally generating..."); 427 Console.WriteLine("No default terrain, procedurally generating...");
@@ -795,7 +791,6 @@ namespace OpenSim.Region.Scenes
795 { 791 {
796 List<MapBlockData> mapBlocks; 792 List<MapBlockData> mapBlocks;
797 mapBlocks = this.commsManager.GridServer.RequestNeighbourMapBlocks(minX, minY, maxX, maxY); 793 mapBlocks = this.commsManager.GridServer.RequestNeighbourMapBlocks(minX, minY, maxX, maxY);
798 Console.WriteLine("number of mapblocks " + mapBlocks.Count +" in "+ minX +" , " + minY + " , "+ maxX + " , "+ maxY);
799 remoteClient.SendMapBlock(mapBlocks); 794 remoteClient.SendMapBlock(mapBlocks);
800 } 795 }
801 796
diff --git a/OpenSim/OpenSim.RegionServer/ClientView.AgentAssetUpload.cs b/OpenSim/OpenSim.RegionServer/ClientView.AgentAssetUpload.cs
index 1b01f24..914c38a 100644
--- a/OpenSim/OpenSim.RegionServer/ClientView.AgentAssetUpload.cs
+++ b/OpenSim/OpenSim.RegionServer/ClientView.AgentAssetUpload.cs
@@ -289,6 +289,7 @@ namespace OpenSim
289 289
290 if (Asset.Data.Length > 2) 290 if (Asset.Data.Length > 2)
291 { 291 {
292 //data block should only have data in it, if there is no more data to be uploaded
292 this.SendCompleteMessage(); 293 this.SendCompleteMessage();
293 } 294 }
294 else 295 else