diff options
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 '')
-rw-r--r-- | OpenSim/Region/Capabilities/Caps.cs | 20 |
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; | |||
29 | using System.Collections; | 29 | using System.Collections; |
30 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
31 | using System.Text; | 31 | using System.Text; |
32 | using System.IO; | ||
32 | using libsecondlife; | 33 | using libsecondlife; |
33 | using OpenSim.Framework.Servers; | 34 | using OpenSim.Framework.Servers; |
34 | using OpenSim.Framework.Types; | 35 | using 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(); |