diff options
author | diva | 2009-06-18 00:48:39 +0000 |
---|---|---|
committer | diva | 2009-06-18 00:48:39 +0000 |
commit | 913bc3bdb380cebebd11b657966486448962ab47 (patch) | |
tree | f41837093cd692b9fe42a21c9cb1473ef81dd0f1 | |
parent | Fix an uninitialized data block. Thanks, jhurliman (diff) | |
download | opensim-SC-913bc3bdb380cebebd11b657966486448962ab47.zip opensim-SC-913bc3bdb380cebebd11b657966486448962ab47.tar.gz opensim-SC-913bc3bdb380cebebd11b657966486448962ab47.tar.bz2 opensim-SC-913bc3bdb380cebebd11b657966486448962ab47.tar.xz |
Moved OpenSim/Framework/Communications/Capabilities up to OpenSim/Framework/Capabilities. Didn't change the namespace because VC# is not helping, and this would imply manually changing more than 50 files. So the namespace is still OpenSim.Framework.Communications.Capabilities, to be cleaned up later by someone with more energy.
-rw-r--r-- | OpenSim/Framework/Capabilities/Caps.cs (renamed from OpenSim/Framework/Communications/Capabilities/Caps.cs) | 2424 | ||||
-rw-r--r-- | OpenSim/Framework/Capabilities/CapsHandlers.cs (renamed from OpenSim/Framework/Communications/Capabilities/CapsHandlers.cs) | 342 | ||||
-rw-r--r-- | OpenSim/Framework/Capabilities/CapsUtil.cs (renamed from OpenSim/Framework/Communications/Capabilities/CapsUtil.cs) | 124 | ||||
-rw-r--r-- | OpenSim/Framework/Capabilities/LLSD.cs (renamed from OpenSim/Framework/Communications/Capabilities/LLSD.cs) | 1358 | ||||
-rw-r--r-- | OpenSim/Framework/Capabilities/LLSDArray.cs (renamed from OpenSim/Framework/Communications/Capabilities/LLSDArray.cs) | 80 | ||||
-rw-r--r-- | OpenSim/Framework/Capabilities/LLSDAssetUploadComplete.cs (renamed from OpenSim/Framework/Communications/Capabilities/LLSDAssetUploadComplete.cs) | 90 | ||||
-rw-r--r-- | OpenSim/Framework/Capabilities/LLSDAssetUploadRequest.cs (renamed from OpenSim/Framework/Communications/Capabilities/LLSDAssetUploadRequest.cs) | 92 | ||||
-rw-r--r-- | OpenSim/Framework/Capabilities/LLSDAssetUploadResponse.cs (renamed from OpenSim/Framework/Communications/Capabilities/LLSDAssetUploadResponse.cs) | 82 | ||||
-rw-r--r-- | OpenSim/Framework/Capabilities/LLSDCapEvent.cs (renamed from OpenSim/Framework/Communications/Capabilities/LLSDCapEvent.cs) | 78 | ||||
-rw-r--r-- | OpenSim/Framework/Capabilities/LLSDEmpty.cs (renamed from OpenSim/Framework/Communications/Capabilities/LLSDEmpty.cs) | 72 | ||||
-rw-r--r-- | OpenSim/Framework/Capabilities/LLSDHelpers.cs (renamed from OpenSim/Framework/Communications/Capabilities/LLSDHelpers.cs) | 344 | ||||
-rw-r--r-- | OpenSim/Framework/Capabilities/LLSDInventoryItem.cs (renamed from OpenSim/Framework/Communications/Capabilities/LLSDInventoryItem.cs) | 194 | ||||
-rw-r--r-- | OpenSim/Framework/Capabilities/LLSDItemUpdate.cs (renamed from OpenSim/Framework/Communications/Capabilities/LLSDItemUpdate.cs) | 82 | ||||
-rw-r--r-- | OpenSim/Framework/Capabilities/LLSDMapLayer.cs (renamed from OpenSim/Framework/Communications/Capabilities/LLSDMapLayer.cs) | 90 | ||||
-rw-r--r-- | OpenSim/Framework/Capabilities/LLSDMapLayerResponse.cs (renamed from OpenSim/Framework/Communications/Capabilities/LLSDMapLayerResponse.cs) | 78 | ||||
-rw-r--r-- | OpenSim/Framework/Capabilities/LLSDMapRequest.cs (renamed from OpenSim/Framework/Communications/Capabilities/LLSDMapRequest.cs) | 76 | ||||
-rw-r--r-- | OpenSim/Framework/Capabilities/LLSDMethod.cs (renamed from OpenSim/Framework/Communications/Capabilities/LLSDMethod.cs) | 60 | ||||
-rw-r--r-- | OpenSim/Framework/Capabilities/LLSDMethodString.cs (renamed from OpenSim/Framework/Communications/Capabilities/LLSDMethodString.cs) | 62 | ||||
-rw-r--r-- | OpenSim/Framework/Capabilities/LLSDParcelVoiceInfoResponse.cs (renamed from OpenSim/Framework/Communications/Capabilities/LLSDParcelVoiceInfoResponse.cs) | 100 | ||||
-rw-r--r-- | OpenSim/Framework/Capabilities/LLSDRemoteParcelResponse.cs (renamed from OpenSim/Framework/Communications/Capabilities/LLSDRemoteParcelResponse.cs) | 84 | ||||
-rw-r--r-- | OpenSim/Framework/Capabilities/LLSDStreamHandler.cs (renamed from OpenSim/Framework/Communications/Capabilities/LLSDStreamHandler.cs) | 140 | ||||
-rw-r--r-- | OpenSim/Framework/Capabilities/LLSDTaskInventoryUploadComplete.cs (renamed from OpenSim/Framework/Communications/Capabilities/LLSDTaskInventoryUploadComplete.cs) | 100 | ||||
-rw-r--r-- | OpenSim/Framework/Capabilities/LLSDTaskScriptUpdate.cs (renamed from OpenSim/Framework/Communications/Capabilities/LLSDTaskScriptUpdate.cs) | 100 | ||||
-rw-r--r-- | OpenSim/Framework/Capabilities/LLSDTest.cs (renamed from OpenSim/Framework/Communications/Capabilities/LLSDTest.cs) | 78 | ||||
-rw-r--r-- | OpenSim/Framework/Capabilities/LLSDType.cs (renamed from OpenSim/Framework/Communications/Capabilities/LLSDType.cs) | 108 | ||||
-rw-r--r-- | OpenSim/Framework/Capabilities/LLSDVoiceAccountResponse.cs (renamed from OpenSim/Framework/Communications/Capabilities/LLSDVoiceAccountResponse.cs) | 112 | ||||
-rw-r--r-- | prebuild.xml | 44 |
27 files changed, 3319 insertions, 3275 deletions
diff --git a/OpenSim/Framework/Communications/Capabilities/Caps.cs b/OpenSim/Framework/Capabilities/Caps.cs index 8c14e1d..bd38b50 100644 --- a/OpenSim/Framework/Communications/Capabilities/Caps.cs +++ b/OpenSim/Framework/Capabilities/Caps.cs | |||
@@ -1,1212 +1,1212 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSimulator Project nor the | 12 | * * Neither the name of the OpenSimulator Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Collections; | 29 | using System.Collections; |
30 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
31 | using System.IO; | 31 | using System.IO; |
32 | using System.Reflection; | 32 | using System.Reflection; |
33 | using log4net; | 33 | using log4net; |
34 | using OpenMetaverse; | 34 | using OpenMetaverse; |
35 | using OpenSim.Framework.Servers; | 35 | using OpenSim.Framework.Servers; |
36 | using OpenSim.Framework.Servers.HttpServer; | 36 | using OpenSim.Framework.Servers.HttpServer; |
37 | using OpenSim.Services.Interfaces; | 37 | using OpenSim.Services.Interfaces; |
38 | 38 | ||
39 | // using OpenSim.Region.Framework.Interfaces; | 39 | // using OpenSim.Region.Framework.Interfaces; |
40 | 40 | ||
41 | namespace OpenSim.Framework.Communications.Capabilities | 41 | namespace OpenSim.Framework.Communications.Capabilities |
42 | { | 42 | { |
43 | public delegate void UpLoadedAsset( | 43 | public delegate void UpLoadedAsset( |
44 | string assetName, string description, UUID assetID, UUID inventoryItem, UUID parentFolder, | 44 | string assetName, string description, UUID assetID, UUID inventoryItem, UUID parentFolder, |
45 | byte[] data, string inventoryType, string assetType); | 45 | byte[] data, string inventoryType, string assetType); |
46 | 46 | ||
47 | public delegate UUID UpdateItem(UUID itemID, byte[] data); | 47 | public delegate UUID UpdateItem(UUID itemID, byte[] data); |
48 | 48 | ||
49 | public delegate void UpdateTaskScript(UUID itemID, UUID primID, bool isScriptRunning, byte[] data); | 49 | public delegate void UpdateTaskScript(UUID itemID, UUID primID, bool isScriptRunning, byte[] data); |
50 | 50 | ||
51 | public delegate void NewInventoryItem(UUID userID, InventoryItemBase item); | 51 | public delegate void NewInventoryItem(UUID userID, InventoryItemBase item); |
52 | 52 | ||
53 | public delegate void NewAsset(AssetBase asset); | 53 | public delegate void NewAsset(AssetBase asset); |
54 | 54 | ||
55 | public delegate UUID ItemUpdatedCallback(UUID userID, UUID itemID, byte[] data); | 55 | public delegate UUID ItemUpdatedCallback(UUID userID, UUID itemID, byte[] data); |
56 | 56 | ||
57 | public delegate void TaskScriptUpdatedCallback(UUID userID, UUID itemID, UUID primID, | 57 | public delegate void TaskScriptUpdatedCallback(UUID userID, UUID itemID, UUID primID, |
58 | bool isScriptRunning, byte[] data); | 58 | bool isScriptRunning, byte[] data); |
59 | 59 | ||
60 | public delegate List<InventoryItemBase> FetchInventoryDescendentsCAPS(UUID agentID, UUID folderID, UUID ownerID, | 60 | public delegate List<InventoryItemBase> FetchInventoryDescendentsCAPS(UUID agentID, UUID folderID, UUID ownerID, |
61 | bool fetchFolders, bool fetchItems, int sortOrder); | 61 | bool fetchFolders, bool fetchItems, int sortOrder); |
62 | 62 | ||
63 | /// <summary> | 63 | /// <summary> |
64 | /// XXX Probably not a particularly nice way of allow us to get the scene presence from the scene (chiefly so that | 64 | /// XXX Probably not a particularly nice way of allow us to get the scene presence from the scene (chiefly so that |
65 | /// we can popup a message on the user's client if the inventory service has permanently failed). But I didn't want | 65 | /// we can popup a message on the user's client if the inventory service has permanently failed). But I didn't want |
66 | /// to just pass the whole Scene into CAPS. | 66 | /// to just pass the whole Scene into CAPS. |
67 | /// </summary> | 67 | /// </summary> |
68 | public delegate IClientAPI GetClientDelegate(UUID agentID); | 68 | public delegate IClientAPI GetClientDelegate(UUID agentID); |
69 | 69 | ||
70 | public class Caps | 70 | public class Caps |
71 | { | 71 | { |
72 | private static readonly ILog m_log = | 72 | private static readonly ILog m_log = |
73 | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 73 | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
74 | 74 | ||
75 | private string m_httpListenerHostName; | 75 | private string m_httpListenerHostName; |
76 | private uint m_httpListenPort; | 76 | private uint m_httpListenPort; |
77 | 77 | ||
78 | /// <summary> | 78 | /// <summary> |
79 | /// This is the uuid portion of every CAPS path. It is used to make capability urls private to the requester. | 79 | /// This is the uuid portion of every CAPS path. It is used to make capability urls private to the requester. |
80 | /// </summary> | 80 | /// </summary> |
81 | private string m_capsObjectPath; | 81 | private string m_capsObjectPath; |
82 | public string CapsObjectPath { get { return m_capsObjectPath; } } | 82 | public string CapsObjectPath { get { return m_capsObjectPath; } } |
83 | 83 | ||
84 | private CapsHandlers m_capsHandlers; | 84 | private CapsHandlers m_capsHandlers; |
85 | 85 | ||
86 | private static readonly string m_requestPath = "0000/"; | 86 | private static readonly string m_requestPath = "0000/"; |
87 | // private static readonly string m_mapLayerPath = "0001/"; | 87 | // private static readonly string m_mapLayerPath = "0001/"; |
88 | private static readonly string m_newInventory = "0002/"; | 88 | private static readonly string m_newInventory = "0002/"; |
89 | //private static readonly string m_requestTexture = "0003/"; | 89 | //private static readonly string m_requestTexture = "0003/"; |
90 | private static readonly string m_notecardUpdatePath = "0004/"; | 90 | private static readonly string m_notecardUpdatePath = "0004/"; |
91 | private static readonly string m_notecardTaskUpdatePath = "0005/"; | 91 | private static readonly string m_notecardTaskUpdatePath = "0005/"; |
92 | // private static readonly string m_fetchInventoryPath = "0006/"; | 92 | // private static readonly string m_fetchInventoryPath = "0006/"; |
93 | 93 | ||
94 | // The following entries are in a module, however, they are also here so that we don't re-assign | 94 | // The following entries are in a module, however, they are also here so that we don't re-assign |
95 | // the path to another cap by mistake. | 95 | // the path to another cap by mistake. |
96 | // private static readonly string m_parcelVoiceInfoRequestPath = "0007/"; // This is in a module. | 96 | // private static readonly string m_parcelVoiceInfoRequestPath = "0007/"; // This is in a module. |
97 | // private static readonly string m_provisionVoiceAccountRequestPath = "0008/";// This is in a module. | 97 | // private static readonly string m_provisionVoiceAccountRequestPath = "0008/";// This is in a module. |
98 | 98 | ||
99 | // private static readonly string m_remoteParcelRequestPath = "0009/";// This is in the LandManagementModule. | 99 | // private static readonly string m_remoteParcelRequestPath = "0009/";// This is in the LandManagementModule. |
100 | 100 | ||
101 | //private string eventQueue = "0100/"; | 101 | //private string eventQueue = "0100/"; |
102 | private IHttpServer m_httpListener; | 102 | private IHttpServer m_httpListener; |
103 | private UUID m_agentID; | 103 | private UUID m_agentID; |
104 | private IAssetService m_assetCache; | 104 | private IAssetService m_assetCache; |
105 | private int m_eventQueueCount = 1; | 105 | private int m_eventQueueCount = 1; |
106 | private Queue<string> m_capsEventQueue = new Queue<string>(); | 106 | private Queue<string> m_capsEventQueue = new Queue<string>(); |
107 | private bool m_dumpAssetsToFile; | 107 | private bool m_dumpAssetsToFile; |
108 | private string m_regionName; | 108 | private string m_regionName; |
109 | 109 | ||
110 | public bool SSLCaps | 110 | public bool SSLCaps |
111 | { | 111 | { |
112 | get { return m_httpListener.UseSSL; } | 112 | get { return m_httpListener.UseSSL; } |
113 | } | 113 | } |
114 | public string SSLCommonName | 114 | public string SSLCommonName |
115 | { | 115 | { |
116 | get { return m_httpListener.SSLCommonName; } | 116 | get { return m_httpListener.SSLCommonName; } |
117 | } | 117 | } |
118 | public CapsHandlers CapsHandlers | 118 | public CapsHandlers CapsHandlers |
119 | { | 119 | { |
120 | get { return m_capsHandlers; } | 120 | get { return m_capsHandlers; } |
121 | } | 121 | } |
122 | 122 | ||
123 | // These are callbacks which will be setup by the scene so that we can update scene data when we | 123 | // These are callbacks which will be setup by the scene so that we can update scene data when we |
124 | // receive capability calls | 124 | // receive capability calls |
125 | public NewInventoryItem AddNewInventoryItem = null; | 125 | public NewInventoryItem AddNewInventoryItem = null; |
126 | public NewAsset AddNewAsset = null; | 126 | public NewAsset AddNewAsset = null; |
127 | public ItemUpdatedCallback ItemUpdatedCall = null; | 127 | public ItemUpdatedCallback ItemUpdatedCall = null; |
128 | public TaskScriptUpdatedCallback TaskScriptUpdatedCall = null; | 128 | public TaskScriptUpdatedCallback TaskScriptUpdatedCall = null; |
129 | public FetchInventoryDescendentsCAPS CAPSFetchInventoryDescendents = null; | 129 | public FetchInventoryDescendentsCAPS CAPSFetchInventoryDescendents = null; |
130 | public GetClientDelegate GetClient = null; | 130 | public GetClientDelegate GetClient = null; |
131 | 131 | ||
132 | public Caps(IAssetService assetCache, IHttpServer httpServer, string httpListen, uint httpPort, string capsPath, | 132 | public Caps(IAssetService assetCache, IHttpServer httpServer, string httpListen, uint httpPort, string capsPath, |
133 | UUID agent, bool dumpAssetsToFile, string regionName) | 133 | UUID agent, bool dumpAssetsToFile, string regionName) |
134 | { | 134 | { |
135 | m_assetCache = assetCache; | 135 | m_assetCache = assetCache; |
136 | m_capsObjectPath = capsPath; | 136 | m_capsObjectPath = capsPath; |
137 | m_httpListener = httpServer; | 137 | m_httpListener = httpServer; |
138 | m_httpListenerHostName = httpListen; | 138 | m_httpListenerHostName = httpListen; |
139 | 139 | ||
140 | m_httpListenPort = httpPort; | 140 | m_httpListenPort = httpPort; |
141 | 141 | ||
142 | if (httpServer.UseSSL) | 142 | if (httpServer.UseSSL) |
143 | { | 143 | { |
144 | m_httpListenPort = httpServer.SSLPort; | 144 | m_httpListenPort = httpServer.SSLPort; |
145 | httpListen = httpServer.SSLCommonName; | 145 | httpListen = httpServer.SSLCommonName; |
146 | httpPort = httpServer.SSLPort; | 146 | httpPort = httpServer.SSLPort; |
147 | } | 147 | } |
148 | 148 | ||
149 | m_agentID = agent; | 149 | m_agentID = agent; |
150 | m_dumpAssetsToFile = dumpAssetsToFile; | 150 | m_dumpAssetsToFile = dumpAssetsToFile; |
151 | m_capsHandlers = new CapsHandlers(httpServer, httpListen, httpPort, httpServer.UseSSL); | 151 | m_capsHandlers = new CapsHandlers(httpServer, httpListen, httpPort, httpServer.UseSSL); |
152 | m_regionName = regionName; | 152 | m_regionName = regionName; |
153 | } | 153 | } |
154 | 154 | ||
155 | /// <summary> | 155 | /// <summary> |
156 | /// Register all CAPS http service handlers | 156 | /// Register all CAPS http service handlers |
157 | /// </summary> | 157 | /// </summary> |
158 | public void RegisterHandlers() | 158 | public void RegisterHandlers() |
159 | { | 159 | { |
160 | DeregisterHandlers(); | 160 | DeregisterHandlers(); |
161 | 161 | ||
162 | string capsBase = "/CAPS/" + m_capsObjectPath; | 162 | string capsBase = "/CAPS/" + m_capsObjectPath; |
163 | 163 | ||
164 | RegisterRegionServiceHandlers(capsBase); | 164 | RegisterRegionServiceHandlers(capsBase); |
165 | RegisterInventoryServiceHandlers(capsBase); | 165 | RegisterInventoryServiceHandlers(capsBase); |
166 | 166 | ||
167 | } | 167 | } |
168 | 168 | ||
169 | public void RegisterRegionServiceHandlers(string capsBase) | 169 | public void RegisterRegionServiceHandlers(string capsBase) |
170 | { | 170 | { |
171 | try | 171 | try |
172 | { | 172 | { |
173 | // the root of all evil | 173 | // the root of all evil |
174 | m_capsHandlers["SEED"] = new RestStreamHandler("POST", capsBase + m_requestPath, CapsRequest); | 174 | m_capsHandlers["SEED"] = new RestStreamHandler("POST", capsBase + m_requestPath, CapsRequest); |
175 | m_log.DebugFormat( | 175 | m_log.DebugFormat( |
176 | "[CAPS]: Registered seed capability {0} for {1}", capsBase + m_requestPath, m_agentID); | 176 | "[CAPS]: Registered seed capability {0} for {1}", capsBase + m_requestPath, m_agentID); |
177 | 177 | ||
178 | //m_capsHandlers["MapLayer"] = | 178 | //m_capsHandlers["MapLayer"] = |
179 | // new LLSDStreamhandler<OSDMapRequest, OSDMapLayerResponse>("POST", | 179 | // new LLSDStreamhandler<OSDMapRequest, OSDMapLayerResponse>("POST", |
180 | // capsBase + m_mapLayerPath, | 180 | // capsBase + m_mapLayerPath, |
181 | // GetMapLayer); | 181 | // GetMapLayer); |
182 | m_capsHandlers["UpdateScriptTaskInventory"] = | 182 | m_capsHandlers["UpdateScriptTaskInventory"] = |
183 | new RestStreamHandler("POST", capsBase + m_notecardTaskUpdatePath, ScriptTaskInventory); | 183 | new RestStreamHandler("POST", capsBase + m_notecardTaskUpdatePath, ScriptTaskInventory); |
184 | m_capsHandlers["UpdateScriptTask"] = m_capsHandlers["UpdateScriptTaskInventory"]; | 184 | m_capsHandlers["UpdateScriptTask"] = m_capsHandlers["UpdateScriptTaskInventory"]; |
185 | 185 | ||
186 | } | 186 | } |
187 | catch (Exception e) | 187 | catch (Exception e) |
188 | { | 188 | { |
189 | m_log.Error("[CAPS]: " + e.ToString()); | 189 | m_log.Error("[CAPS]: " + e.ToString()); |
190 | } | 190 | } |
191 | } | 191 | } |
192 | 192 | ||
193 | public void RegisterInventoryServiceHandlers(string capsBase) | 193 | public void RegisterInventoryServiceHandlers(string capsBase) |
194 | { | 194 | { |
195 | try | 195 | try |
196 | { | 196 | { |
197 | // I don't think this one works... | 197 | // I don't think this one works... |
198 | m_capsHandlers["NewFileAgentInventory"] = | 198 | m_capsHandlers["NewFileAgentInventory"] = |
199 | new LLSDStreamhandler<LLSDAssetUploadRequest, LLSDAssetUploadResponse>("POST", | 199 | new LLSDStreamhandler<LLSDAssetUploadRequest, LLSDAssetUploadResponse>("POST", |
200 | capsBase + m_newInventory, | 200 | capsBase + m_newInventory, |
201 | NewAgentInventoryRequest); | 201 | NewAgentInventoryRequest); |
202 | m_capsHandlers["UpdateNotecardAgentInventory"] = | 202 | m_capsHandlers["UpdateNotecardAgentInventory"] = |
203 | new RestStreamHandler("POST", capsBase + m_notecardUpdatePath, NoteCardAgentInventory); | 203 | new RestStreamHandler("POST", capsBase + m_notecardUpdatePath, NoteCardAgentInventory); |
204 | m_capsHandlers["UpdateScriptAgentInventory"] = m_capsHandlers["UpdateNotecardAgentInventory"]; | 204 | m_capsHandlers["UpdateScriptAgentInventory"] = m_capsHandlers["UpdateNotecardAgentInventory"]; |
205 | m_capsHandlers["UpdateScriptAgent"] = m_capsHandlers["UpdateScriptAgentInventory"]; | 205 | m_capsHandlers["UpdateScriptAgent"] = m_capsHandlers["UpdateScriptAgentInventory"]; |
206 | 206 | ||
207 | // As of RC 1.22.9 of the Linden client this is | 207 | // As of RC 1.22.9 of the Linden client this is |
208 | // supported | 208 | // supported |
209 | 209 | ||
210 | // m_capsHandlers["WebFetchInventoryDescendents"] =new RestStreamHandler("POST", capsBase + m_fetchInventoryPath, FetchInventoryDescendentsRequest); | 210 | // m_capsHandlers["WebFetchInventoryDescendents"] =new RestStreamHandler("POST", capsBase + m_fetchInventoryPath, FetchInventoryDescendentsRequest); |
211 | 211 | ||
212 | // justincc: I've disabled the CAPS service for now to fix problems with selecting textures, and | 212 | // justincc: I've disabled the CAPS service for now to fix problems with selecting textures, and |
213 | // subsequent inventory breakage, in the edit object pane (such as mantis 1085). This requires | 213 | // subsequent inventory breakage, in the edit object pane (such as mantis 1085). This requires |
214 | // enhancements (probably filling out the folder part of the LLSD reply) to our CAPS service, | 214 | // enhancements (probably filling out the folder part of the LLSD reply) to our CAPS service, |
215 | // but when I went on the Linden grid, the | 215 | // but when I went on the Linden grid, the |
216 | // simulators I visited (version 1.21) were, surprisingly, no longer supplying this capability. Instead, | 216 | // simulators I visited (version 1.21) were, surprisingly, no longer supplying this capability. Instead, |
217 | // the 1.19.1.4 client appeared to be happily flowing inventory data over UDP | 217 | // the 1.19.1.4 client appeared to be happily flowing inventory data over UDP |
218 | // | 218 | // |
219 | // This is very probably just a temporary measure - once the CAPS service appears again on the Linden grid | 219 | // This is very probably just a temporary measure - once the CAPS service appears again on the Linden grid |
220 | // we will be | 220 | // we will be |
221 | // able to get the data we need to implement the necessary part of the protocol to fix the issue above. | 221 | // able to get the data we need to implement the necessary part of the protocol to fix the issue above. |
222 | // m_capsHandlers["FetchInventoryDescendents"] = | 222 | // m_capsHandlers["FetchInventoryDescendents"] = |
223 | // new RestStreamHandler("POST", capsBase + m_fetchInventoryPath, FetchInventoryRequest); | 223 | // new RestStreamHandler("POST", capsBase + m_fetchInventoryPath, FetchInventoryRequest); |
224 | 224 | ||
225 | // m_capsHandlers["FetchInventoryDescendents"] = | 225 | // m_capsHandlers["FetchInventoryDescendents"] = |
226 | // new LLSDStreamhandler<LLSDFetchInventoryDescendents, LLSDInventoryDescendents>("POST", | 226 | // new LLSDStreamhandler<LLSDFetchInventoryDescendents, LLSDInventoryDescendents>("POST", |
227 | // capsBase + m_fetchInventory, | 227 | // capsBase + m_fetchInventory, |
228 | // FetchInventory)); | 228 | // FetchInventory)); |
229 | // m_capsHandlers["RequestTextureDownload"] = new RestStreamHandler("POST", | 229 | // m_capsHandlers["RequestTextureDownload"] = new RestStreamHandler("POST", |
230 | // capsBase + m_requestTexture, | 230 | // capsBase + m_requestTexture, |
231 | // RequestTexture); | 231 | // RequestTexture); |
232 | } | 232 | } |
233 | catch (Exception e) | 233 | catch (Exception e) |
234 | { | 234 | { |
235 | m_log.Error("[CAPS]: " + e.ToString()); | 235 | m_log.Error("[CAPS]: " + e.ToString()); |
236 | } | 236 | } |
237 | } | 237 | } |
238 | 238 | ||
239 | /// <summary> | 239 | /// <summary> |
240 | /// Register a handler. This allows modules to register handlers. | 240 | /// Register a handler. This allows modules to register handlers. |
241 | /// </summary> | 241 | /// </summary> |
242 | /// <param name="capName"></param> | 242 | /// <param name="capName"></param> |
243 | /// <param name="handler"></param> | 243 | /// <param name="handler"></param> |
244 | public void RegisterHandler(string capName, IRequestHandler handler) | 244 | public void RegisterHandler(string capName, IRequestHandler handler) |
245 | { | 245 | { |
246 | m_capsHandlers[capName] = handler; | 246 | m_capsHandlers[capName] = handler; |
247 | //m_log.DebugFormat("[CAPS]: Registering handler for \"{0}\": path {1}", capName, handler.Path); | 247 | //m_log.DebugFormat("[CAPS]: Registering handler for \"{0}\": path {1}", capName, handler.Path); |
248 | } | 248 | } |
249 | 249 | ||
250 | /// <summary> | 250 | /// <summary> |
251 | /// Remove all CAPS service handlers. | 251 | /// Remove all CAPS service handlers. |
252 | /// | 252 | /// |
253 | /// </summary> | 253 | /// </summary> |
254 | /// <param name="httpListener"></param> | 254 | /// <param name="httpListener"></param> |
255 | /// <param name="path"></param> | 255 | /// <param name="path"></param> |
256 | /// <param name="restMethod"></param> | 256 | /// <param name="restMethod"></param> |
257 | public void DeregisterHandlers() | 257 | public void DeregisterHandlers() |
258 | { | 258 | { |
259 | if (m_capsHandlers != null) | 259 | if (m_capsHandlers != null) |
260 | { | 260 | { |
261 | foreach (string capsName in m_capsHandlers.Caps) | 261 | foreach (string capsName in m_capsHandlers.Caps) |
262 | { | 262 | { |
263 | m_capsHandlers.Remove(capsName); | 263 | m_capsHandlers.Remove(capsName); |
264 | } | 264 | } |
265 | } | 265 | } |
266 | } | 266 | } |
267 | 267 | ||
268 | /// <summary> | 268 | /// <summary> |
269 | /// Construct a client response detailing all the capabilities this server can provide. | 269 | /// Construct a client response detailing all the capabilities this server can provide. |
270 | /// </summary> | 270 | /// </summary> |
271 | /// <param name="request"></param> | 271 | /// <param name="request"></param> |
272 | /// <param name="path"></param> | 272 | /// <param name="path"></param> |
273 | /// <param name="param"></param> | 273 | /// <param name="param"></param> |
274 | /// <param name="httpRequest">HTTP request header object</param> | 274 | /// <param name="httpRequest">HTTP request header object</param> |
275 | /// <param name="httpResponse">HTTP response header object</param> | 275 | /// <param name="httpResponse">HTTP response header object</param> |
276 | /// <returns></returns> | 276 | /// <returns></returns> |
277 | public string CapsRequest(string request, string path, string param, | 277 | public string CapsRequest(string request, string path, string param, |
278 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 278 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) |
279 | { | 279 | { |
280 | //m_log.Debug("[CAPS]: Seed Caps Request in region: " + m_regionName); | 280 | //m_log.Debug("[CAPS]: Seed Caps Request in region: " + m_regionName); |
281 | 281 | ||
282 | string result = LLSDHelpers.SerialiseLLSDReply(m_capsHandlers.CapsDetails); | 282 | string result = LLSDHelpers.SerialiseLLSDReply(m_capsHandlers.CapsDetails); |
283 | 283 | ||
284 | //m_log.DebugFormat("[CAPS] CapsRequest {0}", result); | 284 | //m_log.DebugFormat("[CAPS] CapsRequest {0}", result); |
285 | 285 | ||
286 | return result; | 286 | return result; |
287 | } | 287 | } |
288 | 288 | ||
289 | // FIXME: these all should probably go into the respective region | 289 | // FIXME: these all should probably go into the respective region |
290 | // modules | 290 | // modules |
291 | 291 | ||
292 | /// <summary> | 292 | /// <summary> |
293 | /// Processes a fetch inventory request and sends the reply | 293 | /// Processes a fetch inventory request and sends the reply |
294 | 294 | ||
295 | /// </summary> | 295 | /// </summary> |
296 | /// <param name="request"></param> | 296 | /// <param name="request"></param> |
297 | /// <param name="path"></param> | 297 | /// <param name="path"></param> |
298 | /// <param name="param"></param> | 298 | /// <param name="param"></param> |
299 | /// <returns></returns> | 299 | /// <returns></returns> |
300 | // Request is like: | 300 | // Request is like: |
301 | //<llsd> | 301 | //<llsd> |
302 | // <map><key>folders</key> | 302 | // <map><key>folders</key> |
303 | // <array> | 303 | // <array> |
304 | // <map> | 304 | // <map> |
305 | // <key>fetch-folders</key><boolean>1</boolean><key>fetch-items</key><boolean>1</boolean><key>folder-id</key><uuid>8e1e3a30-b9bf-11dc-95ff-0800200c9a66</uuid><key>owner-id</key><uuid>11111111-1111-0000-0000-000100bba000</uuid><key>sort-order</key><integer>1</integer> | 305 | // <key>fetch-folders</key><boolean>1</boolean><key>fetch-items</key><boolean>1</boolean><key>folder-id</key><uuid>8e1e3a30-b9bf-11dc-95ff-0800200c9a66</uuid><key>owner-id</key><uuid>11111111-1111-0000-0000-000100bba000</uuid><key>sort-order</key><integer>1</integer> |
306 | // </map> | 306 | // </map> |
307 | // </array> | 307 | // </array> |
308 | // </map> | 308 | // </map> |
309 | //</llsd> | 309 | //</llsd> |
310 | // | 310 | // |
311 | // multiple fetch-folder maps are allowed within the larger folders map. | 311 | // multiple fetch-folder maps are allowed within the larger folders map. |
312 | public string FetchInventoryRequest(string request, string path, string param) | 312 | public string FetchInventoryRequest(string request, string path, string param) |
313 | { | 313 | { |
314 | // string unmodifiedRequest = request.ToString(); | 314 | // string unmodifiedRequest = request.ToString(); |
315 | 315 | ||
316 | //m_log.DebugFormat("[AGENT INVENTORY]: Received CAPS fetch inventory request {0}", unmodifiedRequest); | 316 | //m_log.DebugFormat("[AGENT INVENTORY]: Received CAPS fetch inventory request {0}", unmodifiedRequest); |
317 | m_log.Debug("[CAPS]: Inventory Request in region: " + m_regionName); | 317 | m_log.Debug("[CAPS]: Inventory Request in region: " + m_regionName); |
318 | 318 | ||
319 | Hashtable hash = new Hashtable(); | 319 | Hashtable hash = new Hashtable(); |
320 | try | 320 | try |
321 | { | 321 | { |
322 | hash = (Hashtable)LLSD.LLSDDeserialize(Utils.StringToBytes(request)); | 322 | hash = (Hashtable)LLSD.LLSDDeserialize(Utils.StringToBytes(request)); |
323 | } | 323 | } |
324 | catch (LLSD.LLSDParseException pe) | 324 | catch (LLSD.LLSDParseException pe) |
325 | { | 325 | { |
326 | m_log.Error("[AGENT INVENTORY]: Fetch error: " + pe.Message); | 326 | m_log.Error("[AGENT INVENTORY]: Fetch error: " + pe.Message); |
327 | m_log.Error("Request: " + request.ToString()); | 327 | m_log.Error("Request: " + request.ToString()); |
328 | } | 328 | } |
329 | 329 | ||
330 | ArrayList foldersrequested = (ArrayList)hash["folders"]; | 330 | ArrayList foldersrequested = (ArrayList)hash["folders"]; |
331 | 331 | ||
332 | string response = ""; | 332 | string response = ""; |
333 | 333 | ||
334 | for (int i = 0; i < foldersrequested.Count; i++) | 334 | for (int i = 0; i < foldersrequested.Count; i++) |
335 | { | 335 | { |
336 | string inventoryitemstr = ""; | 336 | string inventoryitemstr = ""; |
337 | Hashtable inventoryhash = (Hashtable)foldersrequested[i]; | 337 | Hashtable inventoryhash = (Hashtable)foldersrequested[i]; |
338 | 338 | ||
339 | LLSDFetchInventoryDescendents llsdRequest = new LLSDFetchInventoryDescendents(); | 339 | LLSDFetchInventoryDescendents llsdRequest = new LLSDFetchInventoryDescendents(); |
340 | LLSDHelpers.DeserialiseOSDMap(inventoryhash, llsdRequest); | 340 | LLSDHelpers.DeserialiseOSDMap(inventoryhash, llsdRequest); |
341 | LLSDInventoryDescendents reply = FetchInventoryReply(llsdRequest); | 341 | LLSDInventoryDescendents reply = FetchInventoryReply(llsdRequest); |
342 | 342 | ||
343 | inventoryitemstr = LLSDHelpers.SerialiseLLSDReply(reply); | 343 | inventoryitemstr = LLSDHelpers.SerialiseLLSDReply(reply); |
344 | inventoryitemstr = inventoryitemstr.Replace("<llsd><map><key>folders</key><array>", ""); | 344 | inventoryitemstr = inventoryitemstr.Replace("<llsd><map><key>folders</key><array>", ""); |
345 | inventoryitemstr = inventoryitemstr.Replace("</array></map></llsd>", ""); | 345 | inventoryitemstr = inventoryitemstr.Replace("</array></map></llsd>", ""); |
346 | 346 | ||
347 | response += inventoryitemstr; | 347 | response += inventoryitemstr; |
348 | } | 348 | } |
349 | 349 | ||
350 | if (response.Length == 0) | 350 | if (response.Length == 0) |
351 | { | 351 | { |
352 | // Ter-guess: If requests fail a lot, the client seems to stop requesting descendants. | 352 | // Ter-guess: If requests fail a lot, the client seems to stop requesting descendants. |
353 | // Therefore, I'm concluding that the client only has so many threads available to do requests | 353 | // Therefore, I'm concluding that the client only has so many threads available to do requests |
354 | // and when a thread stalls.. is stays stalled. | 354 | // and when a thread stalls.. is stays stalled. |
355 | // Therefore we need to return something valid | 355 | // Therefore we need to return something valid |
356 | response = "<llsd><map><key>folders</key><array /></map></llsd>"; | 356 | response = "<llsd><map><key>folders</key><array /></map></llsd>"; |
357 | } | 357 | } |
358 | else | 358 | else |
359 | { | 359 | { |
360 | response = "<llsd><map><key>folders</key><array>" + response + "</array></map></llsd>"; | 360 | response = "<llsd><map><key>folders</key><array>" + response + "</array></map></llsd>"; |
361 | } | 361 | } |
362 | 362 | ||
363 | //m_log.DebugFormat("[AGENT INVENTORY]: Replying to CAPS fetch inventory request with following xml"); | 363 | //m_log.DebugFormat("[AGENT INVENTORY]: Replying to CAPS fetch inventory request with following xml"); |
364 | //m_log.Debug(Util.GetFormattedXml(response)); | 364 | //m_log.Debug(Util.GetFormattedXml(response)); |
365 | 365 | ||
366 | return response; | 366 | return response; |
367 | } | 367 | } |
368 | 368 | ||
369 | public string FetchInventoryDescendentsRequest(string request, string path, string param,OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 369 | public string FetchInventoryDescendentsRequest(string request, string path, string param,OSHttpRequest httpRequest, OSHttpResponse httpResponse) |
370 | { | 370 | { |
371 | // m_log.Debug("[CAPS]: FetchInventoryDescendentsRequest in region: " + m_regionName + "request is "+request); | 371 | // m_log.Debug("[CAPS]: FetchInventoryDescendentsRequest in region: " + m_regionName + "request is "+request); |
372 | 372 | ||
373 | // nasty temporary hack here, the linden client falsely identifies the uuid 00000000-0000-0000-0000-000000000000 as a string which breaks us | 373 | // nasty temporary hack here, the linden client falsely identifies the uuid 00000000-0000-0000-0000-000000000000 as a string which breaks us |
374 | // correctly mark it as a uuid | 374 | // correctly mark it as a uuid |
375 | request = request.Replace("<string>00000000-0000-0000-0000-000000000000</string>", "<uuid>00000000-0000-0000-0000-000000000000</uuid>"); | 375 | request = request.Replace("<string>00000000-0000-0000-0000-000000000000</string>", "<uuid>00000000-0000-0000-0000-000000000000</uuid>"); |
376 | 376 | ||
377 | // another hack <integer>1</integer> results in a System.ArgumentException: Object type System.Int32 cannot be converted to target type: System.Boolean | 377 | // another hack <integer>1</integer> results in a System.ArgumentException: Object type System.Int32 cannot be converted to target type: System.Boolean |
378 | request = request.Replace("<key>fetch_folders</key><integer>0</integer>", "<key>fetch_folders</key><boolean>0</boolean>"); | 378 | request = request.Replace("<key>fetch_folders</key><integer>0</integer>", "<key>fetch_folders</key><boolean>0</boolean>"); |
379 | request = request.Replace("<key>fetch_folders</key><integer>1</integer>", "<key>fetch_folders</key><boolean>1</boolean>"); | 379 | request = request.Replace("<key>fetch_folders</key><integer>1</integer>", "<key>fetch_folders</key><boolean>1</boolean>"); |
380 | Hashtable hash = new Hashtable(); | 380 | Hashtable hash = new Hashtable(); |
381 | try | 381 | try |
382 | { | 382 | { |
383 | hash = (Hashtable)LLSD.LLSDDeserialize(Utils.StringToBytes(request)); | 383 | hash = (Hashtable)LLSD.LLSDDeserialize(Utils.StringToBytes(request)); |
384 | } | 384 | } |
385 | catch (LLSD.LLSDParseException pe) | 385 | catch (LLSD.LLSDParseException pe) |
386 | { | 386 | { |
387 | m_log.Error("[AGENT INVENTORY]: Fetch error: " + pe.Message); | 387 | m_log.Error("[AGENT INVENTORY]: Fetch error: " + pe.Message); |
388 | m_log.Error("Request: " + request.ToString()); | 388 | m_log.Error("Request: " + request.ToString()); |
389 | } | 389 | } |
390 | 390 | ||
391 | ArrayList foldersrequested = (ArrayList)hash["folders"]; | 391 | ArrayList foldersrequested = (ArrayList)hash["folders"]; |
392 | 392 | ||
393 | string response = ""; | 393 | string response = ""; |
394 | for (int i = 0; i < foldersrequested.Count; i++) | 394 | for (int i = 0; i < foldersrequested.Count; i++) |
395 | { | 395 | { |
396 | string inventoryitemstr = ""; | 396 | string inventoryitemstr = ""; |
397 | Hashtable inventoryhash = (Hashtable)foldersrequested[i]; | 397 | Hashtable inventoryhash = (Hashtable)foldersrequested[i]; |
398 | 398 | ||
399 | LLSDFetchInventoryDescendents llsdRequest = new LLSDFetchInventoryDescendents(); | 399 | LLSDFetchInventoryDescendents llsdRequest = new LLSDFetchInventoryDescendents(); |
400 | 400 | ||
401 | try{ | 401 | try{ |
402 | LLSDHelpers.DeserialiseOSDMap(inventoryhash, llsdRequest); | 402 | LLSDHelpers.DeserialiseOSDMap(inventoryhash, llsdRequest); |
403 | } | 403 | } |
404 | catch(Exception e) | 404 | catch(Exception e) |
405 | { | 405 | { |
406 | m_log.Debug("[CAPS]: caught exception doing OSD deserialize" + e); | 406 | m_log.Debug("[CAPS]: caught exception doing OSD deserialize" + e); |
407 | } | 407 | } |
408 | LLSDInventoryDescendents reply = FetchInventoryReply(llsdRequest); | 408 | LLSDInventoryDescendents reply = FetchInventoryReply(llsdRequest); |
409 | 409 | ||
410 | inventoryitemstr = LLSDHelpers.SerialiseLLSDReply(reply); | 410 | inventoryitemstr = LLSDHelpers.SerialiseLLSDReply(reply); |
411 | inventoryitemstr = inventoryitemstr.Replace("<llsd><map><key>folders</key><array>", ""); | 411 | inventoryitemstr = inventoryitemstr.Replace("<llsd><map><key>folders</key><array>", ""); |
412 | inventoryitemstr = inventoryitemstr.Replace("</array></map></llsd>", ""); | 412 | inventoryitemstr = inventoryitemstr.Replace("</array></map></llsd>", ""); |
413 | 413 | ||
414 | response += inventoryitemstr; | 414 | response += inventoryitemstr; |
415 | } | 415 | } |
416 | 416 | ||
417 | 417 | ||
418 | if (response.Length == 0) | 418 | if (response.Length == 0) |
419 | { | 419 | { |
420 | // Ter-guess: If requests fail a lot, the client seems to stop requesting descendants. | 420 | // Ter-guess: If requests fail a lot, the client seems to stop requesting descendants. |
421 | // Therefore, I'm concluding that the client only has so many threads available to do requests | 421 | // Therefore, I'm concluding that the client only has so many threads available to do requests |
422 | // and when a thread stalls.. is stays stalled. | 422 | // and when a thread stalls.. is stays stalled. |
423 | // Therefore we need to return something valid | 423 | // Therefore we need to return something valid |
424 | response = "<llsd><map><key>folders</key><array /></map></llsd>"; | 424 | response = "<llsd><map><key>folders</key><array /></map></llsd>"; |
425 | } | 425 | } |
426 | else | 426 | else |
427 | { | 427 | { |
428 | response = "<llsd><map><key>folders</key><array>" + response + "</array></map></llsd>"; | 428 | response = "<llsd><map><key>folders</key><array>" + response + "</array></map></llsd>"; |
429 | } | 429 | } |
430 | 430 | ||
431 | //m_log.DebugFormat("[CAPS]: Replying to CAPS fetch inventory request with following xml"); | 431 | //m_log.DebugFormat("[CAPS]: Replying to CAPS fetch inventory request with following xml"); |
432 | //m_log.Debug("[CAPS] "+response); | 432 | //m_log.Debug("[CAPS] "+response); |
433 | 433 | ||
434 | return response; | 434 | return response; |
435 | } | 435 | } |
436 | 436 | ||
437 | 437 | ||
438 | 438 | ||
439 | /// <summary> | 439 | /// <summary> |
440 | /// Construct an LLSD reply packet to a CAPS inventory request | 440 | /// Construct an LLSD reply packet to a CAPS inventory request |
441 | /// </summary> | 441 | /// </summary> |
442 | /// <param name="invFetch"></param> | 442 | /// <param name="invFetch"></param> |
443 | /// <returns></returns> | 443 | /// <returns></returns> |
444 | private LLSDInventoryDescendents FetchInventoryReply(LLSDFetchInventoryDescendents invFetch) | 444 | private LLSDInventoryDescendents FetchInventoryReply(LLSDFetchInventoryDescendents invFetch) |
445 | { | 445 | { |
446 | LLSDInventoryDescendents reply = new LLSDInventoryDescendents(); | 446 | LLSDInventoryDescendents reply = new LLSDInventoryDescendents(); |
447 | LLSDInventoryFolderContents contents = new LLSDInventoryFolderContents(); | 447 | LLSDInventoryFolderContents contents = new LLSDInventoryFolderContents(); |
448 | contents.agent_id = m_agentID; | 448 | contents.agent_id = m_agentID; |
449 | contents.owner_id = invFetch.owner_id; | 449 | contents.owner_id = invFetch.owner_id; |
450 | contents.folder_id = invFetch.folder_id; | 450 | contents.folder_id = invFetch.folder_id; |
451 | 451 | ||
452 | // The version number being sent back was originally 1. | 452 | // The version number being sent back was originally 1. |
453 | // Unfortunately, on 1.19.1.4, this means that we see a problem where on subsequent logins | 453 | // Unfortunately, on 1.19.1.4, this means that we see a problem where on subsequent logins |
454 | // without clearing client cache, objects in the root folder disappear until the cache is cleared, | 454 | // without clearing client cache, objects in the root folder disappear until the cache is cleared, |
455 | // at which point they reappear. | 455 | // at which point they reappear. |
456 | // | 456 | // |
457 | // Seeing the version to something other than 0 may be the right thing to do, but there is | 457 | // Seeing the version to something other than 0 may be the right thing to do, but there is |
458 | // a greater subtlety of the second life protocol that needs to be understood first. | 458 | // a greater subtlety of the second life protocol that needs to be understood first. |
459 | contents.version = 0; | 459 | contents.version = 0; |
460 | 460 | ||
461 | contents.descendents = 0; | 461 | contents.descendents = 0; |
462 | reply.folders.Array.Add(contents); | 462 | reply.folders.Array.Add(contents); |
463 | List<InventoryItemBase> itemList = null; | 463 | List<InventoryItemBase> itemList = null; |
464 | if (CAPSFetchInventoryDescendents != null) | 464 | if (CAPSFetchInventoryDescendents != null) |
465 | { | 465 | { |
466 | itemList = CAPSFetchInventoryDescendents(m_agentID, invFetch.folder_id, invFetch.owner_id, invFetch.fetch_folders, invFetch.fetch_items, invFetch.sort_order); | 466 | itemList = CAPSFetchInventoryDescendents(m_agentID, invFetch.folder_id, invFetch.owner_id, invFetch.fetch_folders, invFetch.fetch_items, invFetch.sort_order); |
467 | } | 467 | } |
468 | 468 | ||
469 | if (itemList != null) | 469 | if (itemList != null) |
470 | { | 470 | { |
471 | foreach (InventoryItemBase invItem in itemList) | 471 | foreach (InventoryItemBase invItem in itemList) |
472 | { | 472 | { |
473 | contents.items.Array.Add(ConvertInventoryItem(invItem)); | 473 | contents.items.Array.Add(ConvertInventoryItem(invItem)); |
474 | } | 474 | } |
475 | } | 475 | } |
476 | /* The following block is removed as it ALWAYS sends the error to the client because the RC 1.22.9 client tries to | 476 | /* The following block is removed as it ALWAYS sends the error to the client because the RC 1.22.9 client tries to |
477 | find items that have become dissasociated with a paret folder and have parent of 00000000-0000-00000.... | 477 | find items that have become dissasociated with a paret folder and have parent of 00000000-0000-00000.... |
478 | else | 478 | else |
479 | { | 479 | { |
480 | IClientAPI client = GetClient(m_agentID); | 480 | IClientAPI client = GetClient(m_agentID); |
481 | 481 | ||
482 | // We're going to both notify the client of inventory service failure and send back a 'no folder contents' response. | 482 | // We're going to both notify the client of inventory service failure and send back a 'no folder contents' response. |
483 | // If we don't send back the response, | 483 | // If we don't send back the response, |
484 | // the client becomes unhappy (see Teravus' comment in FetchInventoryRequest()) | 484 | // the client becomes unhappy (see Teravus' comment in FetchInventoryRequest()) |
485 | if (client != null) | 485 | if (client != null) |
486 | { | 486 | { |
487 | client.SendAgentAlertMessage( | 487 | client.SendAgentAlertMessage( |
488 | "AGIN0001E: The inventory service has either failed or is not responding. Your inventory will not function properly for the rest of this session. Please clear your cache and relog.", | 488 | "AGIN0001E: The inventory service has either failed or is not responding. Your inventory will not function properly for the rest of this session. Please clear your cache and relog.", |
489 | true); | 489 | true); |
490 | } | 490 | } |
491 | else | 491 | else |
492 | { | 492 | { |
493 | m_log.ErrorFormat( | 493 | m_log.ErrorFormat( |
494 | "[AGENT INVENTORY]: Could not lookup controlling client for {0} in order to notify them of the inventory service failure", | 494 | "[AGENT INVENTORY]: Could not lookup controlling client for {0} in order to notify them of the inventory service failure", |
495 | m_agentID); | 495 | m_agentID); |
496 | } | 496 | } |
497 | }*/ | 497 | }*/ |
498 | 498 | ||
499 | contents.descendents = contents.items.Array.Count; | 499 | contents.descendents = contents.items.Array.Count; |
500 | return reply; | 500 | return reply; |
501 | } | 501 | } |
502 | 502 | ||
503 | /// <summary> | 503 | /// <summary> |
504 | /// Convert an internal inventory item object into an LLSD object. | 504 | /// Convert an internal inventory item object into an LLSD object. |
505 | /// </summary> | 505 | /// </summary> |
506 | /// <param name="invItem"></param> | 506 | /// <param name="invItem"></param> |
507 | /// <returns></returns> | 507 | /// <returns></returns> |
508 | private LLSDInventoryItem ConvertInventoryItem(InventoryItemBase invItem) | 508 | private LLSDInventoryItem ConvertInventoryItem(InventoryItemBase invItem) |
509 | { | 509 | { |
510 | LLSDInventoryItem llsdItem = new LLSDInventoryItem(); | 510 | LLSDInventoryItem llsdItem = new LLSDInventoryItem(); |
511 | llsdItem.asset_id = invItem.AssetID; | 511 | llsdItem.asset_id = invItem.AssetID; |
512 | llsdItem.created_at = invItem.CreationDate; | 512 | llsdItem.created_at = invItem.CreationDate; |
513 | llsdItem.desc = invItem.Description; | 513 | llsdItem.desc = invItem.Description; |
514 | llsdItem.flags = 0; | 514 | llsdItem.flags = 0; |
515 | llsdItem.item_id = invItem.ID; | 515 | llsdItem.item_id = invItem.ID; |
516 | llsdItem.name = invItem.Name; | 516 | llsdItem.name = invItem.Name; |
517 | llsdItem.parent_id = invItem.Folder; | 517 | llsdItem.parent_id = invItem.Folder; |
518 | try | 518 | try |
519 | { | 519 | { |
520 | // TODO reevaluate after upgrade to libomv >= r2566. Probably should use UtilsConversions. | 520 | // TODO reevaluate after upgrade to libomv >= r2566. Probably should use UtilsConversions. |
521 | llsdItem.type = TaskInventoryItem.Types[invItem.AssetType]; | 521 | llsdItem.type = TaskInventoryItem.Types[invItem.AssetType]; |
522 | llsdItem.inv_type = TaskInventoryItem.InvTypes[invItem.InvType]; | 522 | llsdItem.inv_type = TaskInventoryItem.InvTypes[invItem.InvType]; |
523 | } | 523 | } |
524 | catch (Exception e) | 524 | catch (Exception e) |
525 | { | 525 | { |
526 | m_log.Error("[CAPS]: Problem setting asset/inventory type while converting inventory item " + invItem.Name + " to LLSD:", e); | 526 | m_log.Error("[CAPS]: Problem setting asset/inventory type while converting inventory item " + invItem.Name + " to LLSD:", e); |
527 | } | 527 | } |
528 | llsdItem.permissions = new LLSDPermissions(); | 528 | llsdItem.permissions = new LLSDPermissions(); |
529 | llsdItem.permissions.creator_id = invItem.CreatorIdAsUuid; | 529 | llsdItem.permissions.creator_id = invItem.CreatorIdAsUuid; |
530 | llsdItem.permissions.base_mask = (int)invItem.CurrentPermissions; | 530 | llsdItem.permissions.base_mask = (int)invItem.CurrentPermissions; |
531 | llsdItem.permissions.everyone_mask = (int)invItem.EveryOnePermissions; | 531 | llsdItem.permissions.everyone_mask = (int)invItem.EveryOnePermissions; |
532 | llsdItem.permissions.group_id = UUID.Zero; | 532 | llsdItem.permissions.group_id = UUID.Zero; |
533 | llsdItem.permissions.group_mask = 0; | 533 | llsdItem.permissions.group_mask = 0; |
534 | llsdItem.permissions.is_owner_group = false; | 534 | llsdItem.permissions.is_owner_group = false; |
535 | llsdItem.permissions.next_owner_mask = (int)invItem.NextPermissions; | 535 | llsdItem.permissions.next_owner_mask = (int)invItem.NextPermissions; |
536 | llsdItem.permissions.owner_id = m_agentID; // FixMe | 536 | llsdItem.permissions.owner_id = m_agentID; // FixMe |
537 | llsdItem.permissions.owner_mask = (int)invItem.CurrentPermissions; | 537 | llsdItem.permissions.owner_mask = (int)invItem.CurrentPermissions; |
538 | llsdItem.sale_info = new LLSDSaleInfo(); | 538 | llsdItem.sale_info = new LLSDSaleInfo(); |
539 | llsdItem.sale_info.sale_price = 10; | 539 | llsdItem.sale_info.sale_price = 10; |
540 | llsdItem.sale_info.sale_type = "not"; | 540 | llsdItem.sale_info.sale_type = "not"; |
541 | 541 | ||
542 | return llsdItem; | 542 | return llsdItem; |
543 | } | 543 | } |
544 | 544 | ||
545 | /// <summary> | 545 | /// <summary> |
546 | /// | 546 | /// |
547 | /// </summary> | 547 | /// </summary> |
548 | /// <param name="mapReq"></param> | 548 | /// <param name="mapReq"></param> |
549 | /// <returns></returns> | 549 | /// <returns></returns> |
550 | public LLSDMapLayerResponse GetMapLayer(LLSDMapRequest mapReq) | 550 | public LLSDMapLayerResponse GetMapLayer(LLSDMapRequest mapReq) |
551 | { | 551 | { |
552 | m_log.Debug("[CAPS]: MapLayer Request in region: " + m_regionName); | 552 | m_log.Debug("[CAPS]: MapLayer Request in region: " + m_regionName); |
553 | LLSDMapLayerResponse mapResponse = new LLSDMapLayerResponse(); | 553 | LLSDMapLayerResponse mapResponse = new LLSDMapLayerResponse(); |
554 | mapResponse.LayerData.Array.Add(GetOSDMapLayerResponse()); | 554 | mapResponse.LayerData.Array.Add(GetOSDMapLayerResponse()); |
555 | return mapResponse; | 555 | return mapResponse; |
556 | } | 556 | } |
557 | 557 | ||
558 | /// <summary> | 558 | /// <summary> |
559 | /// | 559 | /// |
560 | /// </summary> | 560 | /// </summary> |
561 | /// <returns></returns> | 561 | /// <returns></returns> |
562 | protected static OSDMapLayer GetOSDMapLayerResponse() | 562 | protected static OSDMapLayer GetOSDMapLayerResponse() |
563 | { | 563 | { |
564 | OSDMapLayer mapLayer = new OSDMapLayer(); | 564 | OSDMapLayer mapLayer = new OSDMapLayer(); |
565 | mapLayer.Right = 5000; | 565 | mapLayer.Right = 5000; |
566 | mapLayer.Top = 5000; | 566 | mapLayer.Top = 5000; |
567 | mapLayer.ImageID = new UUID("00000000-0000-1111-9999-000000000006"); | 567 | mapLayer.ImageID = new UUID("00000000-0000-1111-9999-000000000006"); |
568 | 568 | ||
569 | return mapLayer; | 569 | return mapLayer; |
570 | } | 570 | } |
571 | 571 | ||
572 | /// <summary> | 572 | /// <summary> |
573 | /// | 573 | /// |
574 | /// </summary> | 574 | /// </summary> |
575 | /// <param name="request"></param> | 575 | /// <param name="request"></param> |
576 | /// <param name="path"></param> | 576 | /// <param name="path"></param> |
577 | /// <param name="param"></param> | 577 | /// <param name="param"></param> |
578 | /// <returns></returns> | 578 | /// <returns></returns> |
579 | public string RequestTexture(string request, string path, string param) | 579 | public string RequestTexture(string request, string path, string param) |
580 | { | 580 | { |
581 | m_log.Debug("texture request " + request); | 581 | m_log.Debug("texture request " + request); |
582 | // Needs implementing (added to remove compiler warning) | 582 | // Needs implementing (added to remove compiler warning) |
583 | return String.Empty; | 583 | return String.Empty; |
584 | } | 584 | } |
585 | 585 | ||
586 | #region EventQueue (Currently not enabled) | 586 | #region EventQueue (Currently not enabled) |
587 | 587 | ||
588 | /// <summary> | 588 | /// <summary> |
589 | /// | 589 | /// |
590 | /// </summary> | 590 | /// </summary> |
591 | /// <param name="request"></param> | 591 | /// <param name="request"></param> |
592 | /// <param name="path"></param> | 592 | /// <param name="path"></param> |
593 | /// <param name="param"></param> | 593 | /// <param name="param"></param> |
594 | /// <returns></returns> | 594 | /// <returns></returns> |
595 | public string ProcessEventQueue(string request, string path, string param) | 595 | public string ProcessEventQueue(string request, string path, string param) |
596 | { | 596 | { |
597 | string res = String.Empty; | 597 | string res = String.Empty; |
598 | 598 | ||
599 | if (m_capsEventQueue.Count > 0) | 599 | if (m_capsEventQueue.Count > 0) |
600 | { | 600 | { |
601 | lock (m_capsEventQueue) | 601 | lock (m_capsEventQueue) |
602 | { | 602 | { |
603 | string item = m_capsEventQueue.Dequeue(); | 603 | string item = m_capsEventQueue.Dequeue(); |
604 | res = item; | 604 | res = item; |
605 | } | 605 | } |
606 | } | 606 | } |
607 | else | 607 | else |
608 | { | 608 | { |
609 | res = CreateEmptyEventResponse(); | 609 | res = CreateEmptyEventResponse(); |
610 | } | 610 | } |
611 | return res; | 611 | return res; |
612 | } | 612 | } |
613 | 613 | ||
614 | /// <summary> | 614 | /// <summary> |
615 | /// | 615 | /// |
616 | /// </summary> | 616 | /// </summary> |
617 | /// <param name="caps"></param> | 617 | /// <param name="caps"></param> |
618 | /// <param name="ipAddressPort"></param> | 618 | /// <param name="ipAddressPort"></param> |
619 | /// <returns></returns> | 619 | /// <returns></returns> |
620 | public string CreateEstablishAgentComms(string caps, string ipAddressPort) | 620 | public string CreateEstablishAgentComms(string caps, string ipAddressPort) |
621 | { | 621 | { |
622 | LLSDCapEvent eventItem = new LLSDCapEvent(); | 622 | LLSDCapEvent eventItem = new LLSDCapEvent(); |
623 | eventItem.id = m_eventQueueCount; | 623 | eventItem.id = m_eventQueueCount; |
624 | //should be creating a EstablishAgentComms item, but there isn't a class for it yet | 624 | //should be creating a EstablishAgentComms item, but there isn't a class for it yet |
625 | eventItem.events.Array.Add(new LLSDEmpty()); | 625 | eventItem.events.Array.Add(new LLSDEmpty()); |
626 | string res = LLSDHelpers.SerialiseLLSDReply(eventItem); | 626 | string res = LLSDHelpers.SerialiseLLSDReply(eventItem); |
627 | m_eventQueueCount++; | 627 | m_eventQueueCount++; |
628 | 628 | ||
629 | m_capsEventQueue.Enqueue(res); | 629 | m_capsEventQueue.Enqueue(res); |
630 | return res; | 630 | return res; |
631 | } | 631 | } |
632 | 632 | ||
633 | /// <summary> | 633 | /// <summary> |
634 | /// | 634 | /// |
635 | /// </summary> | 635 | /// </summary> |
636 | /// <returns></returns> | 636 | /// <returns></returns> |
637 | public string CreateEmptyEventResponse() | 637 | public string CreateEmptyEventResponse() |
638 | { | 638 | { |
639 | LLSDCapEvent eventItem = new LLSDCapEvent(); | 639 | LLSDCapEvent eventItem = new LLSDCapEvent(); |
640 | eventItem.id = m_eventQueueCount; | 640 | eventItem.id = m_eventQueueCount; |
641 | eventItem.events.Array.Add(new LLSDEmpty()); | 641 | eventItem.events.Array.Add(new LLSDEmpty()); |
642 | string res = LLSDHelpers.SerialiseLLSDReply(eventItem); | 642 | string res = LLSDHelpers.SerialiseLLSDReply(eventItem); |
643 | m_eventQueueCount++; | 643 | m_eventQueueCount++; |
644 | return res; | 644 | return res; |
645 | } | 645 | } |
646 | 646 | ||
647 | #endregion | 647 | #endregion |
648 | 648 | ||
649 | /// <summary> | 649 | /// <summary> |
650 | /// Called by the script task update handler. Provides a URL to which the client can upload a new asset. | 650 | /// Called by the script task update handler. Provides a URL to which the client can upload a new asset. |
651 | /// </summary> | 651 | /// </summary> |
652 | /// <param name="request"></param> | 652 | /// <param name="request"></param> |
653 | /// <param name="path"></param> | 653 | /// <param name="path"></param> |
654 | /// <param name="param"></param> | 654 | /// <param name="param"></param> |
655 | /// <param name="httpRequest">HTTP request header object</param> | 655 | /// <param name="httpRequest">HTTP request header object</param> |
656 | /// <param name="httpResponse">HTTP response header object</param> | 656 | /// <param name="httpResponse">HTTP response header object</param> |
657 | /// <returns></returns> | 657 | /// <returns></returns> |
658 | public string ScriptTaskInventory(string request, string path, string param, | 658 | public string ScriptTaskInventory(string request, string path, string param, |
659 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 659 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) |
660 | { | 660 | { |
661 | try | 661 | try |
662 | { | 662 | { |
663 | m_log.Debug("[CAPS]: ScriptTaskInventory Request in region: " + m_regionName); | 663 | m_log.Debug("[CAPS]: ScriptTaskInventory Request in region: " + m_regionName); |
664 | //m_log.DebugFormat("[CAPS]: request: {0}, path: {1}, param: {2}", request, path, param); | 664 | //m_log.DebugFormat("[CAPS]: request: {0}, path: {1}, param: {2}", request, path, param); |
665 | 665 | ||
666 | Hashtable hash = (Hashtable) LLSD.LLSDDeserialize(Utils.StringToBytes(request)); | 666 | Hashtable hash = (Hashtable) LLSD.LLSDDeserialize(Utils.StringToBytes(request)); |
667 | LLSDTaskScriptUpdate llsdUpdateRequest = new LLSDTaskScriptUpdate(); | 667 | LLSDTaskScriptUpdate llsdUpdateRequest = new LLSDTaskScriptUpdate(); |
668 | LLSDHelpers.DeserialiseOSDMap(hash, llsdUpdateRequest); | 668 | LLSDHelpers.DeserialiseOSDMap(hash, llsdUpdateRequest); |
669 | 669 | ||
670 | string capsBase = "/CAPS/" + m_capsObjectPath; | 670 | string capsBase = "/CAPS/" + m_capsObjectPath; |
671 | string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000"); | 671 | string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000"); |
672 | 672 | ||
673 | TaskInventoryScriptUpdater uploader = | 673 | TaskInventoryScriptUpdater uploader = |
674 | new TaskInventoryScriptUpdater( | 674 | new TaskInventoryScriptUpdater( |
675 | llsdUpdateRequest.item_id, | 675 | llsdUpdateRequest.item_id, |
676 | llsdUpdateRequest.task_id, | 676 | llsdUpdateRequest.task_id, |
677 | llsdUpdateRequest.is_script_running, | 677 | llsdUpdateRequest.is_script_running, |
678 | capsBase + uploaderPath, | 678 | capsBase + uploaderPath, |
679 | m_httpListener, | 679 | m_httpListener, |
680 | m_dumpAssetsToFile); | 680 | m_dumpAssetsToFile); |
681 | uploader.OnUpLoad += TaskScriptUpdated; | 681 | uploader.OnUpLoad += TaskScriptUpdated; |
682 | 682 | ||
683 | m_httpListener.AddStreamHandler( | 683 | m_httpListener.AddStreamHandler( |
684 | new BinaryStreamHandler("POST", capsBase + uploaderPath, uploader.uploaderCaps)); | 684 | new BinaryStreamHandler("POST", capsBase + uploaderPath, uploader.uploaderCaps)); |
685 | 685 | ||
686 | string protocol = "http://"; | 686 | string protocol = "http://"; |
687 | 687 | ||
688 | if (m_httpListener.UseSSL) | 688 | if (m_httpListener.UseSSL) |
689 | protocol = "https://"; | 689 | protocol = "https://"; |
690 | 690 | ||
691 | string uploaderURL = protocol + m_httpListenerHostName + ":" + m_httpListenPort.ToString() + capsBase + | 691 | string uploaderURL = protocol + m_httpListenerHostName + ":" + m_httpListenPort.ToString() + capsBase + |
692 | uploaderPath; | 692 | uploaderPath; |
693 | 693 | ||
694 | LLSDAssetUploadResponse uploadResponse = new LLSDAssetUploadResponse(); | 694 | LLSDAssetUploadResponse uploadResponse = new LLSDAssetUploadResponse(); |
695 | uploadResponse.uploader = uploaderURL; | 695 | uploadResponse.uploader = uploaderURL; |
696 | uploadResponse.state = "upload"; | 696 | uploadResponse.state = "upload"; |
697 | 697 | ||
698 | // m_log.InfoFormat("[CAPS]: " + | 698 | // m_log.InfoFormat("[CAPS]: " + |
699 | // "ScriptTaskInventory response: {0}", | 699 | // "ScriptTaskInventory response: {0}", |
700 | // LLSDHelpers.SerialiseLLSDReply(uploadResponse))); | 700 | // LLSDHelpers.SerialiseLLSDReply(uploadResponse))); |
701 | 701 | ||
702 | return LLSDHelpers.SerialiseLLSDReply(uploadResponse); | 702 | return LLSDHelpers.SerialiseLLSDReply(uploadResponse); |
703 | } | 703 | } |
704 | catch (Exception e) | 704 | catch (Exception e) |
705 | { | 705 | { |
706 | m_log.Error("[CAPS]: " + e.ToString()); | 706 | m_log.Error("[CAPS]: " + e.ToString()); |
707 | } | 707 | } |
708 | 708 | ||
709 | return null; | 709 | return null; |
710 | } | 710 | } |
711 | 711 | ||
712 | /// <summary> | 712 | /// <summary> |
713 | /// Called by the notecard update handler. Provides a URL to which the client can upload a new asset. | 713 | /// Called by the notecard update handler. Provides a URL to which the client can upload a new asset. |
714 | /// </summary> | 714 | /// </summary> |
715 | /// <param name="request"></param> | 715 | /// <param name="request"></param> |
716 | /// <param name="path"></param> | 716 | /// <param name="path"></param> |
717 | /// <param name="param"></param> | 717 | /// <param name="param"></param> |
718 | /// <returns></returns> | 718 | /// <returns></returns> |
719 | public string NoteCardAgentInventory(string request, string path, string param, | 719 | public string NoteCardAgentInventory(string request, string path, string param, |
720 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 720 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) |
721 | { | 721 | { |
722 | //m_log.Debug("[CAPS]: NoteCardAgentInventory Request in region: " + m_regionName + "\n" + request); | 722 | //m_log.Debug("[CAPS]: NoteCardAgentInventory Request in region: " + m_regionName + "\n" + request); |
723 | //m_log.Debug("[CAPS]: NoteCardAgentInventory Request is: " + request); | 723 | //m_log.Debug("[CAPS]: NoteCardAgentInventory Request is: " + request); |
724 | 724 | ||
725 | //OpenMetaverse.StructuredData.OSDMap hash = (OpenMetaverse.StructuredData.OSDMap)OpenMetaverse.StructuredData.LLSDParser.DeserializeBinary(Utils.StringToBytes(request)); | 725 | //OpenMetaverse.StructuredData.OSDMap hash = (OpenMetaverse.StructuredData.OSDMap)OpenMetaverse.StructuredData.LLSDParser.DeserializeBinary(Utils.StringToBytes(request)); |
726 | Hashtable hash = (Hashtable) LLSD.LLSDDeserialize(Utils.StringToBytes(request)); | 726 | Hashtable hash = (Hashtable) LLSD.LLSDDeserialize(Utils.StringToBytes(request)); |
727 | LLSDItemUpdate llsdRequest = new LLSDItemUpdate(); | 727 | LLSDItemUpdate llsdRequest = new LLSDItemUpdate(); |
728 | LLSDHelpers.DeserialiseOSDMap(hash, llsdRequest); | 728 | LLSDHelpers.DeserialiseOSDMap(hash, llsdRequest); |
729 | 729 | ||
730 | string capsBase = "/CAPS/" + m_capsObjectPath; | 730 | string capsBase = "/CAPS/" + m_capsObjectPath; |
731 | string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000"); | 731 | string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000"); |
732 | 732 | ||
733 | ItemUpdater uploader = | 733 | ItemUpdater uploader = |
734 | new ItemUpdater(llsdRequest.item_id, capsBase + uploaderPath, m_httpListener, m_dumpAssetsToFile); | 734 | new ItemUpdater(llsdRequest.item_id, capsBase + uploaderPath, m_httpListener, m_dumpAssetsToFile); |
735 | uploader.OnUpLoad += ItemUpdated; | 735 | uploader.OnUpLoad += ItemUpdated; |
736 | 736 | ||
737 | m_httpListener.AddStreamHandler( | 737 | m_httpListener.AddStreamHandler( |
738 | new BinaryStreamHandler("POST", capsBase + uploaderPath, uploader.uploaderCaps)); | 738 | new BinaryStreamHandler("POST", capsBase + uploaderPath, uploader.uploaderCaps)); |
739 | 739 | ||
740 | string protocol = "http://"; | 740 | string protocol = "http://"; |
741 | 741 | ||
742 | if (m_httpListener.UseSSL) | 742 | if (m_httpListener.UseSSL) |
743 | protocol = "https://"; | 743 | protocol = "https://"; |
744 | 744 | ||
745 | string uploaderURL = protocol + m_httpListenerHostName + ":" + m_httpListenPort.ToString() + capsBase + | 745 | string uploaderURL = protocol + m_httpListenerHostName + ":" + m_httpListenPort.ToString() + capsBase + |
746 | uploaderPath; | 746 | uploaderPath; |
747 | 747 | ||
748 | LLSDAssetUploadResponse uploadResponse = new LLSDAssetUploadResponse(); | 748 | LLSDAssetUploadResponse uploadResponse = new LLSDAssetUploadResponse(); |
749 | uploadResponse.uploader = uploaderURL; | 749 | uploadResponse.uploader = uploaderURL; |
750 | uploadResponse.state = "upload"; | 750 | uploadResponse.state = "upload"; |
751 | 751 | ||
752 | // m_log.InfoFormat("[CAPS]: " + | 752 | // m_log.InfoFormat("[CAPS]: " + |
753 | // "NoteCardAgentInventory response: {0}", | 753 | // "NoteCardAgentInventory response: {0}", |
754 | // LLSDHelpers.SerialiseLLSDReply(uploadResponse))); | 754 | // LLSDHelpers.SerialiseLLSDReply(uploadResponse))); |
755 | 755 | ||
756 | return LLSDHelpers.SerialiseLLSDReply(uploadResponse); | 756 | return LLSDHelpers.SerialiseLLSDReply(uploadResponse); |
757 | } | 757 | } |
758 | 758 | ||
759 | /// <summary> | 759 | /// <summary> |
760 | /// | 760 | /// |
761 | /// </summary> | 761 | /// </summary> |
762 | /// <param name="llsdRequest"></param> | 762 | /// <param name="llsdRequest"></param> |
763 | /// <returns></returns> | 763 | /// <returns></returns> |
764 | public LLSDAssetUploadResponse NewAgentInventoryRequest(LLSDAssetUploadRequest llsdRequest) | 764 | public LLSDAssetUploadResponse NewAgentInventoryRequest(LLSDAssetUploadRequest llsdRequest) |
765 | { | 765 | { |
766 | //m_log.Debug("[CAPS]: NewAgentInventoryRequest Request is: " + llsdRequest.ToString()); | 766 | //m_log.Debug("[CAPS]: NewAgentInventoryRequest Request is: " + llsdRequest.ToString()); |
767 | //m_log.Debug("asset upload request via CAPS" + llsdRequest.inventory_type + " , " + llsdRequest.asset_type); | 767 | //m_log.Debug("asset upload request via CAPS" + llsdRequest.inventory_type + " , " + llsdRequest.asset_type); |
768 | 768 | ||
769 | if (llsdRequest.asset_type == "texture" || | 769 | if (llsdRequest.asset_type == "texture" || |
770 | llsdRequest.asset_type == "animation" || | 770 | llsdRequest.asset_type == "animation" || |
771 | llsdRequest.asset_type == "sound") | 771 | llsdRequest.asset_type == "sound") |
772 | { | 772 | { |
773 | IClientAPI client = null; | 773 | IClientAPI client = null; |
774 | IScene scene = null; | 774 | IScene scene = null; |
775 | if (GetClient != null) | 775 | if (GetClient != null) |
776 | { | 776 | { |
777 | client = GetClient(m_agentID); | 777 | client = GetClient(m_agentID); |
778 | scene = client.Scene; | 778 | scene = client.Scene; |
779 | 779 | ||
780 | IMoneyModule mm = scene.RequestModuleInterface<IMoneyModule>(); | 780 | IMoneyModule mm = scene.RequestModuleInterface<IMoneyModule>(); |
781 | 781 | ||
782 | if (mm != null) | 782 | if (mm != null) |
783 | { | 783 | { |
784 | if (!mm.UploadCovered(client)) | 784 | if (!mm.UploadCovered(client)) |
785 | { | 785 | { |
786 | if (client != null) | 786 | if (client != null) |
787 | client.SendAgentAlertMessage("Unable to upload asset. Insufficient funds.", false); | 787 | client.SendAgentAlertMessage("Unable to upload asset. Insufficient funds.", false); |
788 | 788 | ||
789 | LLSDAssetUploadResponse errorResponse = new LLSDAssetUploadResponse(); | 789 | LLSDAssetUploadResponse errorResponse = new LLSDAssetUploadResponse(); |
790 | errorResponse.uploader = ""; | 790 | errorResponse.uploader = ""; |
791 | errorResponse.state = "error"; | 791 | errorResponse.state = "error"; |
792 | return errorResponse; | 792 | return errorResponse; |
793 | } | 793 | } |
794 | } | 794 | } |
795 | } | 795 | } |
796 | } | 796 | } |
797 | 797 | ||
798 | 798 | ||
799 | string assetName = llsdRequest.name; | 799 | string assetName = llsdRequest.name; |
800 | string assetDes = llsdRequest.description; | 800 | string assetDes = llsdRequest.description; |
801 | string capsBase = "/CAPS/" + m_capsObjectPath; | 801 | string capsBase = "/CAPS/" + m_capsObjectPath; |
802 | UUID newAsset = UUID.Random(); | 802 | UUID newAsset = UUID.Random(); |
803 | UUID newInvItem = UUID.Random(); | 803 | UUID newInvItem = UUID.Random(); |
804 | UUID parentFolder = llsdRequest.folder_id; | 804 | UUID parentFolder = llsdRequest.folder_id; |
805 | string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000"); | 805 | string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000"); |
806 | 806 | ||
807 | AssetUploader uploader = | 807 | AssetUploader uploader = |
808 | new AssetUploader(assetName, assetDes, newAsset, newInvItem, parentFolder, llsdRequest.inventory_type, | 808 | new AssetUploader(assetName, assetDes, newAsset, newInvItem, parentFolder, llsdRequest.inventory_type, |
809 | llsdRequest.asset_type, capsBase + uploaderPath, m_httpListener, m_dumpAssetsToFile); | 809 | llsdRequest.asset_type, capsBase + uploaderPath, m_httpListener, m_dumpAssetsToFile); |
810 | m_httpListener.AddStreamHandler( | 810 | m_httpListener.AddStreamHandler( |
811 | new BinaryStreamHandler("POST", capsBase + uploaderPath, uploader.uploaderCaps)); | 811 | new BinaryStreamHandler("POST", capsBase + uploaderPath, uploader.uploaderCaps)); |
812 | 812 | ||
813 | string protocol = "http://"; | 813 | string protocol = "http://"; |
814 | 814 | ||
815 | if (m_httpListener.UseSSL) | 815 | if (m_httpListener.UseSSL) |
816 | protocol = "https://"; | 816 | protocol = "https://"; |
817 | 817 | ||
818 | string uploaderURL = protocol + m_httpListenerHostName + ":" + m_httpListenPort.ToString() + capsBase + | 818 | string uploaderURL = protocol + m_httpListenerHostName + ":" + m_httpListenPort.ToString() + capsBase + |
819 | uploaderPath; | 819 | uploaderPath; |
820 | 820 | ||
821 | LLSDAssetUploadResponse uploadResponse = new LLSDAssetUploadResponse(); | 821 | LLSDAssetUploadResponse uploadResponse = new LLSDAssetUploadResponse(); |
822 | uploadResponse.uploader = uploaderURL; | 822 | uploadResponse.uploader = uploaderURL; |
823 | uploadResponse.state = "upload"; | 823 | uploadResponse.state = "upload"; |
824 | uploader.OnUpLoad += UploadCompleteHandler; | 824 | uploader.OnUpLoad += UploadCompleteHandler; |
825 | return uploadResponse; | 825 | return uploadResponse; |
826 | } | 826 | } |
827 | 827 | ||
828 | /// <summary> | 828 | /// <summary> |
829 | /// | 829 | /// |
830 | /// </summary> | 830 | /// </summary> |
831 | /// <param name="assetID"></param> | 831 | /// <param name="assetID"></param> |
832 | /// <param name="inventoryItem"></param> | 832 | /// <param name="inventoryItem"></param> |
833 | /// <param name="data"></param> | 833 | /// <param name="data"></param> |
834 | public void UploadCompleteHandler(string assetName, string assetDescription, UUID assetID, | 834 | public void UploadCompleteHandler(string assetName, string assetDescription, UUID assetID, |
835 | UUID inventoryItem, UUID parentFolder, byte[] data, string inventoryType, | 835 | UUID inventoryItem, UUID parentFolder, byte[] data, string inventoryType, |
836 | string assetType) | 836 | string assetType) |
837 | { | 837 | { |
838 | sbyte assType = 0; | 838 | sbyte assType = 0; |
839 | sbyte inType = 0; | 839 | sbyte inType = 0; |
840 | 840 | ||
841 | if (inventoryType == "sound") | 841 | if (inventoryType == "sound") |
842 | { | 842 | { |
843 | inType = 1; | 843 | inType = 1; |
844 | assType = 1; | 844 | assType = 1; |
845 | } | 845 | } |
846 | else if (inventoryType == "animation") | 846 | else if (inventoryType == "animation") |
847 | { | 847 | { |
848 | inType = 19; | 848 | inType = 19; |
849 | assType = 20; | 849 | assType = 20; |
850 | } | 850 | } |
851 | else if (inventoryType == "wearable") | 851 | else if (inventoryType == "wearable") |
852 | { | 852 | { |
853 | inType = 18; | 853 | inType = 18; |
854 | switch (assetType) | 854 | switch (assetType) |
855 | { | 855 | { |
856 | case "bodypart": | 856 | case "bodypart": |
857 | assType = 13; | 857 | assType = 13; |
858 | break; | 858 | break; |
859 | case "clothing": | 859 | case "clothing": |
860 | assType = 5; | 860 | assType = 5; |
861 | break; | 861 | break; |
862 | } | 862 | } |
863 | } | 863 | } |
864 | 864 | ||
865 | AssetBase asset; | 865 | AssetBase asset; |
866 | asset = new AssetBase(); | 866 | asset = new AssetBase(); |
867 | asset.FullID = assetID; | 867 | asset.FullID = assetID; |
868 | asset.Type = assType; | 868 | asset.Type = assType; |
869 | asset.Name = assetName; | 869 | asset.Name = assetName; |
870 | asset.Data = data; | 870 | asset.Data = data; |
871 | if (AddNewAsset != null) | 871 | if (AddNewAsset != null) |
872 | AddNewAsset(asset); | 872 | AddNewAsset(asset); |
873 | else if (m_assetCache != null) | 873 | else if (m_assetCache != null) |
874 | m_assetCache.Store(asset); | 874 | m_assetCache.Store(asset); |
875 | 875 | ||
876 | InventoryItemBase item = new InventoryItemBase(); | 876 | InventoryItemBase item = new InventoryItemBase(); |
877 | item.Owner = m_agentID; | 877 | item.Owner = m_agentID; |
878 | item.CreatorId = m_agentID.ToString(); | 878 | item.CreatorId = m_agentID.ToString(); |
879 | item.ID = inventoryItem; | 879 | item.ID = inventoryItem; |
880 | item.AssetID = asset.FullID; | 880 | item.AssetID = asset.FullID; |
881 | item.Description = assetDescription; | 881 | item.Description = assetDescription; |
882 | item.Name = assetName; | 882 | item.Name = assetName; |
883 | item.AssetType = assType; | 883 | item.AssetType = assType; |
884 | item.InvType = inType; | 884 | item.InvType = inType; |
885 | item.Folder = parentFolder; | 885 | item.Folder = parentFolder; |
886 | item.CurrentPermissions = 2147483647; | 886 | item.CurrentPermissions = 2147483647; |
887 | item.BasePermissions = 2147483647; | 887 | item.BasePermissions = 2147483647; |
888 | item.EveryOnePermissions = 0; | 888 | item.EveryOnePermissions = 0; |
889 | item.NextPermissions = 2147483647; | 889 | item.NextPermissions = 2147483647; |
890 | item.CreationDate = Util.UnixTimeSinceEpoch(); | 890 | item.CreationDate = Util.UnixTimeSinceEpoch(); |
891 | 891 | ||
892 | if (AddNewInventoryItem != null) | 892 | if (AddNewInventoryItem != null) |
893 | { | 893 | { |
894 | AddNewInventoryItem(m_agentID, item); | 894 | AddNewInventoryItem(m_agentID, item); |
895 | } | 895 | } |
896 | } | 896 | } |
897 | 897 | ||
898 | /// <summary> | 898 | /// <summary> |
899 | /// Called when new asset data for an agent inventory item update has been uploaded. | 899 | /// Called when new asset data for an agent inventory item update has been uploaded. |
900 | /// </summary> | 900 | /// </summary> |
901 | /// <param name="itemID">Item to update</param> | 901 | /// <param name="itemID">Item to update</param> |
902 | /// <param name="data">New asset data</param> | 902 | /// <param name="data">New asset data</param> |
903 | /// <returns></returns> | 903 | /// <returns></returns> |
904 | public UUID ItemUpdated(UUID itemID, byte[] data) | 904 | public UUID ItemUpdated(UUID itemID, byte[] data) |
905 | { | 905 | { |
906 | if (ItemUpdatedCall != null) | 906 | if (ItemUpdatedCall != null) |
907 | { | 907 | { |
908 | return ItemUpdatedCall(m_agentID, itemID, data); | 908 | return ItemUpdatedCall(m_agentID, itemID, data); |
909 | } | 909 | } |
910 | 910 | ||
911 | return UUID.Zero; | 911 | return UUID.Zero; |
912 | } | 912 | } |
913 | 913 | ||
914 | /// <summary> | 914 | /// <summary> |
915 | /// Called when new asset data for an agent inventory item update has been uploaded. | 915 | /// Called when new asset data for an agent inventory item update has been uploaded. |
916 | /// </summary> | 916 | /// </summary> |
917 | /// <param name="itemID">Item to update</param> | 917 | /// <param name="itemID">Item to update</param> |
918 | /// <param name="primID">Prim containing item to update</param> | 918 | /// <param name="primID">Prim containing item to update</param> |
919 | /// <param name="isScriptRunning">Signals whether the script to update is currently running</param> | 919 | /// <param name="isScriptRunning">Signals whether the script to update is currently running</param> |
920 | /// <param name="data">New asset data</param> | 920 | /// <param name="data">New asset data</param> |
921 | public void TaskScriptUpdated(UUID itemID, UUID primID, bool isScriptRunning, byte[] data) | 921 | public void TaskScriptUpdated(UUID itemID, UUID primID, bool isScriptRunning, byte[] data) |
922 | { | 922 | { |
923 | if (TaskScriptUpdatedCall != null) | 923 | if (TaskScriptUpdatedCall != null) |
924 | { | 924 | { |
925 | TaskScriptUpdatedCall(m_agentID, itemID, primID, isScriptRunning, data); | 925 | TaskScriptUpdatedCall(m_agentID, itemID, primID, isScriptRunning, data); |
926 | } | 926 | } |
927 | } | 927 | } |
928 | 928 | ||
929 | public class AssetUploader | 929 | public class AssetUploader |
930 | { | 930 | { |
931 | public event UpLoadedAsset OnUpLoad; | 931 | public event UpLoadedAsset OnUpLoad; |
932 | private UpLoadedAsset handlerUpLoad = null; | 932 | private UpLoadedAsset handlerUpLoad = null; |
933 | 933 | ||
934 | private string uploaderPath = String.Empty; | 934 | private string uploaderPath = String.Empty; |
935 | private UUID newAssetID; | 935 | private UUID newAssetID; |
936 | private UUID inventoryItemID; | 936 | private UUID inventoryItemID; |
937 | private UUID parentFolder; | 937 | private UUID parentFolder; |
938 | private IHttpServer httpListener; | 938 | private IHttpServer httpListener; |
939 | private bool m_dumpAssetsToFile; | 939 | private bool m_dumpAssetsToFile; |
940 | private string m_assetName = String.Empty; | 940 | private string m_assetName = String.Empty; |
941 | private string m_assetDes = String.Empty; | 941 | private string m_assetDes = String.Empty; |
942 | 942 | ||
943 | private string m_invType = String.Empty; | 943 | private string m_invType = String.Empty; |
944 | private string m_assetType = String.Empty; | 944 | private string m_assetType = String.Empty; |
945 | 945 | ||
946 | public AssetUploader(string assetName, string description, UUID assetID, UUID inventoryItem, | 946 | public AssetUploader(string assetName, string description, UUID assetID, UUID inventoryItem, |
947 | UUID parentFolderID, string invType, string assetType, string path, | 947 | UUID parentFolderID, string invType, string assetType, string path, |
948 | IHttpServer httpServer, bool dumpAssetsToFile) | 948 | IHttpServer httpServer, bool dumpAssetsToFile) |
949 | { | 949 | { |
950 | m_assetName = assetName; | 950 | m_assetName = assetName; |
951 | m_assetDes = description; | 951 | m_assetDes = description; |
952 | newAssetID = assetID; | 952 | newAssetID = assetID; |
953 | inventoryItemID = inventoryItem; | 953 | inventoryItemID = inventoryItem; |
954 | uploaderPath = path; | 954 | uploaderPath = path; |
955 | httpListener = httpServer; | 955 | httpListener = httpServer; |
956 | parentFolder = parentFolderID; | 956 | parentFolder = parentFolderID; |
957 | m_assetType = assetType; | 957 | m_assetType = assetType; |
958 | m_invType = invType; | 958 | m_invType = invType; |
959 | m_dumpAssetsToFile = dumpAssetsToFile; | 959 | m_dumpAssetsToFile = dumpAssetsToFile; |
960 | } | 960 | } |
961 | 961 | ||
962 | /// <summary> | 962 | /// <summary> |
963 | /// | 963 | /// |
964 | /// </summary> | 964 | /// </summary> |
965 | /// <param name="data"></param> | 965 | /// <param name="data"></param> |
966 | /// <param name="path"></param> | 966 | /// <param name="path"></param> |
967 | /// <param name="param"></param> | 967 | /// <param name="param"></param> |
968 | /// <returns></returns> | 968 | /// <returns></returns> |
969 | public string uploaderCaps(byte[] data, string path, string param) | 969 | public string uploaderCaps(byte[] data, string path, string param) |
970 | { | 970 | { |
971 | UUID inv = inventoryItemID; | 971 | UUID inv = inventoryItemID; |
972 | string res = String.Empty; | 972 | string res = String.Empty; |
973 | LLSDAssetUploadComplete uploadComplete = new LLSDAssetUploadComplete(); | 973 | LLSDAssetUploadComplete uploadComplete = new LLSDAssetUploadComplete(); |
974 | uploadComplete.new_asset = newAssetID.ToString(); | 974 | uploadComplete.new_asset = newAssetID.ToString(); |
975 | uploadComplete.new_inventory_item = inv; | 975 | uploadComplete.new_inventory_item = inv; |
976 | uploadComplete.state = "complete"; | 976 | uploadComplete.state = "complete"; |
977 | 977 | ||
978 | res = LLSDHelpers.SerialiseLLSDReply(uploadComplete); | 978 | res = LLSDHelpers.SerialiseLLSDReply(uploadComplete); |
979 | 979 | ||
980 | httpListener.RemoveStreamHandler("POST", uploaderPath); | 980 | httpListener.RemoveStreamHandler("POST", uploaderPath); |
981 | 981 | ||
982 | // TODO: probably make this a better set of extensions here | 982 | // TODO: probably make this a better set of extensions here |
983 | string extension = ".jp2"; | 983 | string extension = ".jp2"; |
984 | if (m_invType != "image") | 984 | if (m_invType != "image") |
985 | { | 985 | { |
986 | extension = ".dat"; | 986 | extension = ".dat"; |
987 | } | 987 | } |
988 | 988 | ||
989 | if (m_dumpAssetsToFile) | 989 | if (m_dumpAssetsToFile) |
990 | { | 990 | { |
991 | SaveAssetToFile(m_assetName + extension, data); | 991 | SaveAssetToFile(m_assetName + extension, data); |
992 | } | 992 | } |
993 | handlerUpLoad = OnUpLoad; | 993 | handlerUpLoad = OnUpLoad; |
994 | if (handlerUpLoad != null) | 994 | if (handlerUpLoad != null) |
995 | { | 995 | { |
996 | handlerUpLoad(m_assetName, m_assetDes, newAssetID, inv, parentFolder, data, m_invType, m_assetType); | 996 | handlerUpLoad(m_assetName, m_assetDes, newAssetID, inv, parentFolder, data, m_invType, m_assetType); |
997 | } | 997 | } |
998 | 998 | ||
999 | return res; | 999 | return res; |
1000 | } | 1000 | } |
1001 | ///Left this in and commented in case there are unforseen issues | 1001 | ///Left this in and commented in case there are unforseen issues |
1002 | //private void SaveAssetToFile(string filename, byte[] data) | 1002 | //private void SaveAssetToFile(string filename, byte[] data) |
1003 | //{ | 1003 | //{ |
1004 | // FileStream fs = File.Create(filename); | 1004 | // FileStream fs = File.Create(filename); |
1005 | // BinaryWriter bw = new BinaryWriter(fs); | 1005 | // BinaryWriter bw = new BinaryWriter(fs); |
1006 | // bw.Write(data); | 1006 | // bw.Write(data); |
1007 | // bw.Close(); | 1007 | // bw.Close(); |
1008 | // fs.Close(); | 1008 | // fs.Close(); |
1009 | //} | 1009 | //} |
1010 | private static void SaveAssetToFile(string filename, byte[] data) | 1010 | private static void SaveAssetToFile(string filename, byte[] data) |
1011 | { | 1011 | { |
1012 | string assetPath = "UserAssets"; | 1012 | string assetPath = "UserAssets"; |
1013 | if (!Directory.Exists(assetPath)) | 1013 | if (!Directory.Exists(assetPath)) |
1014 | { | 1014 | { |
1015 | Directory.CreateDirectory(assetPath); | 1015 | Directory.CreateDirectory(assetPath); |
1016 | } | 1016 | } |
1017 | FileStream fs = File.Create(Path.Combine(assetPath, Util.safeFileName(filename))); | 1017 | FileStream fs = File.Create(Path.Combine(assetPath, Util.safeFileName(filename))); |
1018 | BinaryWriter bw = new BinaryWriter(fs); | 1018 | BinaryWriter bw = new BinaryWriter(fs); |
1019 | bw.Write(data); | 1019 | bw.Write(data); |
1020 | bw.Close(); | 1020 | bw.Close(); |
1021 | fs.Close(); | 1021 | fs.Close(); |
1022 | } | 1022 | } |
1023 | } | 1023 | } |
1024 | 1024 | ||
1025 | /// <summary> | 1025 | /// <summary> |
1026 | /// This class is a callback invoked when a client sends asset data to | 1026 | /// This class is a callback invoked when a client sends asset data to |
1027 | /// an agent inventory notecard update url | 1027 | /// an agent inventory notecard update url |
1028 | /// </summary> | 1028 | /// </summary> |
1029 | public class ItemUpdater | 1029 | public class ItemUpdater |
1030 | { | 1030 | { |
1031 | public event UpdateItem OnUpLoad; | 1031 | public event UpdateItem OnUpLoad; |
1032 | 1032 | ||
1033 | private UpdateItem handlerUpdateItem = null; | 1033 | private UpdateItem handlerUpdateItem = null; |
1034 | 1034 | ||
1035 | private string uploaderPath = String.Empty; | 1035 | private string uploaderPath = String.Empty; |
1036 | private UUID inventoryItemID; | 1036 | private UUID inventoryItemID; |
1037 | private IHttpServer httpListener; | 1037 | private IHttpServer httpListener; |
1038 | private bool m_dumpAssetToFile; | 1038 | private bool m_dumpAssetToFile; |
1039 | 1039 | ||
1040 | public ItemUpdater(UUID inventoryItem, string path, IHttpServer httpServer, bool dumpAssetToFile) | 1040 | public ItemUpdater(UUID inventoryItem, string path, IHttpServer httpServer, bool dumpAssetToFile) |
1041 | { | 1041 | { |
1042 | m_dumpAssetToFile = dumpAssetToFile; | 1042 | m_dumpAssetToFile = dumpAssetToFile; |
1043 | 1043 | ||
1044 | inventoryItemID = inventoryItem; | 1044 | inventoryItemID = inventoryItem; |
1045 | uploaderPath = path; | 1045 | uploaderPath = path; |
1046 | httpListener = httpServer; | 1046 | httpListener = httpServer; |
1047 | } | 1047 | } |
1048 | 1048 | ||
1049 | /// <summary> | 1049 | /// <summary> |
1050 | /// | 1050 | /// |
1051 | /// </summary> | 1051 | /// </summary> |
1052 | /// <param name="data"></param> | 1052 | /// <param name="data"></param> |
1053 | /// <param name="path"></param> | 1053 | /// <param name="path"></param> |
1054 | /// <param name="param"></param> | 1054 | /// <param name="param"></param> |
1055 | /// <returns></returns> | 1055 | /// <returns></returns> |
1056 | public string uploaderCaps(byte[] data, string path, string param) | 1056 | public string uploaderCaps(byte[] data, string path, string param) |
1057 | { | 1057 | { |
1058 | UUID inv = inventoryItemID; | 1058 | UUID inv = inventoryItemID; |
1059 | string res = String.Empty; | 1059 | string res = String.Empty; |
1060 | LLSDAssetUploadComplete uploadComplete = new LLSDAssetUploadComplete(); | 1060 | LLSDAssetUploadComplete uploadComplete = new LLSDAssetUploadComplete(); |
1061 | UUID assetID = UUID.Zero; | 1061 | UUID assetID = UUID.Zero; |
1062 | handlerUpdateItem = OnUpLoad; | 1062 | handlerUpdateItem = OnUpLoad; |
1063 | if (handlerUpdateItem != null) | 1063 | if (handlerUpdateItem != null) |
1064 | { | 1064 | { |
1065 | assetID = handlerUpdateItem(inv, data); | 1065 | assetID = handlerUpdateItem(inv, data); |
1066 | } | 1066 | } |
1067 | 1067 | ||
1068 | uploadComplete.new_asset = assetID.ToString(); | 1068 | uploadComplete.new_asset = assetID.ToString(); |
1069 | uploadComplete.new_inventory_item = inv; | 1069 | uploadComplete.new_inventory_item = inv; |
1070 | uploadComplete.state = "complete"; | 1070 | uploadComplete.state = "complete"; |
1071 | 1071 | ||
1072 | res = LLSDHelpers.SerialiseLLSDReply(uploadComplete); | 1072 | res = LLSDHelpers.SerialiseLLSDReply(uploadComplete); |
1073 | 1073 | ||
1074 | httpListener.RemoveStreamHandler("POST", uploaderPath); | 1074 | httpListener.RemoveStreamHandler("POST", uploaderPath); |
1075 | 1075 | ||
1076 | if (m_dumpAssetToFile) | 1076 | if (m_dumpAssetToFile) |
1077 | { | 1077 | { |
1078 | SaveAssetToFile("updateditem" + Util.RandomClass.Next(1, 1000) + ".dat", data); | 1078 | SaveAssetToFile("updateditem" + Util.RandomClass.Next(1, 1000) + ".dat", data); |
1079 | } | 1079 | } |
1080 | 1080 | ||
1081 | return res; | 1081 | return res; |
1082 | } | 1082 | } |
1083 | ///Left this in and commented in case there are unforseen issues | 1083 | ///Left this in and commented in case there are unforseen issues |
1084 | //private void SaveAssetToFile(string filename, byte[] data) | 1084 | //private void SaveAssetToFile(string filename, byte[] data) |
1085 | //{ | 1085 | //{ |
1086 | // FileStream fs = File.Create(filename); | 1086 | // FileStream fs = File.Create(filename); |
1087 | // BinaryWriter bw = new BinaryWriter(fs); | 1087 | // BinaryWriter bw = new BinaryWriter(fs); |
1088 | // bw.Write(data); | 1088 | // bw.Write(data); |
1089 | // bw.Close(); | 1089 | // bw.Close(); |
1090 | // fs.Close(); | 1090 | // fs.Close(); |
1091 | //} | 1091 | //} |
1092 | private static void SaveAssetToFile(string filename, byte[] data) | 1092 | private static void SaveAssetToFile(string filename, byte[] data) |
1093 | { | 1093 | { |
1094 | string assetPath = "UserAssets"; | 1094 | string assetPath = "UserAssets"; |
1095 | if (!Directory.Exists(assetPath)) | 1095 | if (!Directory.Exists(assetPath)) |
1096 | { | 1096 | { |
1097 | Directory.CreateDirectory(assetPath); | 1097 | Directory.CreateDirectory(assetPath); |
1098 | } | 1098 | } |
1099 | FileStream fs = File.Create(Path.Combine(assetPath, filename)); | 1099 | FileStream fs = File.Create(Path.Combine(assetPath, filename)); |
1100 | BinaryWriter bw = new BinaryWriter(fs); | 1100 | BinaryWriter bw = new BinaryWriter(fs); |
1101 | bw.Write(data); | 1101 | bw.Write(data); |
1102 | bw.Close(); | 1102 | bw.Close(); |
1103 | fs.Close(); | 1103 | fs.Close(); |
1104 | } | 1104 | } |
1105 | } | 1105 | } |
1106 | 1106 | ||
1107 | /// <summary> | 1107 | /// <summary> |
1108 | /// This class is a callback invoked when a client sends asset data to | 1108 | /// This class is a callback invoked when a client sends asset data to |
1109 | /// a task inventory script update url | 1109 | /// a task inventory script update url |
1110 | /// </summary> | 1110 | /// </summary> |
1111 | public class TaskInventoryScriptUpdater | 1111 | public class TaskInventoryScriptUpdater |
1112 | { | 1112 | { |
1113 | public event UpdateTaskScript OnUpLoad; | 1113 | public event UpdateTaskScript OnUpLoad; |
1114 | 1114 | ||
1115 | private UpdateTaskScript handlerUpdateTaskScript = null; | 1115 | private UpdateTaskScript handlerUpdateTaskScript = null; |
1116 | 1116 | ||
1117 | private string uploaderPath = String.Empty; | 1117 | private string uploaderPath = String.Empty; |
1118 | private UUID inventoryItemID; | 1118 | private UUID inventoryItemID; |
1119 | private UUID primID; | 1119 | private UUID primID; |
1120 | private bool isScriptRunning; | 1120 | private bool isScriptRunning; |
1121 | private IHttpServer httpListener; | 1121 | private IHttpServer httpListener; |
1122 | private bool m_dumpAssetToFile; | 1122 | private bool m_dumpAssetToFile; |
1123 | 1123 | ||
1124 | public TaskInventoryScriptUpdater(UUID inventoryItemID, UUID primID, int isScriptRunning, | 1124 | public TaskInventoryScriptUpdater(UUID inventoryItemID, UUID primID, int isScriptRunning, |
1125 | string path, IHttpServer httpServer, bool dumpAssetToFile) | 1125 | string path, IHttpServer httpServer, bool dumpAssetToFile) |
1126 | { | 1126 | { |
1127 | m_dumpAssetToFile = dumpAssetToFile; | 1127 | m_dumpAssetToFile = dumpAssetToFile; |
1128 | 1128 | ||
1129 | this.inventoryItemID = inventoryItemID; | 1129 | this.inventoryItemID = inventoryItemID; |
1130 | this.primID = primID; | 1130 | this.primID = primID; |
1131 | 1131 | ||
1132 | // This comes in over the packet as an integer, but actually appears to be treated as a bool | 1132 | // This comes in over the packet as an integer, but actually appears to be treated as a bool |
1133 | this.isScriptRunning = (0 == isScriptRunning ? false : true); | 1133 | this.isScriptRunning = (0 == isScriptRunning ? false : true); |
1134 | 1134 | ||
1135 | uploaderPath = path; | 1135 | uploaderPath = path; |
1136 | httpListener = httpServer; | 1136 | httpListener = httpServer; |
1137 | } | 1137 | } |
1138 | 1138 | ||
1139 | /// <summary> | 1139 | /// <summary> |
1140 | /// | 1140 | /// |
1141 | /// </summary> | 1141 | /// </summary> |
1142 | /// <param name="data"></param> | 1142 | /// <param name="data"></param> |
1143 | /// <param name="path"></param> | 1143 | /// <param name="path"></param> |
1144 | /// <param name="param"></param> | 1144 | /// <param name="param"></param> |
1145 | /// <returns></returns> | 1145 | /// <returns></returns> |
1146 | public string uploaderCaps(byte[] data, string path, string param) | 1146 | public string uploaderCaps(byte[] data, string path, string param) |
1147 | { | 1147 | { |
1148 | try | 1148 | try |
1149 | { | 1149 | { |
1150 | // m_log.InfoFormat("[CAPS]: " + | 1150 | // m_log.InfoFormat("[CAPS]: " + |
1151 | // "TaskInventoryScriptUpdater received data: {0}, path: {1}, param: {2}", | 1151 | // "TaskInventoryScriptUpdater received data: {0}, path: {1}, param: {2}", |
1152 | // data, path, param)); | 1152 | // data, path, param)); |
1153 | 1153 | ||
1154 | string res = String.Empty; | 1154 | string res = String.Empty; |
1155 | LLSDTaskInventoryUploadComplete uploadComplete = new LLSDTaskInventoryUploadComplete(); | 1155 | LLSDTaskInventoryUploadComplete uploadComplete = new LLSDTaskInventoryUploadComplete(); |
1156 | 1156 | ||
1157 | handlerUpdateTaskScript = OnUpLoad; | 1157 | handlerUpdateTaskScript = OnUpLoad; |
1158 | if (handlerUpdateTaskScript != null) | 1158 | if (handlerUpdateTaskScript != null) |
1159 | { | 1159 | { |
1160 | handlerUpdateTaskScript(inventoryItemID, primID, isScriptRunning, data); | 1160 | handlerUpdateTaskScript(inventoryItemID, primID, isScriptRunning, data); |
1161 | } | 1161 | } |
1162 | 1162 | ||
1163 | uploadComplete.item_id = inventoryItemID; | 1163 | uploadComplete.item_id = inventoryItemID; |
1164 | uploadComplete.task_id = primID; | 1164 | uploadComplete.task_id = primID; |
1165 | uploadComplete.state = "complete"; | 1165 | uploadComplete.state = "complete"; |
1166 | 1166 | ||
1167 | res = LLSDHelpers.SerialiseLLSDReply(uploadComplete); | 1167 | res = LLSDHelpers.SerialiseLLSDReply(uploadComplete); |
1168 | 1168 | ||
1169 | httpListener.RemoveStreamHandler("POST", uploaderPath); | 1169 | httpListener.RemoveStreamHandler("POST", uploaderPath); |
1170 | 1170 | ||
1171 | if (m_dumpAssetToFile) | 1171 | if (m_dumpAssetToFile) |
1172 | { | 1172 | { |
1173 | SaveAssetToFile("updatedtaskscript" + Util.RandomClass.Next(1, 1000) + ".dat", data); | 1173 | SaveAssetToFile("updatedtaskscript" + Util.RandomClass.Next(1, 1000) + ".dat", data); |
1174 | } | 1174 | } |
1175 | 1175 | ||
1176 | // m_log.InfoFormat("[CAPS]: TaskInventoryScriptUpdater.uploaderCaps res: {0}", res); | 1176 | // m_log.InfoFormat("[CAPS]: TaskInventoryScriptUpdater.uploaderCaps res: {0}", res); |
1177 | 1177 | ||
1178 | return res; | 1178 | return res; |
1179 | } | 1179 | } |
1180 | catch (Exception e) | 1180 | catch (Exception e) |
1181 | { | 1181 | { |
1182 | m_log.Error("[CAPS]: " + e.ToString()); | 1182 | m_log.Error("[CAPS]: " + e.ToString()); |
1183 | } | 1183 | } |
1184 | 1184 | ||
1185 | // XXX Maybe this should be some meaningful error packet | 1185 | // XXX Maybe this should be some meaningful error packet |
1186 | return null; | 1186 | return null; |
1187 | } | 1187 | } |
1188 | ///Left this in and commented in case there are unforseen issues | 1188 | ///Left this in and commented in case there are unforseen issues |
1189 | //private void SaveAssetToFile(string filename, byte[] data) | 1189 | //private void SaveAssetToFile(string filename, byte[] data) |
1190 | //{ | 1190 | //{ |
1191 | // FileStream fs = File.Create(filename); | 1191 | // FileStream fs = File.Create(filename); |
1192 | // BinaryWriter bw = new BinaryWriter(fs); | 1192 | // BinaryWriter bw = new BinaryWriter(fs); |
1193 | // bw.Write(data); | 1193 | // bw.Write(data); |
1194 | // bw.Close(); | 1194 | // bw.Close(); |
1195 | // fs.Close(); | 1195 | // fs.Close(); |
1196 | //} | 1196 | //} |
1197 | private static void SaveAssetToFile(string filename, byte[] data) | 1197 | private static void SaveAssetToFile(string filename, byte[] data) |
1198 | { | 1198 | { |
1199 | string assetPath = "UserAssets"; | 1199 | string assetPath = "UserAssets"; |
1200 | if (!Directory.Exists(assetPath)) | 1200 | if (!Directory.Exists(assetPath)) |
1201 | { | 1201 | { |
1202 | Directory.CreateDirectory(assetPath); | 1202 | Directory.CreateDirectory(assetPath); |
1203 | } | 1203 | } |
1204 | FileStream fs = File.Create(Path.Combine(assetPath, filename)); | 1204 | FileStream fs = File.Create(Path.Combine(assetPath, filename)); |
1205 | BinaryWriter bw = new BinaryWriter(fs); | 1205 | BinaryWriter bw = new BinaryWriter(fs); |
1206 | bw.Write(data); | 1206 | bw.Write(data); |
1207 | bw.Close(); | 1207 | bw.Close(); |
1208 | fs.Close(); | 1208 | fs.Close(); |
1209 | } | 1209 | } |
1210 | } | 1210 | } |
1211 | } | 1211 | } |
1212 | } | 1212 | } |
diff --git a/OpenSim/Framework/Communications/Capabilities/CapsHandlers.cs b/OpenSim/Framework/Capabilities/CapsHandlers.cs index cc44023..d977639 100644 --- a/OpenSim/Framework/Communications/Capabilities/CapsHandlers.cs +++ b/OpenSim/Framework/Capabilities/CapsHandlers.cs | |||
@@ -1,171 +1,171 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSimulator Project nor the | 12 | * * Neither the name of the OpenSimulator Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System.Collections; | 28 | using System.Collections; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using OpenSim.Framework.Servers; | 30 | using OpenSim.Framework.Servers; |
31 | using OpenSim.Framework.Servers.HttpServer; | 31 | using OpenSim.Framework.Servers.HttpServer; |
32 | 32 | ||
33 | namespace OpenSim.Framework.Communications.Capabilities | 33 | namespace OpenSim.Framework.Communications.Capabilities |
34 | { | 34 | { |
35 | /// <summary> | 35 | /// <summary> |
36 | /// CapsHandlers is a cap handler container but also takes | 36 | /// CapsHandlers is a cap handler container but also takes |
37 | /// care of adding and removing cap handlers to and from the | 37 | /// care of adding and removing cap handlers to and from the |
38 | /// supplied BaseHttpServer. | 38 | /// supplied BaseHttpServer. |
39 | /// </summary> | 39 | /// </summary> |
40 | public class CapsHandlers | 40 | public class CapsHandlers |
41 | { | 41 | { |
42 | private Dictionary <string, IRequestHandler> m_capsHandlers = new Dictionary<string, IRequestHandler>(); | 42 | private Dictionary <string, IRequestHandler> m_capsHandlers = new Dictionary<string, IRequestHandler>(); |
43 | private IHttpServer m_httpListener; | 43 | private IHttpServer m_httpListener; |
44 | private string m_httpListenerHostName; | 44 | private string m_httpListenerHostName; |
45 | private uint m_httpListenerPort; | 45 | private uint m_httpListenerPort; |
46 | private bool m_useSSL = false; | 46 | private bool m_useSSL = false; |
47 | 47 | ||
48 | /// <summary></summary> | 48 | /// <summary></summary> |
49 | /// CapsHandlers is a cap handler container but also takes | 49 | /// CapsHandlers is a cap handler container but also takes |
50 | /// care of adding and removing cap handlers to and from the | 50 | /// care of adding and removing cap handlers to and from the |
51 | /// supplied BaseHttpServer. | 51 | /// supplied BaseHttpServer. |
52 | /// </summary> | 52 | /// </summary> |
53 | /// <param name="httpListener">base HTTP server</param> | 53 | /// <param name="httpListener">base HTTP server</param> |
54 | /// <param name="httpListenerHostname">host name of the HTTP | 54 | /// <param name="httpListenerHostname">host name of the HTTP |
55 | /// server</param> | 55 | /// server</param> |
56 | /// <param name="httpListenerPort">HTTP port</param> | 56 | /// <param name="httpListenerPort">HTTP port</param> |
57 | public CapsHandlers(BaseHttpServer httpListener, string httpListenerHostname, uint httpListenerPort) | 57 | public CapsHandlers(BaseHttpServer httpListener, string httpListenerHostname, uint httpListenerPort) |
58 | : this (httpListener,httpListenerHostname,httpListenerPort, false) | 58 | : this (httpListener,httpListenerHostname,httpListenerPort, false) |
59 | { | 59 | { |
60 | } | 60 | } |
61 | 61 | ||
62 | /// <summary></summary> | 62 | /// <summary></summary> |
63 | /// CapsHandlers is a cap handler container but also takes | 63 | /// CapsHandlers is a cap handler container but also takes |
64 | /// care of adding and removing cap handlers to and from the | 64 | /// care of adding and removing cap handlers to and from the |
65 | /// supplied BaseHttpServer. | 65 | /// supplied BaseHttpServer. |
66 | /// </summary> | 66 | /// </summary> |
67 | /// <param name="httpListener">base HTTP server</param> | 67 | /// <param name="httpListener">base HTTP server</param> |
68 | /// <param name="httpListenerHostname">host name of the HTTP | 68 | /// <param name="httpListenerHostname">host name of the HTTP |
69 | /// server</param> | 69 | /// server</param> |
70 | /// <param name="httpListenerPort">HTTP port</param> | 70 | /// <param name="httpListenerPort">HTTP port</param> |
71 | public CapsHandlers(IHttpServer httpListener, string httpListenerHostname, uint httpListenerPort, bool https) | 71 | public CapsHandlers(IHttpServer httpListener, string httpListenerHostname, uint httpListenerPort, bool https) |
72 | { | 72 | { |
73 | m_httpListener = httpListener; | 73 | m_httpListener = httpListener; |
74 | m_httpListenerHostName = httpListenerHostname; | 74 | m_httpListenerHostName = httpListenerHostname; |
75 | m_httpListenerPort = httpListenerPort; | 75 | m_httpListenerPort = httpListenerPort; |
76 | m_useSSL = https; | 76 | m_useSSL = https; |
77 | if (m_useSSL) | 77 | if (m_useSSL) |
78 | { | 78 | { |
79 | m_httpListenerHostName = httpListener.SSLCommonName; | 79 | m_httpListenerHostName = httpListener.SSLCommonName; |
80 | m_httpListenerPort = httpListener.SSLPort; | 80 | m_httpListenerPort = httpListener.SSLPort; |
81 | } | 81 | } |
82 | } | 82 | } |
83 | 83 | ||
84 | /// <summary> | 84 | /// <summary> |
85 | /// Remove the cap handler for a capability. | 85 | /// Remove the cap handler for a capability. |
86 | /// </summary> | 86 | /// </summary> |
87 | /// <param name="capsName">name of the capability of the cap | 87 | /// <param name="capsName">name of the capability of the cap |
88 | /// handler to be removed</param> | 88 | /// handler to be removed</param> |
89 | public void Remove(string capsName) | 89 | public void Remove(string capsName) |
90 | { | 90 | { |
91 | // This line must be here, or caps will break! | 91 | // This line must be here, or caps will break! |
92 | m_httpListener.RemoveStreamHandler("POST", m_capsHandlers[capsName].Path); | 92 | m_httpListener.RemoveStreamHandler("POST", m_capsHandlers[capsName].Path); |
93 | m_capsHandlers.Remove(capsName); | 93 | m_capsHandlers.Remove(capsName); |
94 | } | 94 | } |
95 | 95 | ||
96 | public bool ContainsCap(string cap) | 96 | public bool ContainsCap(string cap) |
97 | { | 97 | { |
98 | return m_capsHandlers.ContainsKey(cap); | 98 | return m_capsHandlers.ContainsKey(cap); |
99 | } | 99 | } |
100 | 100 | ||
101 | /// <summary> | 101 | /// <summary> |
102 | /// The indexer allows us to treat the CapsHandlers object | 102 | /// The indexer allows us to treat the CapsHandlers object |
103 | /// in an intuitive dictionary like way. | 103 | /// in an intuitive dictionary like way. |
104 | /// </summary> | 104 | /// </summary> |
105 | /// <Remarks> | 105 | /// <Remarks> |
106 | /// The indexer will throw an exception when you try to | 106 | /// The indexer will throw an exception when you try to |
107 | /// retrieve a cap handler for a cap that is not contained in | 107 | /// retrieve a cap handler for a cap that is not contained in |
108 | /// CapsHandlers. | 108 | /// CapsHandlers. |
109 | /// </Remarks> | 109 | /// </Remarks> |
110 | public IRequestHandler this[string idx] | 110 | public IRequestHandler this[string idx] |
111 | { | 111 | { |
112 | get | 112 | get |
113 | { | 113 | { |
114 | return m_capsHandlers[idx]; | 114 | return m_capsHandlers[idx]; |
115 | } | 115 | } |
116 | 116 | ||
117 | set | 117 | set |
118 | { | 118 | { |
119 | if (m_capsHandlers.ContainsKey(idx)) | 119 | if (m_capsHandlers.ContainsKey(idx)) |
120 | { | 120 | { |
121 | m_httpListener.RemoveStreamHandler("POST", m_capsHandlers[idx].Path); | 121 | m_httpListener.RemoveStreamHandler("POST", m_capsHandlers[idx].Path); |
122 | m_capsHandlers.Remove(idx); | 122 | m_capsHandlers.Remove(idx); |
123 | } | 123 | } |
124 | 124 | ||
125 | if (null == value) return; | 125 | if (null == value) return; |
126 | 126 | ||
127 | m_capsHandlers[idx] = value; | 127 | m_capsHandlers[idx] = value; |
128 | m_httpListener.AddStreamHandler(value); | 128 | m_httpListener.AddStreamHandler(value); |
129 | } | 129 | } |
130 | } | 130 | } |
131 | 131 | ||
132 | /// <summary> | 132 | /// <summary> |
133 | /// Return the list of cap names for which this CapsHandlers | 133 | /// Return the list of cap names for which this CapsHandlers |
134 | /// object contains cap handlers. | 134 | /// object contains cap handlers. |
135 | /// </summary> | 135 | /// </summary> |
136 | public string[] Caps | 136 | public string[] Caps |
137 | { | 137 | { |
138 | get | 138 | get |
139 | { | 139 | { |
140 | string[] __keys = new string[m_capsHandlers.Keys.Count]; | 140 | string[] __keys = new string[m_capsHandlers.Keys.Count]; |
141 | m_capsHandlers.Keys.CopyTo(__keys, 0); | 141 | m_capsHandlers.Keys.CopyTo(__keys, 0); |
142 | return __keys; | 142 | return __keys; |
143 | } | 143 | } |
144 | } | 144 | } |
145 | 145 | ||
146 | /// <summary> | 146 | /// <summary> |
147 | /// Return an LLSD-serializable Hashtable describing the | 147 | /// Return an LLSD-serializable Hashtable describing the |
148 | /// capabilities and their handler details. | 148 | /// capabilities and their handler details. |
149 | /// </summary> | 149 | /// </summary> |
150 | public Hashtable CapsDetails | 150 | public Hashtable CapsDetails |
151 | { | 151 | { |
152 | get | 152 | get |
153 | { | 153 | { |
154 | Hashtable caps = new Hashtable(); | 154 | Hashtable caps = new Hashtable(); |
155 | string protocol = "http://"; | 155 | string protocol = "http://"; |
156 | 156 | ||
157 | if (m_useSSL) | 157 | if (m_useSSL) |
158 | protocol = "https://"; | 158 | protocol = "https://"; |
159 | 159 | ||
160 | string baseUrl = protocol + m_httpListenerHostName + ":" + m_httpListenerPort.ToString(); | 160 | string baseUrl = protocol + m_httpListenerHostName + ":" + m_httpListenerPort.ToString(); |
161 | foreach (string capsName in m_capsHandlers.Keys) | 161 | foreach (string capsName in m_capsHandlers.Keys) |
162 | { | 162 | { |
163 | // skip SEED cap | 163 | // skip SEED cap |
164 | if ("SEED" == capsName) continue; | 164 | if ("SEED" == capsName) continue; |
165 | caps[capsName] = baseUrl + m_capsHandlers[capsName].Path; | 165 | caps[capsName] = baseUrl + m_capsHandlers[capsName].Path; |
166 | } | 166 | } |
167 | return caps; | 167 | return caps; |
168 | } | 168 | } |
169 | } | 169 | } |
170 | } | 170 | } |
171 | } | 171 | } |
diff --git a/OpenSim/Framework/Communications/Capabilities/CapsUtil.cs b/OpenSim/Framework/Capabilities/CapsUtil.cs index a90eaa9..fb8a58e 100644 --- a/OpenSim/Framework/Communications/Capabilities/CapsUtil.cs +++ b/OpenSim/Framework/Capabilities/CapsUtil.cs | |||
@@ -1,62 +1,62 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSimulator Project nor the | 12 | * * Neither the name of the OpenSimulator Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | using OpenMetaverse; | 28 | using OpenMetaverse; |
29 | 29 | ||
30 | namespace OpenSim.Framework.Communications.Capabilities | 30 | namespace OpenSim.Framework.Communications.Capabilities |
31 | { | 31 | { |
32 | /// <summary> | 32 | /// <summary> |
33 | /// Capabilities utility methods | 33 | /// Capabilities utility methods |
34 | /// </summary> | 34 | /// </summary> |
35 | public class CapsUtil | 35 | public class CapsUtil |
36 | { | 36 | { |
37 | /// <summary> | 37 | /// <summary> |
38 | /// Generate a CAPS seed path using a previously generated CAPS object path component | 38 | /// Generate a CAPS seed path using a previously generated CAPS object path component |
39 | /// </summary> | 39 | /// </summary> |
40 | /// <param name="capsKey"></param> | 40 | /// <param name="capsKey"></param> |
41 | /// <returns></returns> | 41 | /// <returns></returns> |
42 | public static string GetCapsSeedPath(string capsObjectPath) | 42 | public static string GetCapsSeedPath(string capsObjectPath) |
43 | { | 43 | { |
44 | return "/CAPS/" + capsObjectPath + "0000/"; | 44 | return "/CAPS/" + capsObjectPath + "0000/"; |
45 | } | 45 | } |
46 | 46 | ||
47 | /// <summary> | 47 | /// <summary> |
48 | /// Get a random CAPS object path component that will be used as the identifying part of all future CAPS requests | 48 | /// Get a random CAPS object path component that will be used as the identifying part of all future CAPS requests |
49 | /// </summary> | 49 | /// </summary> |
50 | /// <returns></returns> | 50 | /// <returns></returns> |
51 | public static string GetRandomCapsObjectPath() | 51 | public static string GetRandomCapsObjectPath() |
52 | { | 52 | { |
53 | UUID caps = UUID.Random(); | 53 | UUID caps = UUID.Random(); |
54 | string capsPath = caps.ToString(); | 54 | string capsPath = caps.ToString(); |
55 | // I'm commenting this, rather than delete, to keep as historical record. | 55 | // I'm commenting this, rather than delete, to keep as historical record. |
56 | // The caps seed is now a full UUID string that gets added four more digits | 56 | // The caps seed is now a full UUID string that gets added four more digits |
57 | // for producing certain CAPs URLs in OpenSim | 57 | // for producing certain CAPs URLs in OpenSim |
58 | //capsPath = capsPath.Remove(capsPath.Length - 4, 4); | 58 | //capsPath = capsPath.Remove(capsPath.Length - 4, 4); |
59 | return capsPath; | 59 | return capsPath; |
60 | } | 60 | } |
61 | } | 61 | } |
62 | } | 62 | } |
diff --git a/OpenSim/Framework/Communications/Capabilities/LLSD.cs b/OpenSim/Framework/Capabilities/LLSD.cs index c982092..73556fc 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSD.cs +++ b/OpenSim/Framework/Capabilities/LLSD.cs | |||
@@ -1,679 +1,679 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSimulator Project nor the | 12 | * * Neither the name of the OpenSimulator Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Collections; | 29 | using System.Collections; |
30 | using System.Globalization; | 30 | using System.Globalization; |
31 | using System.IO; | 31 | using System.IO; |
32 | using System.Security.Cryptography; | 32 | using System.Security.Cryptography; |
33 | using System.Text; | 33 | using System.Text; |
34 | using System.Xml; | 34 | using System.Xml; |
35 | using OpenMetaverse; | 35 | using OpenMetaverse; |
36 | 36 | ||
37 | namespace OpenSim.Framework.Communications.Capabilities | 37 | namespace OpenSim.Framework.Communications.Capabilities |
38 | { | 38 | { |
39 | /// <summary> | 39 | /// <summary> |
40 | /// Borrowed from (a older version of) libsl for now, as their new llsd code doesn't work we our decoding code. | 40 | /// Borrowed from (a older version of) libsl for now, as their new llsd code doesn't work we our decoding code. |
41 | /// </summary> | 41 | /// </summary> |
42 | public static class LLSD | 42 | public static class LLSD |
43 | { | 43 | { |
44 | /// <summary> | 44 | /// <summary> |
45 | /// | 45 | /// |
46 | /// </summary> | 46 | /// </summary> |
47 | public class LLSDParseException : Exception | 47 | public class LLSDParseException : Exception |
48 | { | 48 | { |
49 | public LLSDParseException(string message) : base(message) | 49 | public LLSDParseException(string message) : base(message) |
50 | { | 50 | { |
51 | } | 51 | } |
52 | } | 52 | } |
53 | 53 | ||
54 | /// <summary> | 54 | /// <summary> |
55 | /// | 55 | /// |
56 | /// </summary> | 56 | /// </summary> |
57 | public class LLSDSerializeException : Exception | 57 | public class LLSDSerializeException : Exception |
58 | { | 58 | { |
59 | public LLSDSerializeException(string message) : base(message) | 59 | public LLSDSerializeException(string message) : base(message) |
60 | { | 60 | { |
61 | } | 61 | } |
62 | } | 62 | } |
63 | 63 | ||
64 | /// <summary> | 64 | /// <summary> |
65 | /// | 65 | /// |
66 | /// </summary> | 66 | /// </summary> |
67 | /// <param name="b"></param> | 67 | /// <param name="b"></param> |
68 | /// <returns></returns> | 68 | /// <returns></returns> |
69 | public static object LLSDDeserialize(byte[] b) | 69 | public static object LLSDDeserialize(byte[] b) |
70 | { | 70 | { |
71 | return LLSDDeserialize(new MemoryStream(b, false)); | 71 | return LLSDDeserialize(new MemoryStream(b, false)); |
72 | } | 72 | } |
73 | 73 | ||
74 | /// <summary> | 74 | /// <summary> |
75 | /// | 75 | /// |
76 | /// </summary> | 76 | /// </summary> |
77 | /// <param name="st"></param> | 77 | /// <param name="st"></param> |
78 | /// <returns></returns> | 78 | /// <returns></returns> |
79 | public static object LLSDDeserialize(Stream st) | 79 | public static object LLSDDeserialize(Stream st) |
80 | { | 80 | { |
81 | XmlTextReader reader = new XmlTextReader(st); | 81 | XmlTextReader reader = new XmlTextReader(st); |
82 | reader.Read(); | 82 | reader.Read(); |
83 | SkipWS(reader); | 83 | SkipWS(reader); |
84 | 84 | ||
85 | if (reader.NodeType != XmlNodeType.Element || reader.LocalName != "llsd") | 85 | if (reader.NodeType != XmlNodeType.Element || reader.LocalName != "llsd") |
86 | throw new LLSDParseException("Expected <llsd>"); | 86 | throw new LLSDParseException("Expected <llsd>"); |
87 | 87 | ||
88 | reader.Read(); | 88 | reader.Read(); |
89 | object ret = LLSDParseOne(reader); | 89 | object ret = LLSDParseOne(reader); |
90 | SkipWS(reader); | 90 | SkipWS(reader); |
91 | 91 | ||
92 | if (reader.NodeType != XmlNodeType.EndElement || reader.LocalName != "llsd") | 92 | if (reader.NodeType != XmlNodeType.EndElement || reader.LocalName != "llsd") |
93 | throw new LLSDParseException("Expected </llsd>"); | 93 | throw new LLSDParseException("Expected </llsd>"); |
94 | 94 | ||
95 | return ret; | 95 | return ret; |
96 | } | 96 | } |
97 | 97 | ||
98 | /// <summary> | 98 | /// <summary> |
99 | /// | 99 | /// |
100 | /// </summary> | 100 | /// </summary> |
101 | /// <param name="obj"></param> | 101 | /// <param name="obj"></param> |
102 | /// <returns></returns> | 102 | /// <returns></returns> |
103 | public static byte[] LLSDSerialize(object obj) | 103 | public static byte[] LLSDSerialize(object obj) |
104 | { | 104 | { |
105 | StringWriter sw = new StringWriter(); | 105 | StringWriter sw = new StringWriter(); |
106 | XmlTextWriter writer = new XmlTextWriter(sw); | 106 | XmlTextWriter writer = new XmlTextWriter(sw); |
107 | writer.Formatting = Formatting.None; | 107 | writer.Formatting = Formatting.None; |
108 | 108 | ||
109 | writer.WriteStartElement(String.Empty, "llsd", String.Empty); | 109 | writer.WriteStartElement(String.Empty, "llsd", String.Empty); |
110 | LLSDWriteOne(writer, obj); | 110 | LLSDWriteOne(writer, obj); |
111 | writer.WriteEndElement(); | 111 | writer.WriteEndElement(); |
112 | 112 | ||
113 | writer.Close(); | 113 | writer.Close(); |
114 | 114 | ||
115 | return Encoding.UTF8.GetBytes(sw.ToString()); | 115 | return Encoding.UTF8.GetBytes(sw.ToString()); |
116 | } | 116 | } |
117 | 117 | ||
118 | /// <summary> | 118 | /// <summary> |
119 | /// | 119 | /// |
120 | /// </summary> | 120 | /// </summary> |
121 | /// <param name="writer"></param> | 121 | /// <param name="writer"></param> |
122 | /// <param name="obj"></param> | 122 | /// <param name="obj"></param> |
123 | public static void LLSDWriteOne(XmlTextWriter writer, object obj) | 123 | public static void LLSDWriteOne(XmlTextWriter writer, object obj) |
124 | { | 124 | { |
125 | if (obj == null) | 125 | if (obj == null) |
126 | { | 126 | { |
127 | writer.WriteStartElement(String.Empty, "undef", String.Empty); | 127 | writer.WriteStartElement(String.Empty, "undef", String.Empty); |
128 | writer.WriteEndElement(); | 128 | writer.WriteEndElement(); |
129 | return; | 129 | return; |
130 | } | 130 | } |
131 | 131 | ||
132 | if (obj is string) | 132 | if (obj is string) |
133 | { | 133 | { |
134 | writer.WriteStartElement(String.Empty, "string", String.Empty); | 134 | writer.WriteStartElement(String.Empty, "string", String.Empty); |
135 | writer.WriteString((string) obj); | 135 | writer.WriteString((string) obj); |
136 | writer.WriteEndElement(); | 136 | writer.WriteEndElement(); |
137 | } | 137 | } |
138 | else if (obj is int) | 138 | else if (obj is int) |
139 | { | 139 | { |
140 | writer.WriteStartElement(String.Empty, "integer", String.Empty); | 140 | writer.WriteStartElement(String.Empty, "integer", String.Empty); |
141 | writer.WriteString(obj.ToString()); | 141 | writer.WriteString(obj.ToString()); |
142 | writer.WriteEndElement(); | 142 | writer.WriteEndElement(); |
143 | } | 143 | } |
144 | else if (obj is double) | 144 | else if (obj is double) |
145 | { | 145 | { |
146 | writer.WriteStartElement(String.Empty, "real", String.Empty); | 146 | writer.WriteStartElement(String.Empty, "real", String.Empty); |
147 | writer.WriteString(obj.ToString()); | 147 | writer.WriteString(obj.ToString()); |
148 | writer.WriteEndElement(); | 148 | writer.WriteEndElement(); |
149 | } | 149 | } |
150 | else if (obj is bool) | 150 | else if (obj is bool) |
151 | { | 151 | { |
152 | bool b = (bool) obj; | 152 | bool b = (bool) obj; |
153 | writer.WriteStartElement(String.Empty, "boolean", String.Empty); | 153 | writer.WriteStartElement(String.Empty, "boolean", String.Empty); |
154 | writer.WriteString(b ? "1" : "0"); | 154 | writer.WriteString(b ? "1" : "0"); |
155 | writer.WriteEndElement(); | 155 | writer.WriteEndElement(); |
156 | } | 156 | } |
157 | else if (obj is ulong) | 157 | else if (obj is ulong) |
158 | { | 158 | { |
159 | throw new Exception("ulong in LLSD is currently not implemented, fix me!"); | 159 | throw new Exception("ulong in LLSD is currently not implemented, fix me!"); |
160 | } | 160 | } |
161 | else if (obj is UUID) | 161 | else if (obj is UUID) |
162 | { | 162 | { |
163 | UUID u = (UUID) obj; | 163 | UUID u = (UUID) obj; |
164 | writer.WriteStartElement(String.Empty, "uuid", String.Empty); | 164 | writer.WriteStartElement(String.Empty, "uuid", String.Empty); |
165 | writer.WriteString(u.ToString()); | 165 | writer.WriteString(u.ToString()); |
166 | writer.WriteEndElement(); | 166 | writer.WriteEndElement(); |
167 | } | 167 | } |
168 | else if (obj is Hashtable) | 168 | else if (obj is Hashtable) |
169 | { | 169 | { |
170 | Hashtable h = obj as Hashtable; | 170 | Hashtable h = obj as Hashtable; |
171 | writer.WriteStartElement(String.Empty, "map", String.Empty); | 171 | writer.WriteStartElement(String.Empty, "map", String.Empty); |
172 | foreach (string key in h.Keys) | 172 | foreach (string key in h.Keys) |
173 | { | 173 | { |
174 | writer.WriteStartElement(String.Empty, "key", String.Empty); | 174 | writer.WriteStartElement(String.Empty, "key", String.Empty); |
175 | writer.WriteString(key); | 175 | writer.WriteString(key); |
176 | writer.WriteEndElement(); | 176 | writer.WriteEndElement(); |
177 | LLSDWriteOne(writer, h[key]); | 177 | LLSDWriteOne(writer, h[key]); |
178 | } | 178 | } |
179 | writer.WriteEndElement(); | 179 | writer.WriteEndElement(); |
180 | } | 180 | } |
181 | else if (obj is ArrayList) | 181 | else if (obj is ArrayList) |
182 | { | 182 | { |
183 | ArrayList a = obj as ArrayList; | 183 | ArrayList a = obj as ArrayList; |
184 | writer.WriteStartElement(String.Empty, "array", String.Empty); | 184 | writer.WriteStartElement(String.Empty, "array", String.Empty); |
185 | foreach (object item in a) | 185 | foreach (object item in a) |
186 | { | 186 | { |
187 | LLSDWriteOne(writer, item); | 187 | LLSDWriteOne(writer, item); |
188 | } | 188 | } |
189 | writer.WriteEndElement(); | 189 | writer.WriteEndElement(); |
190 | } | 190 | } |
191 | else if (obj is byte[]) | 191 | else if (obj is byte[]) |
192 | { | 192 | { |
193 | byte[] b = obj as byte[]; | 193 | byte[] b = obj as byte[]; |
194 | writer.WriteStartElement(String.Empty, "binary", String.Empty); | 194 | writer.WriteStartElement(String.Empty, "binary", String.Empty); |
195 | 195 | ||
196 | writer.WriteStartAttribute(String.Empty, "encoding", String.Empty); | 196 | writer.WriteStartAttribute(String.Empty, "encoding", String.Empty); |
197 | writer.WriteString("base64"); | 197 | writer.WriteString("base64"); |
198 | writer.WriteEndAttribute(); | 198 | writer.WriteEndAttribute(); |
199 | 199 | ||
200 | //// Calculate the length of the base64 output | 200 | //// Calculate the length of the base64 output |
201 | //long length = (long)(4.0d * b.Length / 3.0d); | 201 | //long length = (long)(4.0d * b.Length / 3.0d); |
202 | //if (length % 4 != 0) length += 4 - (length % 4); | 202 | //if (length % 4 != 0) length += 4 - (length % 4); |
203 | 203 | ||
204 | //// Create the char[] for base64 output and fill it | 204 | //// Create the char[] for base64 output and fill it |
205 | //char[] tmp = new char[length]; | 205 | //char[] tmp = new char[length]; |
206 | //int i = Convert.ToBase64CharArray(b, 0, b.Length, tmp, 0); | 206 | //int i = Convert.ToBase64CharArray(b, 0, b.Length, tmp, 0); |
207 | 207 | ||
208 | //writer.WriteString(new String(tmp)); | 208 | //writer.WriteString(new String(tmp)); |
209 | 209 | ||
210 | writer.WriteString(Convert.ToBase64String(b)); | 210 | writer.WriteString(Convert.ToBase64String(b)); |
211 | writer.WriteEndElement(); | 211 | writer.WriteEndElement(); |
212 | } | 212 | } |
213 | else | 213 | else |
214 | { | 214 | { |
215 | throw new LLSDSerializeException("Unknown type " + obj.GetType().Name); | 215 | throw new LLSDSerializeException("Unknown type " + obj.GetType().Name); |
216 | } | 216 | } |
217 | } | 217 | } |
218 | 218 | ||
219 | /// <summary> | 219 | /// <summary> |
220 | /// | 220 | /// |
221 | /// </summary> | 221 | /// </summary> |
222 | /// <param name="reader"></param> | 222 | /// <param name="reader"></param> |
223 | /// <returns></returns> | 223 | /// <returns></returns> |
224 | public static object LLSDParseOne(XmlTextReader reader) | 224 | public static object LLSDParseOne(XmlTextReader reader) |
225 | { | 225 | { |
226 | SkipWS(reader); | 226 | SkipWS(reader); |
227 | if (reader.NodeType != XmlNodeType.Element) | 227 | if (reader.NodeType != XmlNodeType.Element) |
228 | throw new LLSDParseException("Expected an element"); | 228 | throw new LLSDParseException("Expected an element"); |
229 | 229 | ||
230 | string dtype = reader.LocalName; | 230 | string dtype = reader.LocalName; |
231 | object ret = null; | 231 | object ret = null; |
232 | 232 | ||
233 | switch (dtype) | 233 | switch (dtype) |
234 | { | 234 | { |
235 | case "undef": | 235 | case "undef": |
236 | { | 236 | { |
237 | if (reader.IsEmptyElement) | 237 | if (reader.IsEmptyElement) |
238 | { | 238 | { |
239 | reader.Read(); | 239 | reader.Read(); |
240 | return null; | 240 | return null; |
241 | } | 241 | } |
242 | 242 | ||
243 | reader.Read(); | 243 | reader.Read(); |
244 | SkipWS(reader); | 244 | SkipWS(reader); |
245 | ret = null; | 245 | ret = null; |
246 | break; | 246 | break; |
247 | } | 247 | } |
248 | case "boolean": | 248 | case "boolean": |
249 | { | 249 | { |
250 | if (reader.IsEmptyElement) | 250 | if (reader.IsEmptyElement) |
251 | { | 251 | { |
252 | reader.Read(); | 252 | reader.Read(); |
253 | return false; | 253 | return false; |
254 | } | 254 | } |
255 | 255 | ||
256 | reader.Read(); | 256 | reader.Read(); |
257 | string s = reader.ReadString().Trim(); | 257 | string s = reader.ReadString().Trim(); |
258 | 258 | ||
259 | if (s == String.Empty || s == "false" || s == "0") | 259 | if (s == String.Empty || s == "false" || s == "0") |
260 | ret = false; | 260 | ret = false; |
261 | else if (s == "true" || s == "1") | 261 | else if (s == "true" || s == "1") |
262 | ret = true; | 262 | ret = true; |
263 | else | 263 | else |
264 | throw new LLSDParseException("Bad boolean value " + s); | 264 | throw new LLSDParseException("Bad boolean value " + s); |
265 | 265 | ||
266 | break; | 266 | break; |
267 | } | 267 | } |
268 | case "integer": | 268 | case "integer": |
269 | { | 269 | { |
270 | if (reader.IsEmptyElement) | 270 | if (reader.IsEmptyElement) |
271 | { | 271 | { |
272 | reader.Read(); | 272 | reader.Read(); |
273 | return 0; | 273 | return 0; |
274 | } | 274 | } |
275 | 275 | ||
276 | reader.Read(); | 276 | reader.Read(); |
277 | ret = Convert.ToInt32(reader.ReadString().Trim()); | 277 | ret = Convert.ToInt32(reader.ReadString().Trim()); |
278 | break; | 278 | break; |
279 | } | 279 | } |
280 | case "real": | 280 | case "real": |
281 | { | 281 | { |
282 | if (reader.IsEmptyElement) | 282 | if (reader.IsEmptyElement) |
283 | { | 283 | { |
284 | reader.Read(); | 284 | reader.Read(); |
285 | return 0.0f; | 285 | return 0.0f; |
286 | } | 286 | } |
287 | 287 | ||
288 | reader.Read(); | 288 | reader.Read(); |
289 | ret = Convert.ToDouble(reader.ReadString().Trim()); | 289 | ret = Convert.ToDouble(reader.ReadString().Trim()); |
290 | break; | 290 | break; |
291 | } | 291 | } |
292 | case "uuid": | 292 | case "uuid": |
293 | { | 293 | { |
294 | if (reader.IsEmptyElement) | 294 | if (reader.IsEmptyElement) |
295 | { | 295 | { |
296 | reader.Read(); | 296 | reader.Read(); |
297 | return UUID.Zero; | 297 | return UUID.Zero; |
298 | } | 298 | } |
299 | 299 | ||
300 | reader.Read(); | 300 | reader.Read(); |
301 | ret = new UUID(reader.ReadString().Trim()); | 301 | ret = new UUID(reader.ReadString().Trim()); |
302 | break; | 302 | break; |
303 | } | 303 | } |
304 | case "string": | 304 | case "string": |
305 | { | 305 | { |
306 | if (reader.IsEmptyElement) | 306 | if (reader.IsEmptyElement) |
307 | { | 307 | { |
308 | reader.Read(); | 308 | reader.Read(); |
309 | return String.Empty; | 309 | return String.Empty; |
310 | } | 310 | } |
311 | 311 | ||
312 | reader.Read(); | 312 | reader.Read(); |
313 | ret = reader.ReadString(); | 313 | ret = reader.ReadString(); |
314 | break; | 314 | break; |
315 | } | 315 | } |
316 | case "binary": | 316 | case "binary": |
317 | { | 317 | { |
318 | if (reader.IsEmptyElement) | 318 | if (reader.IsEmptyElement) |
319 | { | 319 | { |
320 | reader.Read(); | 320 | reader.Read(); |
321 | return new byte[0]; | 321 | return new byte[0]; |
322 | } | 322 | } |
323 | 323 | ||
324 | if (reader.GetAttribute("encoding") != null && | 324 | if (reader.GetAttribute("encoding") != null && |
325 | reader.GetAttribute("encoding") != "base64") | 325 | reader.GetAttribute("encoding") != "base64") |
326 | { | 326 | { |
327 | throw new LLSDParseException("Unknown encoding: " + reader.GetAttribute("encoding")); | 327 | throw new LLSDParseException("Unknown encoding: " + reader.GetAttribute("encoding")); |
328 | } | 328 | } |
329 | 329 | ||
330 | reader.Read(); | 330 | reader.Read(); |
331 | FromBase64Transform b64 = new FromBase64Transform(FromBase64TransformMode.IgnoreWhiteSpaces); | 331 | FromBase64Transform b64 = new FromBase64Transform(FromBase64TransformMode.IgnoreWhiteSpaces); |
332 | byte[] inp = Encoding.UTF8.GetBytes(reader.ReadString()); | 332 | byte[] inp = Encoding.UTF8.GetBytes(reader.ReadString()); |
333 | ret = b64.TransformFinalBlock(inp, 0, inp.Length); | 333 | ret = b64.TransformFinalBlock(inp, 0, inp.Length); |
334 | break; | 334 | break; |
335 | } | 335 | } |
336 | case "date": | 336 | case "date": |
337 | { | 337 | { |
338 | reader.Read(); | 338 | reader.Read(); |
339 | throw new Exception("LLSD TODO: date"); | 339 | throw new Exception("LLSD TODO: date"); |
340 | } | 340 | } |
341 | case "map": | 341 | case "map": |
342 | { | 342 | { |
343 | return LLSDParseMap(reader); | 343 | return LLSDParseMap(reader); |
344 | } | 344 | } |
345 | case "array": | 345 | case "array": |
346 | { | 346 | { |
347 | return LLSDParseArray(reader); | 347 | return LLSDParseArray(reader); |
348 | } | 348 | } |
349 | default: | 349 | default: |
350 | throw new LLSDParseException("Unknown element <" + dtype + ">"); | 350 | throw new LLSDParseException("Unknown element <" + dtype + ">"); |
351 | } | 351 | } |
352 | 352 | ||
353 | if (reader.NodeType != XmlNodeType.EndElement || reader.LocalName != dtype) | 353 | if (reader.NodeType != XmlNodeType.EndElement || reader.LocalName != dtype) |
354 | { | 354 | { |
355 | throw new LLSDParseException("Expected </" + dtype + ">"); | 355 | throw new LLSDParseException("Expected </" + dtype + ">"); |
356 | } | 356 | } |
357 | 357 | ||
358 | reader.Read(); | 358 | reader.Read(); |
359 | return ret; | 359 | return ret; |
360 | } | 360 | } |
361 | 361 | ||
362 | /// <summary> | 362 | /// <summary> |
363 | /// | 363 | /// |
364 | /// </summary> | 364 | /// </summary> |
365 | /// <param name="reader"></param> | 365 | /// <param name="reader"></param> |
366 | /// <returns></returns> | 366 | /// <returns></returns> |
367 | public static Hashtable LLSDParseMap(XmlTextReader reader) | 367 | public static Hashtable LLSDParseMap(XmlTextReader reader) |
368 | { | 368 | { |
369 | Hashtable ret = new Hashtable(); | 369 | Hashtable ret = new Hashtable(); |
370 | 370 | ||
371 | if (reader.NodeType != XmlNodeType.Element || reader.LocalName != "map") | 371 | if (reader.NodeType != XmlNodeType.Element || reader.LocalName != "map") |
372 | throw new LLSDParseException("Expected <map>"); | 372 | throw new LLSDParseException("Expected <map>"); |
373 | 373 | ||
374 | if (reader.IsEmptyElement) | 374 | if (reader.IsEmptyElement) |
375 | { | 375 | { |
376 | reader.Read(); | 376 | reader.Read(); |
377 | return ret; | 377 | return ret; |
378 | } | 378 | } |
379 | 379 | ||
380 | reader.Read(); | 380 | reader.Read(); |
381 | 381 | ||
382 | while (true) | 382 | while (true) |
383 | { | 383 | { |
384 | SkipWS(reader); | 384 | SkipWS(reader); |
385 | if (reader.NodeType == XmlNodeType.EndElement && reader.LocalName == "map") | 385 | if (reader.NodeType == XmlNodeType.EndElement && reader.LocalName == "map") |
386 | { | 386 | { |
387 | reader.Read(); | 387 | reader.Read(); |
388 | break; | 388 | break; |
389 | } | 389 | } |
390 | 390 | ||
391 | if (reader.NodeType != XmlNodeType.Element || reader.LocalName != "key") | 391 | if (reader.NodeType != XmlNodeType.Element || reader.LocalName != "key") |
392 | throw new LLSDParseException("Expected <key>"); | 392 | throw new LLSDParseException("Expected <key>"); |
393 | 393 | ||
394 | string key = reader.ReadString(); | 394 | string key = reader.ReadString(); |
395 | 395 | ||
396 | if (reader.NodeType != XmlNodeType.EndElement || reader.LocalName != "key") | 396 | if (reader.NodeType != XmlNodeType.EndElement || reader.LocalName != "key") |
397 | throw new LLSDParseException("Expected </key>"); | 397 | throw new LLSDParseException("Expected </key>"); |
398 | 398 | ||
399 | reader.Read(); | 399 | reader.Read(); |
400 | object val = LLSDParseOne(reader); | 400 | object val = LLSDParseOne(reader); |
401 | ret[key] = val; | 401 | ret[key] = val; |
402 | } | 402 | } |
403 | 403 | ||
404 | return ret; // TODO | 404 | return ret; // TODO |
405 | } | 405 | } |
406 | 406 | ||
407 | /// <summary> | 407 | /// <summary> |
408 | /// | 408 | /// |
409 | /// </summary> | 409 | /// </summary> |
410 | /// <param name="reader"></param> | 410 | /// <param name="reader"></param> |
411 | /// <returns></returns> | 411 | /// <returns></returns> |
412 | public static ArrayList LLSDParseArray(XmlTextReader reader) | 412 | public static ArrayList LLSDParseArray(XmlTextReader reader) |
413 | { | 413 | { |
414 | ArrayList ret = new ArrayList(); | 414 | ArrayList ret = new ArrayList(); |
415 | 415 | ||
416 | if (reader.NodeType != XmlNodeType.Element || reader.LocalName != "array") | 416 | if (reader.NodeType != XmlNodeType.Element || reader.LocalName != "array") |
417 | throw new LLSDParseException("Expected <array>"); | 417 | throw new LLSDParseException("Expected <array>"); |
418 | 418 | ||
419 | if (reader.IsEmptyElement) | 419 | if (reader.IsEmptyElement) |
420 | { | 420 | { |
421 | reader.Read(); | 421 | reader.Read(); |
422 | return ret; | 422 | return ret; |
423 | } | 423 | } |
424 | 424 | ||
425 | reader.Read(); | 425 | reader.Read(); |
426 | 426 | ||
427 | while (true) | 427 | while (true) |
428 | { | 428 | { |
429 | SkipWS(reader); | 429 | SkipWS(reader); |
430 | 430 | ||
431 | if (reader.NodeType == XmlNodeType.EndElement && reader.LocalName == "array") | 431 | if (reader.NodeType == XmlNodeType.EndElement && reader.LocalName == "array") |
432 | { | 432 | { |
433 | reader.Read(); | 433 | reader.Read(); |
434 | break; | 434 | break; |
435 | } | 435 | } |
436 | 436 | ||
437 | ret.Insert(ret.Count, LLSDParseOne(reader)); | 437 | ret.Insert(ret.Count, LLSDParseOne(reader)); |
438 | } | 438 | } |
439 | 439 | ||
440 | return ret; // TODO | 440 | return ret; // TODO |
441 | } | 441 | } |
442 | 442 | ||
443 | /// <summary> | 443 | /// <summary> |
444 | /// | 444 | /// |
445 | /// </summary> | 445 | /// </summary> |
446 | /// <param name="count"></param> | 446 | /// <param name="count"></param> |
447 | /// <returns></returns> | 447 | /// <returns></returns> |
448 | private static string GetSpaces(int count) | 448 | private static string GetSpaces(int count) |
449 | { | 449 | { |
450 | StringBuilder b = new StringBuilder(); | 450 | StringBuilder b = new StringBuilder(); |
451 | for (int i = 0; i < count; i++) b.Append(" "); | 451 | for (int i = 0; i < count; i++) b.Append(" "); |
452 | return b.ToString(); | 452 | return b.ToString(); |
453 | } | 453 | } |
454 | 454 | ||
455 | /// <summary> | 455 | /// <summary> |
456 | /// | 456 | /// |
457 | /// </summary> | 457 | /// </summary> |
458 | /// <param name="obj"></param> | 458 | /// <param name="obj"></param> |
459 | /// <param name="indent"></param> | 459 | /// <param name="indent"></param> |
460 | /// <returns></returns> | 460 | /// <returns></returns> |
461 | public static String LLSDDump(object obj, int indent) | 461 | public static String LLSDDump(object obj, int indent) |
462 | { | 462 | { |
463 | if (obj == null) | 463 | if (obj == null) |
464 | { | 464 | { |
465 | return GetSpaces(indent) + "- undef\n"; | 465 | return GetSpaces(indent) + "- undef\n"; |
466 | } | 466 | } |
467 | else if (obj is string) | 467 | else if (obj is string) |
468 | { | 468 | { |
469 | return GetSpaces(indent) + "- string \"" + (string) obj + "\"\n"; | 469 | return GetSpaces(indent) + "- string \"" + (string) obj + "\"\n"; |
470 | } | 470 | } |
471 | else if (obj is int) | 471 | else if (obj is int) |
472 | { | 472 | { |
473 | return GetSpaces(indent) + "- integer " + obj.ToString() + "\n"; | 473 | return GetSpaces(indent) + "- integer " + obj.ToString() + "\n"; |
474 | } | 474 | } |
475 | else if (obj is double) | 475 | else if (obj is double) |
476 | { | 476 | { |
477 | return GetSpaces(indent) + "- float " + obj.ToString() + "\n"; | 477 | return GetSpaces(indent) + "- float " + obj.ToString() + "\n"; |
478 | } | 478 | } |
479 | else if (obj is UUID) | 479 | else if (obj is UUID) |
480 | { | 480 | { |
481 | return GetSpaces(indent) + "- uuid " + ((UUID) obj).ToString() + Environment.NewLine; | 481 | return GetSpaces(indent) + "- uuid " + ((UUID) obj).ToString() + Environment.NewLine; |
482 | } | 482 | } |
483 | else if (obj is Hashtable) | 483 | else if (obj is Hashtable) |
484 | { | 484 | { |
485 | StringBuilder ret = new StringBuilder(); | 485 | StringBuilder ret = new StringBuilder(); |
486 | ret.Append(GetSpaces(indent) + "- map" + Environment.NewLine); | 486 | ret.Append(GetSpaces(indent) + "- map" + Environment.NewLine); |
487 | Hashtable map = (Hashtable) obj; | 487 | Hashtable map = (Hashtable) obj; |
488 | 488 | ||
489 | foreach (string key in map.Keys) | 489 | foreach (string key in map.Keys) |
490 | { | 490 | { |
491 | ret.Append(GetSpaces(indent + 2) + "- key \"" + key + "\"" + Environment.NewLine); | 491 | ret.Append(GetSpaces(indent + 2) + "- key \"" + key + "\"" + Environment.NewLine); |
492 | ret.Append(LLSDDump(map[key], indent + 3)); | 492 | ret.Append(LLSDDump(map[key], indent + 3)); |
493 | } | 493 | } |
494 | 494 | ||
495 | return ret.ToString(); | 495 | return ret.ToString(); |
496 | } | 496 | } |
497 | else if (obj is ArrayList) | 497 | else if (obj is ArrayList) |
498 | { | 498 | { |
499 | StringBuilder ret = new StringBuilder(); | 499 | StringBuilder ret = new StringBuilder(); |
500 | ret.Append(GetSpaces(indent) + "- array\n"); | 500 | ret.Append(GetSpaces(indent) + "- array\n"); |
501 | ArrayList list = (ArrayList) obj; | 501 | ArrayList list = (ArrayList) obj; |
502 | 502 | ||
503 | foreach (object item in list) | 503 | foreach (object item in list) |
504 | { | 504 | { |
505 | ret.Append(LLSDDump(item, indent + 2)); | 505 | ret.Append(LLSDDump(item, indent + 2)); |
506 | } | 506 | } |
507 | 507 | ||
508 | return ret.ToString(); | 508 | return ret.ToString(); |
509 | } | 509 | } |
510 | else if (obj is byte[]) | 510 | else if (obj is byte[]) |
511 | { | 511 | { |
512 | return GetSpaces(indent) + "- binary\n" + Utils.BytesToHexString((byte[]) obj, GetSpaces(indent)) + | 512 | return GetSpaces(indent) + "- binary\n" + Utils.BytesToHexString((byte[]) obj, GetSpaces(indent)) + |
513 | Environment.NewLine; | 513 | Environment.NewLine; |
514 | } | 514 | } |
515 | else | 515 | else |
516 | { | 516 | { |
517 | return GetSpaces(indent) + "- unknown type " + obj.GetType().Name + Environment.NewLine; | 517 | return GetSpaces(indent) + "- unknown type " + obj.GetType().Name + Environment.NewLine; |
518 | } | 518 | } |
519 | } | 519 | } |
520 | 520 | ||
521 | public static object ParseTerseLLSD(string llsd) | 521 | public static object ParseTerseLLSD(string llsd) |
522 | { | 522 | { |
523 | int notused; | 523 | int notused; |
524 | return ParseTerseLLSD(llsd, out notused); | 524 | return ParseTerseLLSD(llsd, out notused); |
525 | } | 525 | } |
526 | 526 | ||
527 | public static object ParseTerseLLSD(string llsd, out int endPos) | 527 | public static object ParseTerseLLSD(string llsd, out int endPos) |
528 | { | 528 | { |
529 | if (llsd.Length == 0) | 529 | if (llsd.Length == 0) |
530 | { | 530 | { |
531 | endPos = 0; | 531 | endPos = 0; |
532 | return null; | 532 | return null; |
533 | } | 533 | } |
534 | 534 | ||
535 | // Identify what type of object this is | 535 | // Identify what type of object this is |
536 | switch (llsd[0]) | 536 | switch (llsd[0]) |
537 | { | 537 | { |
538 | case '!': | 538 | case '!': |
539 | throw new LLSDParseException("Undefined value type encountered"); | 539 | throw new LLSDParseException("Undefined value type encountered"); |
540 | case '1': | 540 | case '1': |
541 | endPos = 1; | 541 | endPos = 1; |
542 | return true; | 542 | return true; |
543 | case '0': | 543 | case '0': |
544 | endPos = 1; | 544 | endPos = 1; |
545 | return false; | 545 | return false; |
546 | case 'i': | 546 | case 'i': |
547 | { | 547 | { |
548 | if (llsd.Length < 2) throw new LLSDParseException("Integer value type with no value"); | 548 | if (llsd.Length < 2) throw new LLSDParseException("Integer value type with no value"); |
549 | int value; | 549 | int value; |
550 | endPos = FindEnd(llsd, 1); | 550 | endPos = FindEnd(llsd, 1); |
551 | 551 | ||
552 | if (Int32.TryParse(llsd.Substring(1, endPos - 1), out value)) | 552 | if (Int32.TryParse(llsd.Substring(1, endPos - 1), out value)) |
553 | return value; | 553 | return value; |
554 | else | 554 | else |
555 | throw new LLSDParseException("Failed to parse integer value type"); | 555 | throw new LLSDParseException("Failed to parse integer value type"); |
556 | } | 556 | } |
557 | case 'r': | 557 | case 'r': |
558 | { | 558 | { |
559 | if (llsd.Length < 2) throw new LLSDParseException("Real value type with no value"); | 559 | if (llsd.Length < 2) throw new LLSDParseException("Real value type with no value"); |
560 | double value; | 560 | double value; |
561 | endPos = FindEnd(llsd, 1); | 561 | endPos = FindEnd(llsd, 1); |
562 | 562 | ||
563 | if (Double.TryParse(llsd.Substring(1, endPos - 1), NumberStyles.Float, | 563 | if (Double.TryParse(llsd.Substring(1, endPos - 1), NumberStyles.Float, |
564 | Utils.EnUsCulture.NumberFormat, out value)) | 564 | Utils.EnUsCulture.NumberFormat, out value)) |
565 | return value; | 565 | return value; |
566 | else | 566 | else |
567 | throw new LLSDParseException("Failed to parse double value type"); | 567 | throw new LLSDParseException("Failed to parse double value type"); |
568 | } | 568 | } |
569 | case 'u': | 569 | case 'u': |
570 | { | 570 | { |
571 | if (llsd.Length < 17) throw new LLSDParseException("UUID value type with no value"); | 571 | if (llsd.Length < 17) throw new LLSDParseException("UUID value type with no value"); |
572 | UUID value; | 572 | UUID value; |
573 | endPos = FindEnd(llsd, 1); | 573 | endPos = FindEnd(llsd, 1); |
574 | 574 | ||
575 | if (UUID.TryParse(llsd.Substring(1, endPos - 1), out value)) | 575 | if (UUID.TryParse(llsd.Substring(1, endPos - 1), out value)) |
576 | return value; | 576 | return value; |
577 | else | 577 | else |
578 | throw new LLSDParseException("Failed to parse UUID value type"); | 578 | throw new LLSDParseException("Failed to parse UUID value type"); |
579 | } | 579 | } |
580 | case 'b': | 580 | case 'b': |
581 | //byte[] value = new byte[llsd.Length - 1]; | 581 | //byte[] value = new byte[llsd.Length - 1]; |
582 | // This isn't the actual binary LLSD format, just the terse format sent | 582 | // This isn't the actual binary LLSD format, just the terse format sent |
583 | // at login so I don't even know if there is a binary type | 583 | // at login so I don't even know if there is a binary type |
584 | throw new LLSDParseException("Binary value type is unimplemented"); | 584 | throw new LLSDParseException("Binary value type is unimplemented"); |
585 | case 's': | 585 | case 's': |
586 | case 'l': | 586 | case 'l': |
587 | if (llsd.Length < 2) throw new LLSDParseException("String value type with no value"); | 587 | if (llsd.Length < 2) throw new LLSDParseException("String value type with no value"); |
588 | endPos = FindEnd(llsd, 1); | 588 | endPos = FindEnd(llsd, 1); |
589 | return llsd.Substring(1, endPos - 1); | 589 | return llsd.Substring(1, endPos - 1); |
590 | case 'd': | 590 | case 'd': |
591 | // Never seen one before, don't know what the format is | 591 | // Never seen one before, don't know what the format is |
592 | throw new LLSDParseException("Date value type is unimplemented"); | 592 | throw new LLSDParseException("Date value type is unimplemented"); |
593 | case '[': | 593 | case '[': |
594 | { | 594 | { |
595 | if (llsd.IndexOf(']') == -1) throw new LLSDParseException("Invalid array"); | 595 | if (llsd.IndexOf(']') == -1) throw new LLSDParseException("Invalid array"); |
596 | 596 | ||
597 | int pos = 0; | 597 | int pos = 0; |
598 | ArrayList array = new ArrayList(); | 598 | ArrayList array = new ArrayList(); |
599 | 599 | ||
600 | while (llsd[pos] != ']') | 600 | while (llsd[pos] != ']') |
601 | { | 601 | { |
602 | ++pos; | 602 | ++pos; |
603 | 603 | ||
604 | // Advance past comma if need be | 604 | // Advance past comma if need be |
605 | if (llsd[pos] == ',') ++pos; | 605 | if (llsd[pos] == ',') ++pos; |
606 | 606 | ||
607 | // Allow a single whitespace character | 607 | // Allow a single whitespace character |
608 | if (pos < llsd.Length && llsd[pos] == ' ') ++pos; | 608 | if (pos < llsd.Length && llsd[pos] == ' ') ++pos; |
609 | 609 | ||
610 | int end; | 610 | int end; |
611 | array.Add(ParseTerseLLSD(llsd.Substring(pos), out end)); | 611 | array.Add(ParseTerseLLSD(llsd.Substring(pos), out end)); |
612 | pos += end; | 612 | pos += end; |
613 | } | 613 | } |
614 | 614 | ||
615 | endPos = pos + 1; | 615 | endPos = pos + 1; |
616 | return array; | 616 | return array; |
617 | } | 617 | } |
618 | case '{': | 618 | case '{': |
619 | { | 619 | { |
620 | if (llsd.IndexOf('}') == -1) throw new LLSDParseException("Invalid map"); | 620 | if (llsd.IndexOf('}') == -1) throw new LLSDParseException("Invalid map"); |
621 | 621 | ||
622 | int pos = 0; | 622 | int pos = 0; |
623 | Hashtable hashtable = new Hashtable(); | 623 | Hashtable hashtable = new Hashtable(); |
624 | 624 | ||
625 | while (llsd[pos] != '}') | 625 | while (llsd[pos] != '}') |
626 | { | 626 | { |
627 | ++pos; | 627 | ++pos; |
628 | 628 | ||
629 | // Advance past comma if need be | 629 | // Advance past comma if need be |
630 | if (llsd[pos] == ',') ++pos; | 630 | if (llsd[pos] == ',') ++pos; |
631 | 631 | ||
632 | // Allow a single whitespace character | 632 | // Allow a single whitespace character |
633 | if (pos < llsd.Length && llsd[pos] == ' ') ++pos; | 633 | if (pos < llsd.Length && llsd[pos] == ' ') ++pos; |
634 | 634 | ||
635 | if (llsd[pos] != '\'') throw new LLSDParseException("Expected a map key"); | 635 | if (llsd[pos] != '\'') throw new LLSDParseException("Expected a map key"); |
636 | int endquote = llsd.IndexOf('\'', pos + 1); | 636 | int endquote = llsd.IndexOf('\'', pos + 1); |
637 | if (endquote == -1 || (endquote + 1) >= llsd.Length || llsd[endquote + 1] != ':') | 637 | if (endquote == -1 || (endquote + 1) >= llsd.Length || llsd[endquote + 1] != ':') |
638 | throw new LLSDParseException("Invalid map format"); | 638 | throw new LLSDParseException("Invalid map format"); |
639 | string key = llsd.Substring(pos, endquote - pos); | 639 | string key = llsd.Substring(pos, endquote - pos); |
640 | key = key.Replace("'", String.Empty); | 640 | key = key.Replace("'", String.Empty); |
641 | pos += (endquote - pos) + 2; | 641 | pos += (endquote - pos) + 2; |
642 | 642 | ||
643 | int end; | 643 | int end; |
644 | hashtable.Add(key, ParseTerseLLSD(llsd.Substring(pos), out end)); | 644 | hashtable.Add(key, ParseTerseLLSD(llsd.Substring(pos), out end)); |
645 | pos += end; | 645 | pos += end; |
646 | } | 646 | } |
647 | 647 | ||
648 | endPos = pos + 1; | 648 | endPos = pos + 1; |
649 | return hashtable; | 649 | return hashtable; |
650 | } | 650 | } |
651 | default: | 651 | default: |
652 | throw new Exception("Unknown value type"); | 652 | throw new Exception("Unknown value type"); |
653 | } | 653 | } |
654 | } | 654 | } |
655 | 655 | ||
656 | private static int FindEnd(string llsd, int start) | 656 | private static int FindEnd(string llsd, int start) |
657 | { | 657 | { |
658 | int end = llsd.IndexOfAny(new char[] {',', ']', '}'}); | 658 | int end = llsd.IndexOfAny(new char[] {',', ']', '}'}); |
659 | if (end == -1) end = llsd.Length - 1; | 659 | if (end == -1) end = llsd.Length - 1; |
660 | return end; | 660 | return end; |
661 | } | 661 | } |
662 | 662 | ||
663 | /// <summary> | 663 | /// <summary> |
664 | /// | 664 | /// |
665 | /// </summary> | 665 | /// </summary> |
666 | /// <param name="reader"></param> | 666 | /// <param name="reader"></param> |
667 | private static void SkipWS(XmlTextReader reader) | 667 | private static void SkipWS(XmlTextReader reader) |
668 | { | 668 | { |
669 | while ( | 669 | while ( |
670 | reader.NodeType == XmlNodeType.Comment || | 670 | reader.NodeType == XmlNodeType.Comment || |
671 | reader.NodeType == XmlNodeType.Whitespace || | 671 | reader.NodeType == XmlNodeType.Whitespace || |
672 | reader.NodeType == XmlNodeType.SignificantWhitespace || | 672 | reader.NodeType == XmlNodeType.SignificantWhitespace || |
673 | reader.NodeType == XmlNodeType.XmlDeclaration) | 673 | reader.NodeType == XmlNodeType.XmlDeclaration) |
674 | { | 674 | { |
675 | reader.Read(); | 675 | reader.Read(); |
676 | } | 676 | } |
677 | } | 677 | } |
678 | } | 678 | } |
679 | } | 679 | } |
diff --git a/OpenSim/Framework/Communications/Capabilities/LLSDArray.cs b/OpenSim/Framework/Capabilities/LLSDArray.cs index 40e588f..b24e029 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDArray.cs +++ b/OpenSim/Framework/Capabilities/LLSDArray.cs | |||
@@ -1,41 +1,41 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSimulator Project nor the | 12 | * * Neither the name of the OpenSimulator Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System.Collections; | 28 | using System.Collections; |
29 | 29 | ||
30 | namespace OpenSim.Framework.Communications.Capabilities | 30 | namespace OpenSim.Framework.Communications.Capabilities |
31 | { | 31 | { |
32 | [LLSDType("ARRAY")] | 32 | [LLSDType("ARRAY")] |
33 | public class OSDArray | 33 | public class OSDArray |
34 | { | 34 | { |
35 | public ArrayList Array = new ArrayList(); | 35 | public ArrayList Array = new ArrayList(); |
36 | 36 | ||
37 | public OSDArray() | 37 | public OSDArray() |
38 | { | 38 | { |
39 | } | 39 | } |
40 | } | 40 | } |
41 | } \ No newline at end of file | 41 | } \ No newline at end of file |
diff --git a/OpenSim/Framework/Communications/Capabilities/LLSDAssetUploadComplete.cs b/OpenSim/Framework/Capabilities/LLSDAssetUploadComplete.cs index 3a31523..dd54fa9 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDAssetUploadComplete.cs +++ b/OpenSim/Framework/Capabilities/LLSDAssetUploadComplete.cs | |||
@@ -1,45 +1,45 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSimulator Project nor the | 12 | * * Neither the name of the OpenSimulator Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using OpenMetaverse; | 29 | using OpenMetaverse; |
30 | 30 | ||
31 | namespace OpenSim.Framework.Communications.Capabilities | 31 | namespace OpenSim.Framework.Communications.Capabilities |
32 | { | 32 | { |
33 | [LLSDType("MAP")] | 33 | [LLSDType("MAP")] |
34 | public class LLSDAssetUploadComplete | 34 | public class LLSDAssetUploadComplete |
35 | { | 35 | { |
36 | public string new_asset = String.Empty; | 36 | public string new_asset = String.Empty; |
37 | public UUID new_inventory_item = UUID.Zero; | 37 | public UUID new_inventory_item = UUID.Zero; |
38 | public string state = String.Empty; | 38 | public string state = String.Empty; |
39 | //public bool success = false; | 39 | //public bool success = false; |
40 | 40 | ||
41 | public LLSDAssetUploadComplete() | 41 | public LLSDAssetUploadComplete() |
42 | { | 42 | { |
43 | } | 43 | } |
44 | } | 44 | } |
45 | } | 45 | } |
diff --git a/OpenSim/Framework/Communications/Capabilities/LLSDAssetUploadRequest.cs b/OpenSim/Framework/Capabilities/LLSDAssetUploadRequest.cs index 45c0afb..883f512 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDAssetUploadRequest.cs +++ b/OpenSim/Framework/Capabilities/LLSDAssetUploadRequest.cs | |||
@@ -1,46 +1,46 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSimulator Project nor the | 12 | * * Neither the name of the OpenSimulator Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using OpenMetaverse; | 29 | using OpenMetaverse; |
30 | 30 | ||
31 | namespace OpenSim.Framework.Communications.Capabilities | 31 | namespace OpenSim.Framework.Communications.Capabilities |
32 | { | 32 | { |
33 | [OSDMap] | 33 | [OSDMap] |
34 | public class LLSDAssetUploadRequest | 34 | public class LLSDAssetUploadRequest |
35 | { | 35 | { |
36 | public string asset_type = String.Empty; | 36 | public string asset_type = String.Empty; |
37 | public string description = String.Empty; | 37 | public string description = String.Empty; |
38 | public UUID folder_id = UUID.Zero; | 38 | public UUID folder_id = UUID.Zero; |
39 | public string inventory_type = String.Empty; | 39 | public string inventory_type = String.Empty; |
40 | public string name = String.Empty; | 40 | public string name = String.Empty; |
41 | 41 | ||
42 | public LLSDAssetUploadRequest() | 42 | public LLSDAssetUploadRequest() |
43 | { | 43 | { |
44 | } | 44 | } |
45 | } | 45 | } |
46 | } | 46 | } |
diff --git a/OpenSim/Framework/Communications/Capabilities/LLSDAssetUploadResponse.cs b/OpenSim/Framework/Capabilities/LLSDAssetUploadResponse.cs index 36adb93..e4cd9d2 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDAssetUploadResponse.cs +++ b/OpenSim/Framework/Capabilities/LLSDAssetUploadResponse.cs | |||
@@ -1,42 +1,42 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSimulator Project nor the | 12 | * * Neither the name of the OpenSimulator Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | 29 | ||
30 | namespace OpenSim.Framework.Communications.Capabilities | 30 | namespace OpenSim.Framework.Communications.Capabilities |
31 | { | 31 | { |
32 | [OSDMap] | 32 | [OSDMap] |
33 | public class LLSDAssetUploadResponse | 33 | public class LLSDAssetUploadResponse |
34 | { | 34 | { |
35 | public string uploader = String.Empty; | 35 | public string uploader = String.Empty; |
36 | public string state = String.Empty; | 36 | public string state = String.Empty; |
37 | 37 | ||
38 | public LLSDAssetUploadResponse() | 38 | public LLSDAssetUploadResponse() |
39 | { | 39 | { |
40 | } | 40 | } |
41 | } | 41 | } |
42 | } \ No newline at end of file | 42 | } \ No newline at end of file |
diff --git a/OpenSim/Framework/Communications/Capabilities/LLSDCapEvent.cs b/OpenSim/Framework/Capabilities/LLSDCapEvent.cs index 8e5c197..c91e570 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDCapEvent.cs +++ b/OpenSim/Framework/Capabilities/LLSDCapEvent.cs | |||
@@ -1,40 +1,40 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSimulator Project nor the | 12 | * * Neither the name of the OpenSimulator Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | namespace OpenSim.Framework.Communications.Capabilities | 28 | namespace OpenSim.Framework.Communications.Capabilities |
29 | { | 29 | { |
30 | [LLSDType("MAP")] | 30 | [LLSDType("MAP")] |
31 | public class LLSDCapEvent | 31 | public class LLSDCapEvent |
32 | { | 32 | { |
33 | public int id = 0; | 33 | public int id = 0; |
34 | public OSDArray events = new OSDArray(); | 34 | public OSDArray events = new OSDArray(); |
35 | 35 | ||
36 | public LLSDCapEvent() | 36 | public LLSDCapEvent() |
37 | { | 37 | { |
38 | } | 38 | } |
39 | } | 39 | } |
40 | } \ No newline at end of file | 40 | } \ No newline at end of file |
diff --git a/OpenSim/Framework/Communications/Capabilities/LLSDEmpty.cs b/OpenSim/Framework/Capabilities/LLSDEmpty.cs index d49ee1a..1c7c25d 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDEmpty.cs +++ b/OpenSim/Framework/Capabilities/LLSDEmpty.cs | |||
@@ -1,37 +1,37 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSimulator Project nor the | 12 | * * Neither the name of the OpenSimulator Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | namespace OpenSim.Framework.Communications.Capabilities | 28 | namespace OpenSim.Framework.Communications.Capabilities |
29 | { | 29 | { |
30 | [LLSDType("MAP")] | 30 | [LLSDType("MAP")] |
31 | public class LLSDEmpty | 31 | public class LLSDEmpty |
32 | { | 32 | { |
33 | public LLSDEmpty() | 33 | public LLSDEmpty() |
34 | { | 34 | { |
35 | } | 35 | } |
36 | } | 36 | } |
37 | } \ No newline at end of file | 37 | } \ No newline at end of file |
diff --git a/OpenSim/Framework/Communications/Capabilities/LLSDHelpers.cs b/OpenSim/Framework/Capabilities/LLSDHelpers.cs index 3316b3f..596dfc3 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDHelpers.cs +++ b/OpenSim/Framework/Capabilities/LLSDHelpers.cs | |||
@@ -1,172 +1,172 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSimulator Project nor the | 12 | * * Neither the name of the OpenSimulator Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Collections; | 29 | using System.Collections; |
30 | using System.IO; | 30 | using System.IO; |
31 | using System.Reflection; | 31 | using System.Reflection; |
32 | using System.Xml; | 32 | using System.Xml; |
33 | 33 | ||
34 | namespace OpenSim.Framework.Communications.Capabilities | 34 | namespace OpenSim.Framework.Communications.Capabilities |
35 | { | 35 | { |
36 | public class LLSDHelpers | 36 | public class LLSDHelpers |
37 | { | 37 | { |
38 | // private static readonly log4net.ILog m_log | 38 | // private static readonly log4net.ILog m_log |
39 | // = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | 39 | // = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); |
40 | 40 | ||
41 | public static string SerialiseLLSDReply(object obj) | 41 | public static string SerialiseLLSDReply(object obj) |
42 | { | 42 | { |
43 | StringWriter sw = new StringWriter(); | 43 | StringWriter sw = new StringWriter(); |
44 | XmlTextWriter writer = new XmlTextWriter(sw); | 44 | XmlTextWriter writer = new XmlTextWriter(sw); |
45 | writer.Formatting = Formatting.None; | 45 | writer.Formatting = Formatting.None; |
46 | writer.WriteStartElement(String.Empty, "llsd", String.Empty); | 46 | writer.WriteStartElement(String.Empty, "llsd", String.Empty); |
47 | SerializeOSDType(writer, obj); | 47 | SerializeOSDType(writer, obj); |
48 | writer.WriteEndElement(); | 48 | writer.WriteEndElement(); |
49 | writer.Close(); | 49 | writer.Close(); |
50 | 50 | ||
51 | //m_log.DebugFormat("[LLSD Helpers]: Generated serialized LLSD reply {0}", sw.ToString()); | 51 | //m_log.DebugFormat("[LLSD Helpers]: Generated serialized LLSD reply {0}", sw.ToString()); |
52 | 52 | ||
53 | return sw.ToString(); | 53 | return sw.ToString(); |
54 | } | 54 | } |
55 | 55 | ||
56 | private static void SerializeOSDType(XmlTextWriter writer, object obj) | 56 | private static void SerializeOSDType(XmlTextWriter writer, object obj) |
57 | { | 57 | { |
58 | Type myType = obj.GetType(); | 58 | Type myType = obj.GetType(); |
59 | LLSDType[] llsdattributes = (LLSDType[]) myType.GetCustomAttributes(typeof (LLSDType), false); | 59 | LLSDType[] llsdattributes = (LLSDType[]) myType.GetCustomAttributes(typeof (LLSDType), false); |
60 | if (llsdattributes.Length > 0) | 60 | if (llsdattributes.Length > 0) |
61 | { | 61 | { |
62 | switch (llsdattributes[0].ObjectType) | 62 | switch (llsdattributes[0].ObjectType) |
63 | { | 63 | { |
64 | case "MAP": | 64 | case "MAP": |
65 | writer.WriteStartElement(String.Empty, "map", String.Empty); | 65 | writer.WriteStartElement(String.Empty, "map", String.Empty); |
66 | FieldInfo[] fields = myType.GetFields(); | 66 | FieldInfo[] fields = myType.GetFields(); |
67 | for (int i = 0; i < fields.Length; i++) | 67 | for (int i = 0; i < fields.Length; i++) |
68 | { | 68 | { |
69 | if (fields[i] != null && fields[i].GetValue(obj) != null) | 69 | if (fields[i] != null && fields[i].GetValue(obj) != null) |
70 | { | 70 | { |
71 | object fieldValue = fields[i].GetValue(obj); | 71 | object fieldValue = fields[i].GetValue(obj); |
72 | LLSDType[] fieldAttributes = | 72 | LLSDType[] fieldAttributes = |
73 | (LLSDType[]) fieldValue.GetType().GetCustomAttributes(typeof (LLSDType), false); | 73 | (LLSDType[]) fieldValue.GetType().GetCustomAttributes(typeof (LLSDType), false); |
74 | if (fieldAttributes.Length > 0) | 74 | if (fieldAttributes.Length > 0) |
75 | { | 75 | { |
76 | writer.WriteStartElement(String.Empty, "key", String.Empty); | 76 | writer.WriteStartElement(String.Empty, "key", String.Empty); |
77 | string fieldName = fields[i].Name; | 77 | string fieldName = fields[i].Name; |
78 | fieldName = fieldName.Replace("___", "-"); | 78 | fieldName = fieldName.Replace("___", "-"); |
79 | writer.WriteString(fieldName); | 79 | writer.WriteString(fieldName); |
80 | writer.WriteEndElement(); | 80 | writer.WriteEndElement(); |
81 | SerializeOSDType(writer, fieldValue); | 81 | SerializeOSDType(writer, fieldValue); |
82 | } | 82 | } |
83 | else | 83 | else |
84 | { | 84 | { |
85 | writer.WriteStartElement(String.Empty, "key", String.Empty); | 85 | writer.WriteStartElement(String.Empty, "key", String.Empty); |
86 | string fieldName = fields[i].Name; | 86 | string fieldName = fields[i].Name; |
87 | fieldName = fieldName.Replace("___", "-"); | 87 | fieldName = fieldName.Replace("___", "-"); |
88 | writer.WriteString(fieldName); | 88 | writer.WriteString(fieldName); |
89 | writer.WriteEndElement(); | 89 | writer.WriteEndElement(); |
90 | LLSD.LLSDWriteOne(writer, fieldValue); | 90 | LLSD.LLSDWriteOne(writer, fieldValue); |
91 | // OpenMetaverse.StructuredData.LLSDParser.SerializeXmlElement( | 91 | // OpenMetaverse.StructuredData.LLSDParser.SerializeXmlElement( |
92 | // writer, OpenMetaverse.StructuredData.OSD.FromObject(fieldValue)); | 92 | // writer, OpenMetaverse.StructuredData.OSD.FromObject(fieldValue)); |
93 | } | 93 | } |
94 | } | 94 | } |
95 | else | 95 | else |
96 | { | 96 | { |
97 | // TODO from ADAM: There is a nullref being caused by fields[i] being null | 97 | // TODO from ADAM: There is a nullref being caused by fields[i] being null |
98 | // on some computers. Unsure what is causing this, but would appreciate | 98 | // on some computers. Unsure what is causing this, but would appreciate |
99 | // if sdague could take a look at this. | 99 | // if sdague could take a look at this. |
100 | } | 100 | } |
101 | } | 101 | } |
102 | writer.WriteEndElement(); | 102 | writer.WriteEndElement(); |
103 | break; | 103 | break; |
104 | case "ARRAY": | 104 | case "ARRAY": |
105 | // OSDArray arrayObject = obj as OSDArray; | 105 | // OSDArray arrayObject = obj as OSDArray; |
106 | // ArrayList a = arrayObject.Array; | 106 | // ArrayList a = arrayObject.Array; |
107 | ArrayList a = (ArrayList) obj.GetType().GetField("Array").GetValue(obj); | 107 | ArrayList a = (ArrayList) obj.GetType().GetField("Array").GetValue(obj); |
108 | if (a != null) | 108 | if (a != null) |
109 | { | 109 | { |
110 | writer.WriteStartElement(String.Empty, "array", String.Empty); | 110 | writer.WriteStartElement(String.Empty, "array", String.Empty); |
111 | foreach (object item in a) | 111 | foreach (object item in a) |
112 | { | 112 | { |
113 | SerializeOSDType(writer, item); | 113 | SerializeOSDType(writer, item); |
114 | } | 114 | } |
115 | writer.WriteEndElement(); | 115 | writer.WriteEndElement(); |
116 | } | 116 | } |
117 | break; | 117 | break; |
118 | } | 118 | } |
119 | } | 119 | } |
120 | else | 120 | else |
121 | { | 121 | { |
122 | LLSD.LLSDWriteOne(writer, obj); | 122 | LLSD.LLSDWriteOne(writer, obj); |
123 | //OpenMetaverse.StructuredData.LLSDParser.SerializeXmlElement( | 123 | //OpenMetaverse.StructuredData.LLSDParser.SerializeXmlElement( |
124 | // writer, OpenMetaverse.StructuredData.OSD.FromObject(obj)); | 124 | // writer, OpenMetaverse.StructuredData.OSD.FromObject(obj)); |
125 | } | 125 | } |
126 | } | 126 | } |
127 | 127 | ||
128 | public static object DeserialiseOSDMap(Hashtable llsd, object obj) | 128 | public static object DeserialiseOSDMap(Hashtable llsd, object obj) |
129 | { | 129 | { |
130 | Type myType = obj.GetType(); | 130 | Type myType = obj.GetType(); |
131 | LLSDType[] llsdattributes = (LLSDType[]) myType.GetCustomAttributes(typeof (LLSDType), false); | 131 | LLSDType[] llsdattributes = (LLSDType[]) myType.GetCustomAttributes(typeof (LLSDType), false); |
132 | if (llsdattributes.Length > 0) | 132 | if (llsdattributes.Length > 0) |
133 | { | 133 | { |
134 | switch (llsdattributes[0].ObjectType) | 134 | switch (llsdattributes[0].ObjectType) |
135 | { | 135 | { |
136 | case "MAP": | 136 | case "MAP": |
137 | IDictionaryEnumerator enumerator = llsd.GetEnumerator(); | 137 | IDictionaryEnumerator enumerator = llsd.GetEnumerator(); |
138 | while (enumerator.MoveNext()) | 138 | while (enumerator.MoveNext()) |
139 | { | 139 | { |
140 | string keyName = (string)enumerator.Key; | 140 | string keyName = (string)enumerator.Key; |
141 | keyName = keyName.Replace("-","_"); | 141 | keyName = keyName.Replace("-","_"); |
142 | FieldInfo field = myType.GetField(keyName); | 142 | FieldInfo field = myType.GetField(keyName); |
143 | if (field != null) | 143 | if (field != null) |
144 | { | 144 | { |
145 | // if (enumerator.Value is OpenMetaverse.StructuredData.OSDMap) | 145 | // if (enumerator.Value is OpenMetaverse.StructuredData.OSDMap) |
146 | if (enumerator.Value is Hashtable) | 146 | if (enumerator.Value is Hashtable) |
147 | { | 147 | { |
148 | object fieldValue = field.GetValue(obj); | 148 | object fieldValue = field.GetValue(obj); |
149 | DeserialiseOSDMap((Hashtable) enumerator.Value, fieldValue); | 149 | DeserialiseOSDMap((Hashtable) enumerator.Value, fieldValue); |
150 | // DeserialiseOSDMap((OpenMetaverse.StructuredData.OSDMap) enumerator.Value, fieldValue); | 150 | // DeserialiseOSDMap((OpenMetaverse.StructuredData.OSDMap) enumerator.Value, fieldValue); |
151 | } | 151 | } |
152 | else if (enumerator.Value is ArrayList) | 152 | else if (enumerator.Value is ArrayList) |
153 | { | 153 | { |
154 | object fieldValue = field.GetValue(obj); | 154 | object fieldValue = field.GetValue(obj); |
155 | fieldValue.GetType().GetField("Array").SetValue(fieldValue, enumerator.Value); | 155 | fieldValue.GetType().GetField("Array").SetValue(fieldValue, enumerator.Value); |
156 | //TODO | 156 | //TODO |
157 | // the LLSD map/array types in the array need to be deserialised | 157 | // the LLSD map/array types in the array need to be deserialised |
158 | // but first we need to know the right class to deserialise them into. | 158 | // but first we need to know the right class to deserialise them into. |
159 | } | 159 | } |
160 | else | 160 | else |
161 | { | 161 | { |
162 | field.SetValue(obj, enumerator.Value); | 162 | field.SetValue(obj, enumerator.Value); |
163 | } | 163 | } |
164 | } | 164 | } |
165 | } | 165 | } |
166 | break; | 166 | break; |
167 | } | 167 | } |
168 | } | 168 | } |
169 | return obj; | 169 | return obj; |
170 | } | 170 | } |
171 | } | 171 | } |
172 | } | 172 | } |
diff --git a/OpenSim/Framework/Communications/Capabilities/LLSDInventoryItem.cs b/OpenSim/Framework/Capabilities/LLSDInventoryItem.cs index b0b463f..5fa6d67 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDInventoryItem.cs +++ b/OpenSim/Framework/Capabilities/LLSDInventoryItem.cs | |||
@@ -1,97 +1,97 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSimulator Project nor the | 12 | * * Neither the name of the OpenSimulator Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | using OpenMetaverse; | 28 | using OpenMetaverse; |
29 | 29 | ||
30 | namespace OpenSim.Framework.Communications.Capabilities | 30 | namespace OpenSim.Framework.Communications.Capabilities |
31 | { | 31 | { |
32 | [OSDMap] | 32 | [OSDMap] |
33 | public class LLSDInventoryItem | 33 | public class LLSDInventoryItem |
34 | { | 34 | { |
35 | public UUID parent_id; | 35 | public UUID parent_id; |
36 | 36 | ||
37 | public UUID asset_id; | 37 | public UUID asset_id; |
38 | public UUID item_id; | 38 | public UUID item_id; |
39 | public LLSDPermissions permissions; | 39 | public LLSDPermissions permissions; |
40 | public string type; | 40 | public string type; |
41 | public string inv_type; | 41 | public string inv_type; |
42 | public int flags; | 42 | public int flags; |
43 | 43 | ||
44 | public LLSDSaleInfo sale_info; | 44 | public LLSDSaleInfo sale_info; |
45 | public string name; | 45 | public string name; |
46 | public string desc; | 46 | public string desc; |
47 | public int created_at; | 47 | public int created_at; |
48 | } | 48 | } |
49 | 49 | ||
50 | [OSDMap] | 50 | [OSDMap] |
51 | public class LLSDPermissions | 51 | public class LLSDPermissions |
52 | { | 52 | { |
53 | public UUID creator_id; | 53 | public UUID creator_id; |
54 | public UUID owner_id; | 54 | public UUID owner_id; |
55 | public UUID group_id; | 55 | public UUID group_id; |
56 | public int base_mask; | 56 | public int base_mask; |
57 | public int owner_mask; | 57 | public int owner_mask; |
58 | public int group_mask; | 58 | public int group_mask; |
59 | public int everyone_mask; | 59 | public int everyone_mask; |
60 | public int next_owner_mask; | 60 | public int next_owner_mask; |
61 | public bool is_owner_group; | 61 | public bool is_owner_group; |
62 | } | 62 | } |
63 | 63 | ||
64 | [OSDMap] | 64 | [OSDMap] |
65 | public class LLSDSaleInfo | 65 | public class LLSDSaleInfo |
66 | { | 66 | { |
67 | public int sale_price; | 67 | public int sale_price; |
68 | public string sale_type; | 68 | public string sale_type; |
69 | } | 69 | } |
70 | 70 | ||
71 | [OSDMap] | 71 | [OSDMap] |
72 | public class LLSDInventoryDescendents | 72 | public class LLSDInventoryDescendents |
73 | { | 73 | { |
74 | public OSDArray folders = new OSDArray(); | 74 | public OSDArray folders = new OSDArray(); |
75 | } | 75 | } |
76 | 76 | ||
77 | [OSDMap] | 77 | [OSDMap] |
78 | public class LLSDFetchInventoryDescendents | 78 | public class LLSDFetchInventoryDescendents |
79 | { | 79 | { |
80 | public UUID folder_id; | 80 | public UUID folder_id; |
81 | public UUID owner_id; | 81 | public UUID owner_id; |
82 | public int sort_order; | 82 | public int sort_order; |
83 | public bool fetch_folders; | 83 | public bool fetch_folders; |
84 | public bool fetch_items; | 84 | public bool fetch_items; |
85 | } | 85 | } |
86 | 86 | ||
87 | [OSDMap] | 87 | [OSDMap] |
88 | public class LLSDInventoryFolderContents | 88 | public class LLSDInventoryFolderContents |
89 | { | 89 | { |
90 | public UUID agent_id; | 90 | public UUID agent_id; |
91 | public int descendents; | 91 | public int descendents; |
92 | public UUID folder_id; | 92 | public UUID folder_id; |
93 | public OSDArray items = new OSDArray(); | 93 | public OSDArray items = new OSDArray(); |
94 | public UUID owner_id; | 94 | public UUID owner_id; |
95 | public int version; | 95 | public int version; |
96 | } | 96 | } |
97 | } | 97 | } |
diff --git a/OpenSim/Framework/Communications/Capabilities/LLSDItemUpdate.cs b/OpenSim/Framework/Capabilities/LLSDItemUpdate.cs index 8ddb492..1e2600e 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDItemUpdate.cs +++ b/OpenSim/Framework/Capabilities/LLSDItemUpdate.cs | |||
@@ -1,41 +1,41 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSimulator Project nor the | 12 | * * Neither the name of the OpenSimulator Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | using OpenMetaverse; | 28 | using OpenMetaverse; |
29 | 29 | ||
30 | namespace OpenSim.Framework.Communications.Capabilities | 30 | namespace OpenSim.Framework.Communications.Capabilities |
31 | { | 31 | { |
32 | [OSDMap] | 32 | [OSDMap] |
33 | public class LLSDItemUpdate | 33 | public class LLSDItemUpdate |
34 | { | 34 | { |
35 | public UUID item_id; | 35 | public UUID item_id; |
36 | 36 | ||
37 | public LLSDItemUpdate() | 37 | public LLSDItemUpdate() |
38 | { | 38 | { |
39 | } | 39 | } |
40 | } | 40 | } |
41 | } | 41 | } |
diff --git a/OpenSim/Framework/Communications/Capabilities/LLSDMapLayer.cs b/OpenSim/Framework/Capabilities/LLSDMapLayer.cs index d012b8f..1c1de3c 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDMapLayer.cs +++ b/OpenSim/Framework/Capabilities/LLSDMapLayer.cs | |||
@@ -1,45 +1,45 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSimulator Project nor the | 12 | * * Neither the name of the OpenSimulator Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | using OpenMetaverse; | 28 | using OpenMetaverse; |
29 | 29 | ||
30 | namespace OpenSim.Framework.Communications.Capabilities | 30 | namespace OpenSim.Framework.Communications.Capabilities |
31 | { | 31 | { |
32 | [LLSDType("MAP")] | 32 | [LLSDType("MAP")] |
33 | public class OSDMapLayer | 33 | public class OSDMapLayer |
34 | { | 34 | { |
35 | public int Left = 0; | 35 | public int Left = 0; |
36 | public int Right = 0; | 36 | public int Right = 0; |
37 | public int Top = 0; | 37 | public int Top = 0; |
38 | public int Bottom = 0; | 38 | public int Bottom = 0; |
39 | public UUID ImageID = UUID.Zero; | 39 | public UUID ImageID = UUID.Zero; |
40 | 40 | ||
41 | public OSDMapLayer() | 41 | public OSDMapLayer() |
42 | { | 42 | { |
43 | } | 43 | } |
44 | } | 44 | } |
45 | } | 45 | } |
diff --git a/OpenSim/Framework/Communications/Capabilities/LLSDMapLayerResponse.cs b/OpenSim/Framework/Capabilities/LLSDMapLayerResponse.cs index 4acc736..a2bf9d4 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDMapLayerResponse.cs +++ b/OpenSim/Framework/Capabilities/LLSDMapLayerResponse.cs | |||
@@ -1,40 +1,40 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSimulator Project nor the | 12 | * * Neither the name of the OpenSimulator Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | namespace OpenSim.Framework.Communications.Capabilities | 28 | namespace OpenSim.Framework.Communications.Capabilities |
29 | { | 29 | { |
30 | [LLSDType("MAP")] | 30 | [LLSDType("MAP")] |
31 | public class LLSDMapLayerResponse | 31 | public class LLSDMapLayerResponse |
32 | { | 32 | { |
33 | public LLSDMapRequest AgentData = new LLSDMapRequest(); | 33 | public LLSDMapRequest AgentData = new LLSDMapRequest(); |
34 | public OSDArray LayerData = new OSDArray(); | 34 | public OSDArray LayerData = new OSDArray(); |
35 | 35 | ||
36 | public LLSDMapLayerResponse() | 36 | public LLSDMapLayerResponse() |
37 | { | 37 | { |
38 | } | 38 | } |
39 | } | 39 | } |
40 | } \ No newline at end of file | 40 | } \ No newline at end of file |
diff --git a/OpenSim/Framework/Communications/Capabilities/LLSDMapRequest.cs b/OpenSim/Framework/Capabilities/LLSDMapRequest.cs index c528208..3442474 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDMapRequest.cs +++ b/OpenSim/Framework/Capabilities/LLSDMapRequest.cs | |||
@@ -1,39 +1,39 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSimulator Project nor the | 12 | * * Neither the name of the OpenSimulator Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | namespace OpenSim.Framework.Communications.Capabilities | 28 | namespace OpenSim.Framework.Communications.Capabilities |
29 | { | 29 | { |
30 | [LLSDType("MAP")] | 30 | [LLSDType("MAP")] |
31 | public class LLSDMapRequest | 31 | public class LLSDMapRequest |
32 | { | 32 | { |
33 | public int Flags = 0; | 33 | public int Flags = 0; |
34 | 34 | ||
35 | public LLSDMapRequest() | 35 | public LLSDMapRequest() |
36 | { | 36 | { |
37 | } | 37 | } |
38 | } | 38 | } |
39 | } \ No newline at end of file | 39 | } \ No newline at end of file |
diff --git a/OpenSim/Framework/Communications/Capabilities/LLSDMethod.cs b/OpenSim/Framework/Capabilities/LLSDMethod.cs index 0ef4838..d832aa3 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDMethod.cs +++ b/OpenSim/Framework/Capabilities/LLSDMethod.cs | |||
@@ -1,31 +1,31 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSimulator Project nor the | 12 | * * Neither the name of the OpenSimulator Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | namespace OpenSim.Framework.Communications.Capabilities | 28 | namespace OpenSim.Framework.Communications.Capabilities |
29 | { | 29 | { |
30 | public delegate TResponse LLSDMethod<TRequest, TResponse>(TRequest request); | 30 | public delegate TResponse LLSDMethod<TRequest, TResponse>(TRequest request); |
31 | } \ No newline at end of file | 31 | } \ No newline at end of file |
diff --git a/OpenSim/Framework/Communications/Capabilities/LLSDMethodString.cs b/OpenSim/Framework/Capabilities/LLSDMethodString.cs index 68c3d75..d03bdb1 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDMethodString.cs +++ b/OpenSim/Framework/Capabilities/LLSDMethodString.cs | |||
@@ -1,31 +1,31 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSimulator Project nor the | 12 | * * Neither the name of the OpenSimulator Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | namespace OpenSim.Framework.Communications.Capabilities | 28 | namespace OpenSim.Framework.Communications.Capabilities |
29 | { | 29 | { |
30 | public delegate TResponse LLSDMethodString<TRequest, TResponse>(TRequest request, string path); | 30 | public delegate TResponse LLSDMethodString<TRequest, TResponse>(TRequest request, string path); |
31 | } | 31 | } |
diff --git a/OpenSim/Framework/Communications/Capabilities/LLSDParcelVoiceInfoResponse.cs b/OpenSim/Framework/Capabilities/LLSDParcelVoiceInfoResponse.cs index e8d3c21..855836f 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDParcelVoiceInfoResponse.cs +++ b/OpenSim/Framework/Capabilities/LLSDParcelVoiceInfoResponse.cs | |||
@@ -1,51 +1,51 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSimulator Project nor the | 12 | * * Neither the name of the OpenSimulator Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | 28 | ||
29 | using System.Collections; | 29 | using System.Collections; |
30 | 30 | ||
31 | namespace OpenSim.Framework.Communications.Capabilities | 31 | namespace OpenSim.Framework.Communications.Capabilities |
32 | { | 32 | { |
33 | [OSDMap] | 33 | [OSDMap] |
34 | public class LLSDParcelVoiceInfoResponse | 34 | public class LLSDParcelVoiceInfoResponse |
35 | { | 35 | { |
36 | public int parcel_local_id; | 36 | public int parcel_local_id; |
37 | public string region_name; | 37 | public string region_name; |
38 | public Hashtable voice_credentials; | 38 | public Hashtable voice_credentials; |
39 | 39 | ||
40 | public LLSDParcelVoiceInfoResponse() | 40 | public LLSDParcelVoiceInfoResponse() |
41 | { | 41 | { |
42 | } | 42 | } |
43 | 43 | ||
44 | public LLSDParcelVoiceInfoResponse(string region, int localID, Hashtable creds) | 44 | public LLSDParcelVoiceInfoResponse(string region, int localID, Hashtable creds) |
45 | { | 45 | { |
46 | region_name = region; | 46 | region_name = region; |
47 | parcel_local_id = localID; | 47 | parcel_local_id = localID; |
48 | voice_credentials = creds; | 48 | voice_credentials = creds; |
49 | } | 49 | } |
50 | } | 50 | } |
51 | } \ No newline at end of file | 51 | } \ No newline at end of file |
diff --git a/OpenSim/Framework/Communications/Capabilities/LLSDRemoteParcelResponse.cs b/OpenSim/Framework/Capabilities/LLSDRemoteParcelResponse.cs index 6ad2db9..6a95acd 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDRemoteParcelResponse.cs +++ b/OpenSim/Framework/Capabilities/LLSDRemoteParcelResponse.cs | |||
@@ -1,42 +1,42 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSimulator Project nor the | 12 | * * Neither the name of the OpenSimulator Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | 28 | ||
29 | using OpenMetaverse; | 29 | using OpenMetaverse; |
30 | 30 | ||
31 | namespace OpenSim.Framework.Communications.Capabilities | 31 | namespace OpenSim.Framework.Communications.Capabilities |
32 | { | 32 | { |
33 | [LLSDType("MAP")] | 33 | [LLSDType("MAP")] |
34 | public class LLSDRemoteParcelResponse | 34 | public class LLSDRemoteParcelResponse |
35 | { | 35 | { |
36 | public UUID parcel_id; | 36 | public UUID parcel_id; |
37 | 37 | ||
38 | public LLSDRemoteParcelResponse() | 38 | public LLSDRemoteParcelResponse() |
39 | { | 39 | { |
40 | } | 40 | } |
41 | } | 41 | } |
42 | } | 42 | } |
diff --git a/OpenSim/Framework/Communications/Capabilities/LLSDStreamHandler.cs b/OpenSim/Framework/Capabilities/LLSDStreamHandler.cs index a55b86d..18f0a2a 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDStreamHandler.cs +++ b/OpenSim/Framework/Capabilities/LLSDStreamHandler.cs | |||
@@ -1,70 +1,70 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSimulator Project nor the | 12 | * * Neither the name of the OpenSimulator Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System.Collections; | 28 | using System.Collections; |
29 | using System.IO; | 29 | using System.IO; |
30 | using System.Text; | 30 | using System.Text; |
31 | using OpenSim.Framework.Servers; | 31 | using OpenSim.Framework.Servers; |
32 | using OpenSim.Framework.Servers.HttpServer; | 32 | using OpenSim.Framework.Servers.HttpServer; |
33 | 33 | ||
34 | namespace OpenSim.Framework.Communications.Capabilities | 34 | namespace OpenSim.Framework.Communications.Capabilities |
35 | { | 35 | { |
36 | public class LLSDStreamhandler<TRequest, TResponse> : BaseStreamHandler | 36 | public class LLSDStreamhandler<TRequest, TResponse> : BaseStreamHandler |
37 | where TRequest : new() | 37 | where TRequest : new() |
38 | { | 38 | { |
39 | private LLSDMethod<TRequest, TResponse> m_method; | 39 | private LLSDMethod<TRequest, TResponse> m_method; |
40 | 40 | ||
41 | public LLSDStreamhandler(string httpMethod, string path, LLSDMethod<TRequest, TResponse> method) | 41 | public LLSDStreamhandler(string httpMethod, string path, LLSDMethod<TRequest, TResponse> method) |
42 | : base(httpMethod, path) | 42 | : base(httpMethod, path) |
43 | { | 43 | { |
44 | m_method = method; | 44 | m_method = method; |
45 | } | 45 | } |
46 | 46 | ||
47 | public override byte[] Handle(string path, Stream request, | 47 | public override byte[] Handle(string path, Stream request, |
48 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 48 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) |
49 | { | 49 | { |
50 | //Encoding encoding = Encoding.UTF8; | 50 | //Encoding encoding = Encoding.UTF8; |
51 | //StreamReader streamReader = new StreamReader(request, false); | 51 | //StreamReader streamReader = new StreamReader(request, false); |
52 | 52 | ||
53 | //string requestBody = streamReader.ReadToEnd(); | 53 | //string requestBody = streamReader.ReadToEnd(); |
54 | //streamReader.Close(); | 54 | //streamReader.Close(); |
55 | 55 | ||
56 | // OpenMetaverse.StructuredData.OSDMap hash = (OpenMetaverse.StructuredData.OSDMap) | 56 | // OpenMetaverse.StructuredData.OSDMap hash = (OpenMetaverse.StructuredData.OSDMap) |
57 | // OpenMetaverse.StructuredData.LLSDParser.DeserializeXml(new XmlTextReader(request)); | 57 | // OpenMetaverse.StructuredData.LLSDParser.DeserializeXml(new XmlTextReader(request)); |
58 | 58 | ||
59 | Hashtable hash = (Hashtable) LLSD.LLSDDeserialize(request); | 59 | Hashtable hash = (Hashtable) LLSD.LLSDDeserialize(request); |
60 | TRequest llsdRequest = new TRequest(); | 60 | TRequest llsdRequest = new TRequest(); |
61 | LLSDHelpers.DeserialiseOSDMap(hash, llsdRequest); | 61 | LLSDHelpers.DeserialiseOSDMap(hash, llsdRequest); |
62 | 62 | ||
63 | TResponse response = m_method(llsdRequest); | 63 | TResponse response = m_method(llsdRequest); |
64 | 64 | ||
65 | Encoding encoding = new UTF8Encoding(false); | 65 | Encoding encoding = new UTF8Encoding(false); |
66 | 66 | ||
67 | return encoding.GetBytes(LLSDHelpers.SerialiseLLSDReply(response)); | 67 | return encoding.GetBytes(LLSDHelpers.SerialiseLLSDReply(response)); |
68 | } | 68 | } |
69 | } | 69 | } |
70 | } | 70 | } |
diff --git a/OpenSim/Framework/Communications/Capabilities/LLSDTaskInventoryUploadComplete.cs b/OpenSim/Framework/Capabilities/LLSDTaskInventoryUploadComplete.cs index c359770..ef8bd20 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDTaskInventoryUploadComplete.cs +++ b/OpenSim/Framework/Capabilities/LLSDTaskInventoryUploadComplete.cs | |||
@@ -1,50 +1,50 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSimulator Project nor the | 12 | * * Neither the name of the OpenSimulator Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | using OpenMetaverse; | 28 | using OpenMetaverse; |
29 | 29 | ||
30 | namespace OpenSim.Framework.Communications.Capabilities | 30 | namespace OpenSim.Framework.Communications.Capabilities |
31 | { | 31 | { |
32 | [OSDMap] | 32 | [OSDMap] |
33 | public class LLSDTaskInventoryUploadComplete | 33 | public class LLSDTaskInventoryUploadComplete |
34 | { | 34 | { |
35 | /// <summary> | 35 | /// <summary> |
36 | /// The task inventory item that was updated | 36 | /// The task inventory item that was updated |
37 | /// </summary> | 37 | /// </summary> |
38 | public UUID item_id; | 38 | public UUID item_id; |
39 | 39 | ||
40 | /// <summary> | 40 | /// <summary> |
41 | /// The task that was updated | 41 | /// The task that was updated |
42 | /// </summary> | 42 | /// </summary> |
43 | public UUID task_id; | 43 | public UUID task_id; |
44 | 44 | ||
45 | /// <summary> | 45 | /// <summary> |
46 | /// State of the upload. So far have only even seen this set to "complete" | 46 | /// State of the upload. So far have only even seen this set to "complete" |
47 | /// </summary> | 47 | /// </summary> |
48 | public string state; | 48 | public string state; |
49 | } | 49 | } |
50 | } | 50 | } |
diff --git a/OpenSim/Framework/Communications/Capabilities/LLSDTaskScriptUpdate.cs b/OpenSim/Framework/Capabilities/LLSDTaskScriptUpdate.cs index 4bcf715..6136188 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDTaskScriptUpdate.cs +++ b/OpenSim/Framework/Capabilities/LLSDTaskScriptUpdate.cs | |||
@@ -1,50 +1,50 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSimulator Project nor the | 12 | * * Neither the name of the OpenSimulator Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | using OpenMetaverse; | 28 | using OpenMetaverse; |
29 | 29 | ||
30 | namespace OpenSim.Framework.Communications.Capabilities | 30 | namespace OpenSim.Framework.Communications.Capabilities |
31 | { | 31 | { |
32 | [OSDMap] | 32 | [OSDMap] |
33 | public class LLSDTaskScriptUpdate | 33 | public class LLSDTaskScriptUpdate |
34 | { | 34 | { |
35 | /// <summary> | 35 | /// <summary> |
36 | /// The item containing the script to update | 36 | /// The item containing the script to update |
37 | /// </summary> | 37 | /// </summary> |
38 | public UUID item_id; | 38 | public UUID item_id; |
39 | 39 | ||
40 | /// <summary> | 40 | /// <summary> |
41 | /// The task containing the script | 41 | /// The task containing the script |
42 | /// </summary> | 42 | /// </summary> |
43 | public UUID task_id; | 43 | public UUID task_id; |
44 | 44 | ||
45 | /// <summary> | 45 | /// <summary> |
46 | /// Signals whether the script is currently active | 46 | /// Signals whether the script is currently active |
47 | /// </summary> | 47 | /// </summary> |
48 | public int is_script_running; | 48 | public int is_script_running; |
49 | } | 49 | } |
50 | } | 50 | } |
diff --git a/OpenSim/Framework/Communications/Capabilities/LLSDTest.cs b/OpenSim/Framework/Capabilities/LLSDTest.cs index 6bed9cf..bbe46a0 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDTest.cs +++ b/OpenSim/Framework/Capabilities/LLSDTest.cs | |||
@@ -1,40 +1,40 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSimulator Project nor the | 12 | * * Neither the name of the OpenSimulator Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | namespace OpenSim.Framework.Communications.Capabilities | 28 | namespace OpenSim.Framework.Communications.Capabilities |
29 | { | 29 | { |
30 | [LLSDType("MAP")] | 30 | [LLSDType("MAP")] |
31 | public class LLSDTest | 31 | public class LLSDTest |
32 | { | 32 | { |
33 | public int Test1 = 20; | 33 | public int Test1 = 20; |
34 | public int Test2 = 10; | 34 | public int Test2 = 10; |
35 | 35 | ||
36 | public LLSDTest() | 36 | public LLSDTest() |
37 | { | 37 | { |
38 | } | 38 | } |
39 | } | 39 | } |
40 | } \ No newline at end of file | 40 | } \ No newline at end of file |
diff --git a/OpenSim/Framework/Communications/Capabilities/LLSDType.cs b/OpenSim/Framework/Capabilities/LLSDType.cs index f3f5158..06896e1 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDType.cs +++ b/OpenSim/Framework/Capabilities/LLSDType.cs | |||
@@ -1,55 +1,55 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSimulator Project nor the | 12 | * * Neither the name of the OpenSimulator Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | 29 | ||
30 | namespace OpenSim.Framework.Communications.Capabilities | 30 | namespace OpenSim.Framework.Communications.Capabilities |
31 | { | 31 | { |
32 | [AttributeUsage(AttributeTargets.Class)] | 32 | [AttributeUsage(AttributeTargets.Class)] |
33 | public class LLSDType : Attribute | 33 | public class LLSDType : Attribute |
34 | { | 34 | { |
35 | protected string myType; | 35 | protected string myType; |
36 | 36 | ||
37 | public LLSDType(string type) | 37 | public LLSDType(string type) |
38 | { | 38 | { |
39 | myType = type; | 39 | myType = type; |
40 | } | 40 | } |
41 | 41 | ||
42 | public string ObjectType | 42 | public string ObjectType |
43 | { | 43 | { |
44 | get { return myType; } | 44 | get { return myType; } |
45 | } | 45 | } |
46 | } | 46 | } |
47 | 47 | ||
48 | [AttributeUsage(AttributeTargets.Class)] | 48 | [AttributeUsage(AttributeTargets.Class)] |
49 | public class OSDMap : LLSDType | 49 | public class OSDMap : LLSDType |
50 | { | 50 | { |
51 | public OSDMap() : base("MAP") | 51 | public OSDMap() : base("MAP") |
52 | { | 52 | { |
53 | } | 53 | } |
54 | } | 54 | } |
55 | } \ No newline at end of file | 55 | } \ No newline at end of file |
diff --git a/OpenSim/Framework/Communications/Capabilities/LLSDVoiceAccountResponse.cs b/OpenSim/Framework/Capabilities/LLSDVoiceAccountResponse.cs index 06812aa..ff98a73 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDVoiceAccountResponse.cs +++ b/OpenSim/Framework/Capabilities/LLSDVoiceAccountResponse.cs | |||
@@ -1,57 +1,57 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSimulator Project nor the | 12 | * * Neither the name of the OpenSimulator Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | 28 | ||
29 | namespace OpenSim.Framework.Communications.Capabilities | 29 | namespace OpenSim.Framework.Communications.Capabilities |
30 | { | 30 | { |
31 | [OSDMap] | 31 | [OSDMap] |
32 | public class LLSDVoiceAccountResponse | 32 | public class LLSDVoiceAccountResponse |
33 | { | 33 | { |
34 | public string username; | 34 | public string username; |
35 | public string password; | 35 | public string password; |
36 | public string voice_sip_uri_hostname; | 36 | public string voice_sip_uri_hostname; |
37 | public string voice_account_server_name; | 37 | public string voice_account_server_name; |
38 | 38 | ||
39 | public LLSDVoiceAccountResponse() | 39 | public LLSDVoiceAccountResponse() |
40 | { | 40 | { |
41 | } | 41 | } |
42 | 42 | ||
43 | public LLSDVoiceAccountResponse(string user, string pass) | 43 | public LLSDVoiceAccountResponse(string user, string pass) |
44 | { | 44 | { |
45 | username = user; | 45 | username = user; |
46 | password = pass; | 46 | password = pass; |
47 | } | 47 | } |
48 | 48 | ||
49 | public LLSDVoiceAccountResponse(string user, string pass, string sipUriHost, string accountServer) | 49 | public LLSDVoiceAccountResponse(string user, string pass, string sipUriHost, string accountServer) |
50 | { | 50 | { |
51 | username = user; | 51 | username = user; |
52 | password = pass; | 52 | password = pass; |
53 | voice_sip_uri_hostname = sipUriHost; | 53 | voice_sip_uri_hostname = sipUriHost; |
54 | voice_account_server_name = accountServer; | 54 | voice_account_server_name = accountServer; |
55 | } | 55 | } |
56 | } | 56 | } |
57 | } \ No newline at end of file | 57 | } \ No newline at end of file |
diff --git a/prebuild.xml b/prebuild.xml index 312b90a..30a7db0 100644 --- a/prebuild.xml +++ b/prebuild.xml | |||
@@ -624,6 +624,41 @@ | |||
624 | </Files> | 624 | </Files> |
625 | </Project> | 625 | </Project> |
626 | 626 | ||
627 | |||
628 | <Project name="OpenSim.Framework.Capabilities" path="OpenSim/Framework/Capabilities" type="Library"> | ||
629 | <Configuration name="Debug"> | ||
630 | <Options> | ||
631 | <OutputPath>../../../bin/</OutputPath> | ||
632 | </Options> | ||
633 | </Configuration> | ||
634 | <Configuration name="Release"> | ||
635 | <Options> | ||
636 | <OutputPath>../../../bin/</OutputPath> | ||
637 | </Options> | ||
638 | </Configuration> | ||
639 | |||
640 | <ReferencePath>../../../bin/</ReferencePath> | ||
641 | <Reference name="System"/> | ||
642 | <Reference name="System.Xml"/> | ||
643 | <Reference name="System.Web"/> | ||
644 | <Reference name="OpenSim.Framework"/> | ||
645 | <Reference name="OpenSim.Framework.Servers"/> | ||
646 | <Reference name="OpenSim.Framework.Servers.HttpServer"/> | ||
647 | <Reference name="OpenSim.Framework.Statistics"/> | ||
648 | <Reference name="OpenSim.Services.Interfaces"/> | ||
649 | <Reference name="OpenMetaverseTypes.dll"/> | ||
650 | <!-- FIXME: The OpenMetaverse.dll reference can be dropped when the TransferRequestPacket reference is removed from the code --> | ||
651 | <Reference name="Nini.dll" /> | ||
652 | <Reference name="log4net.dll"/> | ||
653 | |||
654 | <Files> | ||
655 | <Match pattern="*.cs" recurse="true"> | ||
656 | <Exclude name="Tests" pattern="Tests"/> | ||
657 | </Match> | ||
658 | <Match pattern="*.addin.xml" path="Resources" buildAction="EmbeddedResource" recurse="true"/> | ||
659 | </Files> | ||
660 | </Project> | ||
661 | |||
627 | <Project name="OpenSim.Framework.Communications" path="OpenSim/Framework/Communications" type="Library"> | 662 | <Project name="OpenSim.Framework.Communications" path="OpenSim/Framework/Communications" type="Library"> |
628 | <Configuration name="Debug"> | 663 | <Configuration name="Debug"> |
629 | <Options> | 664 | <Options> |
@@ -643,6 +678,7 @@ | |||
643 | <Reference name="OpenSim.Framework"/> | 678 | <Reference name="OpenSim.Framework"/> |
644 | <Reference name="OpenSim.Framework.AssetLoader.Filesystem"/> | 679 | <Reference name="OpenSim.Framework.AssetLoader.Filesystem"/> |
645 | <Reference name="OpenSim.Data" /> | 680 | <Reference name="OpenSim.Data" /> |
681 | <Reference name="OpenSim.Framework.Capabilities"/> | ||
646 | <Reference name="OpenSim.Framework.Servers"/> | 682 | <Reference name="OpenSim.Framework.Servers"/> |
647 | <Reference name="OpenSim.Framework.Servers.HttpServer"/> | 683 | <Reference name="OpenSim.Framework.Servers.HttpServer"/> |
648 | <Reference name="OpenSim.Framework.Console"/> | 684 | <Reference name="OpenSim.Framework.Console"/> |
@@ -688,6 +724,7 @@ | |||
688 | <Reference name="OpenMetaverse.dll"/> | 724 | <Reference name="OpenMetaverse.dll"/> |
689 | <Reference name="OpenSim.Services.Interfaces"/> | 725 | <Reference name="OpenSim.Services.Interfaces"/> |
690 | <Reference name="OpenSim.Framework"/> | 726 | <Reference name="OpenSim.Framework"/> |
727 | <Reference name="OpenSim.Framework.Capabilities"/> | ||
691 | <Reference name="OpenSim.Framework.Communications"/> | 728 | <Reference name="OpenSim.Framework.Communications"/> |
692 | <Reference name="OpenSim.Data" /> | 729 | <Reference name="OpenSim.Data" /> |
693 | <Reference name="OpenSim.Framework.Console"/> | 730 | <Reference name="OpenSim.Framework.Console"/> |
@@ -1087,6 +1124,7 @@ | |||
1087 | <Reference name="OpenSim.Framework.Console"/> | 1124 | <Reference name="OpenSim.Framework.Console"/> |
1088 | <Reference name="OpenSim.Framework.Communications"/> | 1125 | <Reference name="OpenSim.Framework.Communications"/> |
1089 | <Reference name="OpenSim.Data"/> | 1126 | <Reference name="OpenSim.Data"/> |
1127 | <Reference name="OpenSim.Framework.Capabilities"/> | ||
1090 | <Reference name="OpenSim.Framework.Servers"/> | 1128 | <Reference name="OpenSim.Framework.Servers"/> |
1091 | <Reference name="OpenSim.Framework.Servers.HttpServer"/> | 1129 | <Reference name="OpenSim.Framework.Servers.HttpServer"/> |
1092 | <Reference name="OpenSim.Framework.Statistics"/> | 1130 | <Reference name="OpenSim.Framework.Statistics"/> |
@@ -1411,6 +1449,7 @@ | |||
1411 | <Reference name="OpenMetaverseTypes.dll"/> | 1449 | <Reference name="OpenMetaverseTypes.dll"/> |
1412 | <Reference name="OpenMetaverse.dll"/> | 1450 | <Reference name="OpenMetaverse.dll"/> |
1413 | <Reference name="OpenSim.Framework"/> | 1451 | <Reference name="OpenSim.Framework"/> |
1452 | <Reference name="OpenSim.Framework.Capabilities"/> | ||
1414 | <Reference name="OpenSim.Framework.Console"/> | 1453 | <Reference name="OpenSim.Framework.Console"/> |
1415 | <Reference name="OpenSim.Framework.Servers.HttpServer"/> | 1454 | <Reference name="OpenSim.Framework.Servers.HttpServer"/> |
1416 | <Reference name="OpenSim.Services.Interfaces"/> | 1455 | <Reference name="OpenSim.Services.Interfaces"/> |
@@ -1543,6 +1582,7 @@ | |||
1543 | <Reference name="OpenMetaverse.StructuredData.dll"/> | 1582 | <Reference name="OpenMetaverse.StructuredData.dll"/> |
1544 | <Reference name="OpenMetaverse.dll"/> | 1583 | <Reference name="OpenMetaverse.dll"/> |
1545 | <Reference name="OpenSim.Framework"/> | 1584 | <Reference name="OpenSim.Framework"/> |
1585 | <Reference name="OpenSim.Framework.Capabilities"/> | ||
1546 | <Reference name="OpenSim.Framework.Communications"/> | 1586 | <Reference name="OpenSim.Framework.Communications"/> |
1547 | <Reference name="OpenSim.Data" /> | 1587 | <Reference name="OpenSim.Data" /> |
1548 | <Reference name="OpenSim.Region.Framework" /> | 1588 | <Reference name="OpenSim.Region.Framework" /> |
@@ -1633,6 +1673,7 @@ | |||
1633 | <Reference name="OpenSim.Data" /> | 1673 | <Reference name="OpenSim.Data" /> |
1634 | <Reference name="OpenSim.Region.Framework" /> | 1674 | <Reference name="OpenSim.Region.Framework" /> |
1635 | <Reference name="OpenSim.Region.CoreModules" /> | 1675 | <Reference name="OpenSim.Region.CoreModules" /> |
1676 | <Reference name="OpenSim.Framework.Capabilities"/> | ||
1636 | <Reference name="OpenSim.Framework.Console"/> | 1677 | <Reference name="OpenSim.Framework.Console"/> |
1637 | <Reference name="OpenSim.Framework.Servers"/> | 1678 | <Reference name="OpenSim.Framework.Servers"/> |
1638 | <Reference name="OpenSim.Framework.Servers.HttpServer"/> | 1679 | <Reference name="OpenSim.Framework.Servers.HttpServer"/> |
@@ -2126,6 +2167,7 @@ | |||
2126 | <Reference name="System.Xml"/> | 2167 | <Reference name="System.Xml"/> |
2127 | <Reference name="System.Data"/> | 2168 | <Reference name="System.Data"/> |
2128 | <Reference name="OpenSim.Framework"/> | 2169 | <Reference name="OpenSim.Framework"/> |
2170 | <Reference name="OpenSim.Framework.Capabilities"/> | ||
2129 | <Reference name="OpenSim.Framework.Communications"/> | 2171 | <Reference name="OpenSim.Framework.Communications"/> |
2130 | <Reference name="OpenSim.Framework.Console"/> | 2172 | <Reference name="OpenSim.Framework.Console"/> |
2131 | <Reference name="OpenSim.Framework.Servers"/> | 2173 | <Reference name="OpenSim.Framework.Servers"/> |
@@ -2253,6 +2295,7 @@ | |||
2253 | <Reference name="OpenSim.Framework.Communications"/> | 2295 | <Reference name="OpenSim.Framework.Communications"/> |
2254 | <Reference name="Nini.dll" /> | 2296 | <Reference name="Nini.dll" /> |
2255 | <Reference name="log4net.dll"/> | 2297 | <Reference name="log4net.dll"/> |
2298 | <Reference name="OpenSim.Framework.Capabilities"/> | ||
2256 | <Reference name="OpenSim.Framework.Servers"/> | 2299 | <Reference name="OpenSim.Framework.Servers"/> |
2257 | <Reference name="OpenSim.Framework.Servers.HttpServer"/> | 2300 | <Reference name="OpenSim.Framework.Servers.HttpServer"/> |
2258 | <Reference name="OpenMetaverse.StructuredData.dll"/> | 2301 | <Reference name="OpenMetaverse.StructuredData.dll"/> |
@@ -3152,6 +3195,7 @@ | |||
3152 | <Reference name="OpenSim.Region.CoreModules" /> | 3195 | <Reference name="OpenSim.Region.CoreModules" /> |
3153 | <Reference name="OpenSim.Framework.Console"/> | 3196 | <Reference name="OpenSim.Framework.Console"/> |
3154 | <Reference name="OpenSim.Framework.Servers"/> | 3197 | <Reference name="OpenSim.Framework.Servers"/> |
3198 | <Reference name="OpenSim.Framework.Capabilities"/> | ||
3155 | <Reference name="OpenSim.Framework.Servers.HttpServer"/> | 3199 | <Reference name="OpenSim.Framework.Servers.HttpServer"/> |
3156 | <Reference name="OpenSim.Framework.Statistics"/> | 3200 | <Reference name="OpenSim.Framework.Statistics"/> |
3157 | <Reference name="OpenSim.Region.Physics.Manager"/> | 3201 | <Reference name="OpenSim.Region.Physics.Manager"/> |