From 2ceff87a02d9862497d1d8fa965851ae2d9c9b1b Mon Sep 17 00:00:00 2001 From: MW Date: Wed, 11 Jul 2007 17:47:25 +0000 Subject: 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. --- OpenSim/Region/Capabilities/Caps.cs | 20 ++++++++++++-------- OpenSim/Region/Capabilities/LLSDCapsDetails.cs | 2 +- 2 files changed, 13 insertions(+), 9 deletions(-) (limited to 'OpenSim/Region/Capabilities') 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; using System.Collections; using System.Collections.Generic; using System.Text; +using System.IO; using libsecondlife; using OpenSim.Framework.Servers; using OpenSim.Framework.Types; @@ -118,7 +119,7 @@ namespace OpenSim.Region.Capabilities string capsBaseUrl = "http://" + m_httpListenerHostName + ":" + m_httpListenPort.ToString() + "/CAPS/" + m_capsObjectPath; caps.MapLayer = capsBaseUrl + m_mapLayerPath; - // caps.NewFileAgentInventory = capsBaseUrl + m_newInventory; + caps.NewFileAgentInventory = capsBaseUrl + m_newInventory; return caps; } @@ -253,10 +254,12 @@ namespace OpenSim.Region.Capabilities LLUUID newInvItem = LLUUID.Random(); string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000"); AssetUploader uploader = new AssetUploader(newAsset, newInvItem, uploaderPath, this.httpListener); + + string capsBase = "/CAPS/" + m_capsObjectPath; + httpListener.AddStreamHandler(new BinaryStreamHandler("POST", capsBase + uploaderPath, uploader.uploaderCaps)); - AddLegacyCapsHandler( httpListener, uploaderPath, uploader.uploaderCaps); - - string uploaderURL = "http://" + m_httpListenerHostName + ":" + m_httpListenPort.ToString() + "/CAPS/" + uploaderPath; + + string uploaderURL = "http://" + m_httpListenerHostName + ":" + m_httpListenPort.ToString() + "/CAPS/" + m_capsObjectPath +uploaderPath; //Console.WriteLine("uploader url is " + uploaderURL); res += ""; res += "uploader" + uploaderURL + ""; @@ -303,10 +306,10 @@ namespace OpenSim.Region.Capabilities } - public string uploaderCaps(string request, string path, string param) + public string uploaderCaps(byte[] data, string path, string param) { - Encoding _enc = Encoding.UTF8; - byte[] data = _enc.GetBytes(request); + //Encoding _enc = Encoding.UTF8; + //byte[] data = _enc.GetBytes(request); //Console.WriteLine("recieved upload " + Util.FieldToString(data)); LLUUID inv = this.inventoryItemID; string res = ""; @@ -324,7 +327,8 @@ namespace OpenSim.Region.Capabilities OnUpLoad(newAssetID, inv, data); } - /*FileStream fs = File.Create("upload.jp2"); + /* + FileStream fs = File.Create("upload.jp2"); BinaryWriter bw = new BinaryWriter(fs); bw.Write(data); bw.Close(); diff --git a/OpenSim/Region/Capabilities/LLSDCapsDetails.cs b/OpenSim/Region/Capabilities/LLSDCapsDetails.cs index 1f8b242..1522559 100644 --- a/OpenSim/Region/Capabilities/LLSDCapsDetails.cs +++ b/OpenSim/Region/Capabilities/LLSDCapsDetails.cs @@ -4,7 +4,7 @@ namespace OpenSim.Region.Capabilities public class LLSDCapsDetails { public string MapLayer = ""; - //public string NewFileAgentInventory = ""; + public string NewFileAgentInventory = ""; //public string EventQueueGet = ""; public LLSDCapsDetails() -- cgit v1.1