aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Capabilities/Caps.cs
diff options
context:
space:
mode:
authorMW2007-07-11 17:47:25 +0000
committerMW2007-07-11 17:47:25 +0000
commit2ceff87a02d9862497d1d8fa965851ae2d9c9b1b (patch)
tree47cbd7a3fe7678c9ac2d56ace21ea4ebf8f628ef /OpenSim/Region/Capabilities/Caps.cs
parentupdated libsecondlife.dll to a 1.18 version (from the libsecondlife aditi bra... (diff)
downloadopensim-SC-2ceff87a02d9862497d1d8fa965851ae2d9c9b1b.zip
opensim-SC-2ceff87a02d9862497d1d8fa965851ae2d9c9b1b.tar.gz
opensim-SC-2ceff87a02d9862497d1d8fa965851ae2d9c9b1b.tar.bz2
opensim-SC-2ceff87a02d9862497d1d8fa965851ae2d9c9b1b.tar.xz
More work on UserProfile and inventory cache (still currently not enabled).
Asset uploading over CAPS now works, and although inventory isn't really working yet, this should now at least enables texturing of prims.
Diffstat (limited to 'OpenSim/Region/Capabilities/Caps.cs')
-rw-r--r--OpenSim/Region/Capabilities/Caps.cs20
1 files changed, 12 insertions, 8 deletions
diff --git a/OpenSim/Region/Capabilities/Caps.cs b/OpenSim/Region/Capabilities/Caps.cs
index 6068076..db8df9b 100644
--- a/OpenSim/Region/Capabilities/Caps.cs
+++ b/OpenSim/Region/Capabilities/Caps.cs
@@ -29,6 +29,7 @@ using System;
29using System.Collections; 29using System.Collections;
30using System.Collections.Generic; 30using System.Collections.Generic;
31using System.Text; 31using System.Text;
32using System.IO;
32using libsecondlife; 33using libsecondlife;
33using OpenSim.Framework.Servers; 34using OpenSim.Framework.Servers;
34using OpenSim.Framework.Types; 35using OpenSim.Framework.Types;
@@ -118,7 +119,7 @@ namespace OpenSim.Region.Capabilities
118 string capsBaseUrl = "http://" + m_httpListenerHostName + ":" + m_httpListenPort.ToString() + "/CAPS/" + m_capsObjectPath; 119 string capsBaseUrl = "http://" + m_httpListenerHostName + ":" + m_httpListenPort.ToString() + "/CAPS/" + m_capsObjectPath;
119 120
120 caps.MapLayer = capsBaseUrl + m_mapLayerPath; 121 caps.MapLayer = capsBaseUrl + m_mapLayerPath;
121 // caps.NewFileAgentInventory = capsBaseUrl + m_newInventory; 122 caps.NewFileAgentInventory = capsBaseUrl + m_newInventory;
122 123
123 return caps; 124 return caps;
124 } 125 }
@@ -253,10 +254,12 @@ namespace OpenSim.Region.Capabilities
253 LLUUID newInvItem = LLUUID.Random(); 254 LLUUID newInvItem = LLUUID.Random();
254 string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000"); 255 string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000");
255 AssetUploader uploader = new AssetUploader(newAsset, newInvItem, uploaderPath, this.httpListener); 256 AssetUploader uploader = new AssetUploader(newAsset, newInvItem, uploaderPath, this.httpListener);
257
258 string capsBase = "/CAPS/" + m_capsObjectPath;
259 httpListener.AddStreamHandler(new BinaryStreamHandler("POST", capsBase + uploaderPath, uploader.uploaderCaps));
256 260
257 AddLegacyCapsHandler( httpListener, uploaderPath, uploader.uploaderCaps); 261
258 262 string uploaderURL = "http://" + m_httpListenerHostName + ":" + m_httpListenPort.ToString() + "/CAPS/" + m_capsObjectPath +uploaderPath;
259 string uploaderURL = "http://" + m_httpListenerHostName + ":" + m_httpListenPort.ToString() + "/CAPS/" + uploaderPath;
260 //Console.WriteLine("uploader url is " + uploaderURL); 263 //Console.WriteLine("uploader url is " + uploaderURL);
261 res += "<llsd><map>"; 264 res += "<llsd><map>";
262 res += "<key>uploader</key><string>" + uploaderURL + "</string>"; 265 res += "<key>uploader</key><string>" + uploaderURL + "</string>";
@@ -303,10 +306,10 @@ namespace OpenSim.Region.Capabilities
303 306
304 } 307 }
305 308
306 public string uploaderCaps(string request, string path, string param) 309 public string uploaderCaps(byte[] data, string path, string param)
307 { 310 {
308 Encoding _enc = Encoding.UTF8; 311 //Encoding _enc = Encoding.UTF8;
309 byte[] data = _enc.GetBytes(request); 312 //byte[] data = _enc.GetBytes(request);
310 //Console.WriteLine("recieved upload " + Util.FieldToString(data)); 313 //Console.WriteLine("recieved upload " + Util.FieldToString(data));
311 LLUUID inv = this.inventoryItemID; 314 LLUUID inv = this.inventoryItemID;
312 string res = ""; 315 string res = "";
@@ -324,7 +327,8 @@ namespace OpenSim.Region.Capabilities
324 OnUpLoad(newAssetID, inv, data); 327 OnUpLoad(newAssetID, inv, data);
325 } 328 }
326 329
327 /*FileStream fs = File.Create("upload.jp2"); 330 /*
331 FileStream fs = File.Create("upload.jp2");
328 BinaryWriter bw = new BinaryWriter(fs); 332 BinaryWriter bw = new BinaryWriter(fs);
329 bw.Write(data); 333 bw.Write(data);
330 bw.Close(); 334 bw.Close();