aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJeff Ames2009-06-22 10:07:27 +0000
committerJeff Ames2009-06-22 10:07:27 +0000
commit142b481e032f7b8206a19e78af82847370b8bf9c (patch)
tree56fdf67bdc78d29214e2ea4742ffb7abcd36d212
parent* Panda no like LongRunningAttribute, no? Me now reverting minuscule fix, yes... (diff)
downloadopensim-SC_OLD-142b481e032f7b8206a19e78af82847370b8bf9c.zip
opensim-SC_OLD-142b481e032f7b8206a19e78af82847370b8bf9c.tar.gz
opensim-SC_OLD-142b481e032f7b8206a19e78af82847370b8bf9c.tar.bz2
opensim-SC_OLD-142b481e032f7b8206a19e78af82847370b8bf9c.tar.xz
Update svn properties.
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/Capabilities/Caps.cs2424
-rw-r--r--OpenSim/Framework/Capabilities/CapsHandlers.cs342
-rw-r--r--OpenSim/Framework/Capabilities/CapsUtil.cs124
-rw-r--r--OpenSim/Framework/Capabilities/LLSD.cs1358
-rw-r--r--OpenSim/Framework/Capabilities/LLSDArray.cs80
-rw-r--r--OpenSim/Framework/Capabilities/LLSDAssetUploadComplete.cs90
-rw-r--r--OpenSim/Framework/Capabilities/LLSDAssetUploadRequest.cs92
-rw-r--r--OpenSim/Framework/Capabilities/LLSDAssetUploadResponse.cs82
-rw-r--r--OpenSim/Framework/Capabilities/LLSDCapEvent.cs78
-rw-r--r--OpenSim/Framework/Capabilities/LLSDEmpty.cs72
-rw-r--r--OpenSim/Framework/Capabilities/LLSDHelpers.cs344
-rw-r--r--OpenSim/Framework/Capabilities/LLSDInventoryItem.cs194
-rw-r--r--OpenSim/Framework/Capabilities/LLSDItemUpdate.cs82
-rw-r--r--OpenSim/Framework/Capabilities/LLSDMapLayer.cs90
-rw-r--r--OpenSim/Framework/Capabilities/LLSDMapLayerResponse.cs78
-rw-r--r--OpenSim/Framework/Capabilities/LLSDMapRequest.cs76
-rw-r--r--OpenSim/Framework/Capabilities/LLSDMethod.cs60
-rw-r--r--OpenSim/Framework/Capabilities/LLSDMethodString.cs62
-rw-r--r--OpenSim/Framework/Capabilities/LLSDParcelVoiceInfoResponse.cs100
-rw-r--r--OpenSim/Framework/Capabilities/LLSDRemoteParcelResponse.cs84
-rw-r--r--OpenSim/Framework/Capabilities/LLSDStreamHandler.cs140
-rw-r--r--OpenSim/Framework/Capabilities/LLSDTaskInventoryUploadComplete.cs100
-rw-r--r--OpenSim/Framework/Capabilities/LLSDTaskScriptUpdate.cs100
-rw-r--r--OpenSim/Framework/Capabilities/LLSDTest.cs78
-rw-r--r--OpenSim/Framework/Capabilities/LLSDType.cs108
-rw-r--r--OpenSim/Framework/Capabilities/LLSDVoiceAccountResponse.cs112
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsIn/Asset/AssetServiceInConnectorModule.cs226
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsIn/Authentication/HGAuthServiceInConnectorModule.cs234
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsIn/Inventory/InventoryServiceInConnectorModule.cs226
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsIn/Land/LandServiceInConnectorModule.cs274
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsIn/Neighbour/NeighbourServiceInConnectorModule.cs274
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsIn/Simulation/SimulationServiceInConnectorModule.cs226
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Land/LocalLandServiceConnector.cs270
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Land/RemoteLandServiceConnector.cs232
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneBaseTests.cs160
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs276
-rw-r--r--OpenSim/Server/Handlers/Authentication/HGAuthServerConnector.cs124
-rw-r--r--OpenSim/Server/Handlers/Authentication/HGAuthenticationHandlers.cs234
-rw-r--r--OpenSim/Server/Handlers/Land/LandHandlers.cs188
-rw-r--r--OpenSim/Server/Handlers/Land/LandServiceInConnector.cs132
-rw-r--r--OpenSim/Services/Connectors/Asset/HGAssetServiceConnector.cs356
-rw-r--r--OpenSim/Services/Connectors/Inventory/HGInventoryServiceConnector.cs482
-rw-r--r--OpenSim/Services/Connectors/Land/LandServiceConnector.cs250
-rw-r--r--OpenSim/Services/Interfaces/ILandService.cs76
44 files changed, 5395 insertions, 5395 deletions
diff --git a/OpenSim/Framework/Capabilities/Caps.cs b/OpenSim/Framework/Capabilities/Caps.cs
index 12bf04d..df29c4e 100644
--- a/OpenSim/Framework/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
28using System; 28using System;
29using System.Collections; 29using System.Collections;
30using System.Collections.Generic; 30using System.Collections.Generic;
31using System.IO; 31using System.IO;
32using System.Reflection; 32using System.Reflection;
33using log4net; 33using log4net;
34using OpenMetaverse; 34using OpenMetaverse;
35using OpenSim.Framework.Servers; 35using OpenSim.Framework.Servers;
36using OpenSim.Framework.Servers.HttpServer; 36using OpenSim.Framework.Servers.HttpServer;
37using OpenSim.Services.Interfaces; 37using OpenSim.Services.Interfaces;
38 38
39// using OpenSim.Region.Framework.Interfaces; 39// using OpenSim.Region.Framework.Interfaces;
40 40
41namespace OpenSim.Framework.Capabilities 41namespace OpenSim.Framework.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/Capabilities/CapsHandlers.cs b/OpenSim/Framework/Capabilities/CapsHandlers.cs
index 5d42bfc..f000aed 100644
--- a/OpenSim/Framework/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
28using System.Collections; 28using System.Collections;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using OpenSim.Framework.Servers; 30using OpenSim.Framework.Servers;
31using OpenSim.Framework.Servers.HttpServer; 31using OpenSim.Framework.Servers.HttpServer;
32 32
33namespace OpenSim.Framework.Capabilities 33namespace OpenSim.Framework.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/Capabilities/CapsUtil.cs b/OpenSim/Framework/Capabilities/CapsUtil.cs
index cd8c001..46dbd3d 100644
--- a/OpenSim/Framework/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
28using OpenMetaverse; 28using OpenMetaverse;
29 29
30namespace OpenSim.Framework.Capabilities 30namespace OpenSim.Framework.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/Capabilities/LLSD.cs b/OpenSim/Framework/Capabilities/LLSD.cs
index c8bc273..84f43c1 100644
--- a/OpenSim/Framework/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
28using System; 28using System;
29using System.Collections; 29using System.Collections;
30using System.Globalization; 30using System.Globalization;
31using System.IO; 31using System.IO;
32using System.Security.Cryptography; 32using System.Security.Cryptography;
33using System.Text; 33using System.Text;
34using System.Xml; 34using System.Xml;
35using OpenMetaverse; 35using OpenMetaverse;
36 36
37namespace OpenSim.Framework.Capabilities 37namespace OpenSim.Framework.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/Capabilities/LLSDArray.cs b/OpenSim/Framework/Capabilities/LLSDArray.cs
index d7a98b7..3459e49 100644
--- a/OpenSim/Framework/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
28using System.Collections; 28using System.Collections;
29 29
30namespace OpenSim.Framework.Capabilities 30namespace OpenSim.Framework.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/Capabilities/LLSDAssetUploadComplete.cs b/OpenSim/Framework/Capabilities/LLSDAssetUploadComplete.cs
index 65c1369..ab6cee5 100644
--- a/OpenSim/Framework/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
28using System; 28using System;
29using OpenMetaverse; 29using OpenMetaverse;
30 30
31namespace OpenSim.Framework.Capabilities 31namespace OpenSim.Framework.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/Capabilities/LLSDAssetUploadRequest.cs b/OpenSim/Framework/Capabilities/LLSDAssetUploadRequest.cs
index 96a43a7..6e66f0a 100644
--- a/OpenSim/Framework/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
28using System; 28using System;
29using OpenMetaverse; 29using OpenMetaverse;
30 30
31namespace OpenSim.Framework.Capabilities 31namespace OpenSim.Framework.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/Capabilities/LLSDAssetUploadResponse.cs b/OpenSim/Framework/Capabilities/LLSDAssetUploadResponse.cs
index 492f419..08f14e3 100644
--- a/OpenSim/Framework/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
28using System; 28using System;
29 29
30namespace OpenSim.Framework.Capabilities 30namespace OpenSim.Framework.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/Capabilities/LLSDCapEvent.cs b/OpenSim/Framework/Capabilities/LLSDCapEvent.cs
index 71b2ed3..63abd62 100644
--- a/OpenSim/Framework/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
28namespace OpenSim.Framework.Capabilities 28namespace OpenSim.Framework.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/Capabilities/LLSDEmpty.cs b/OpenSim/Framework/Capabilities/LLSDEmpty.cs
index 0dce725..f94fcba 100644
--- a/OpenSim/Framework/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
28namespace OpenSim.Framework.Capabilities 28namespace OpenSim.Framework.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/Capabilities/LLSDHelpers.cs b/OpenSim/Framework/Capabilities/LLSDHelpers.cs
index 1bda92c..8f1a40e 100644
--- a/OpenSim/Framework/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
28using System; 28using System;
29using System.Collections; 29using System.Collections;
30using System.IO; 30using System.IO;
31using System.Reflection; 31using System.Reflection;
32using System.Xml; 32using System.Xml;
33 33
34namespace OpenSim.Framework.Capabilities 34namespace OpenSim.Framework.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/Capabilities/LLSDInventoryItem.cs b/OpenSim/Framework/Capabilities/LLSDInventoryItem.cs
index 8d3e322..d0498f6 100644
--- a/OpenSim/Framework/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
28using OpenMetaverse; 28using OpenMetaverse;
29 29
30namespace OpenSim.Framework.Capabilities 30namespace OpenSim.Framework.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/Capabilities/LLSDItemUpdate.cs b/OpenSim/Framework/Capabilities/LLSDItemUpdate.cs
index a3a4d3a..96e2b61 100644
--- a/OpenSim/Framework/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
28using OpenMetaverse; 28using OpenMetaverse;
29 29
30namespace OpenSim.Framework.Capabilities 30namespace OpenSim.Framework.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/Capabilities/LLSDMapLayer.cs b/OpenSim/Framework/Capabilities/LLSDMapLayer.cs
index 75dc2fd..4aeb1ff 100644
--- a/OpenSim/Framework/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
28using OpenMetaverse; 28using OpenMetaverse;
29 29
30namespace OpenSim.Framework.Capabilities 30namespace OpenSim.Framework.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/Capabilities/LLSDMapLayerResponse.cs b/OpenSim/Framework/Capabilities/LLSDMapLayerResponse.cs
index f9b47f5..839e34c 100644
--- a/OpenSim/Framework/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
28namespace OpenSim.Framework.Capabilities 28namespace OpenSim.Framework.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/Capabilities/LLSDMapRequest.cs b/OpenSim/Framework/Capabilities/LLSDMapRequest.cs
index 334920d..debf387 100644
--- a/OpenSim/Framework/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
28namespace OpenSim.Framework.Capabilities 28namespace OpenSim.Framework.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/Capabilities/LLSDMethod.cs b/OpenSim/Framework/Capabilities/LLSDMethod.cs
index 67f2680..cd2574d 100644
--- a/OpenSim/Framework/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
28namespace OpenSim.Framework.Capabilities 28namespace OpenSim.Framework.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/Capabilities/LLSDMethodString.cs b/OpenSim/Framework/Capabilities/LLSDMethodString.cs
index 8e23cf5..38700d5 100644
--- a/OpenSim/Framework/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
28namespace OpenSim.Framework.Capabilities 28namespace OpenSim.Framework.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/Capabilities/LLSDParcelVoiceInfoResponse.cs b/OpenSim/Framework/Capabilities/LLSDParcelVoiceInfoResponse.cs
index dec85df..b34a668 100644
--- a/OpenSim/Framework/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
29using System.Collections; 29using System.Collections;
30 30
31namespace OpenSim.Framework.Capabilities 31namespace OpenSim.Framework.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/Capabilities/LLSDRemoteParcelResponse.cs b/OpenSim/Framework/Capabilities/LLSDRemoteParcelResponse.cs
index c99df78..13d69d3 100644
--- a/OpenSim/Framework/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
29using OpenMetaverse; 29using OpenMetaverse;
30 30
31namespace OpenSim.Framework.Capabilities 31namespace OpenSim.Framework.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/Capabilities/LLSDStreamHandler.cs b/OpenSim/Framework/Capabilities/LLSDStreamHandler.cs
index 0ced4d7..df48b35 100644
--- a/OpenSim/Framework/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
28using System.Collections; 28using System.Collections;
29using System.IO; 29using System.IO;
30using System.Text; 30using System.Text;
31using OpenSim.Framework.Servers; 31using OpenSim.Framework.Servers;
32using OpenSim.Framework.Servers.HttpServer; 32using OpenSim.Framework.Servers.HttpServer;
33 33
34namespace OpenSim.Framework.Capabilities 34namespace OpenSim.Framework.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/Capabilities/LLSDTaskInventoryUploadComplete.cs b/OpenSim/Framework/Capabilities/LLSDTaskInventoryUploadComplete.cs
index 370a8a1..47fdaca 100644
--- a/OpenSim/Framework/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
28using OpenMetaverse; 28using OpenMetaverse;
29 29
30namespace OpenSim.Framework.Capabilities 30namespace OpenSim.Framework.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/Capabilities/LLSDTaskScriptUpdate.cs b/OpenSim/Framework/Capabilities/LLSDTaskScriptUpdate.cs
index e495e9c..9d7c17f 100644
--- a/OpenSim/Framework/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
28using OpenMetaverse; 28using OpenMetaverse;
29 29
30namespace OpenSim.Framework.Capabilities 30namespace OpenSim.Framework.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/Capabilities/LLSDTest.cs b/OpenSim/Framework/Capabilities/LLSDTest.cs
index ba90796..5f77c3d 100644
--- a/OpenSim/Framework/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
28namespace OpenSim.Framework.Capabilities 28namespace OpenSim.Framework.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/Capabilities/LLSDType.cs b/OpenSim/Framework/Capabilities/LLSDType.cs
index c2f1f01..d5ca1ab 100644
--- a/OpenSim/Framework/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
28using System; 28using System;
29 29
30namespace OpenSim.Framework.Capabilities 30namespace OpenSim.Framework.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/Capabilities/LLSDVoiceAccountResponse.cs b/OpenSim/Framework/Capabilities/LLSDVoiceAccountResponse.cs
index 93fa596..53c11e7 100644
--- a/OpenSim/Framework/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
29namespace OpenSim.Framework.Capabilities 29namespace OpenSim.Framework.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/OpenSim/Region/CoreModules/ServiceConnectorsIn/Asset/AssetServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Asset/AssetServiceInConnectorModule.cs
index 7b32f45..7036588 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Asset/AssetServiceInConnectorModule.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Asset/AssetServiceInConnectorModule.cs
@@ -1,113 +1,113 @@
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
28using System; 28using System;
29using System.Reflection; 29using System.Reflection;
30using System.Collections.Generic; 30using System.Collections.Generic;
31using log4net; 31using log4net;
32using Nini.Config; 32using Nini.Config;
33using OpenSim.Framework; 33using OpenSim.Framework;
34using OpenSim.Framework.Servers.HttpServer; 34using OpenSim.Framework.Servers.HttpServer;
35using OpenSim.Region.Framework.Scenes; 35using OpenSim.Region.Framework.Scenes;
36using OpenSim.Region.Framework.Interfaces; 36using OpenSim.Region.Framework.Interfaces;
37using OpenSim.Server.Base; 37using OpenSim.Server.Base;
38using OpenSim.Server.Handlers.Base; 38using OpenSim.Server.Handlers.Base;
39 39
40namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Asset 40namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Asset
41{ 41{
42 public class AssetServiceInConnectorModule : ISharedRegionModule 42 public class AssetServiceInConnectorModule : ISharedRegionModule
43 { 43 {
44 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 44 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
45 private static bool m_Enabled = false; 45 private static bool m_Enabled = false;
46 46
47 private IConfigSource m_Config; 47 private IConfigSource m_Config;
48 bool m_Registered = false; 48 bool m_Registered = false;
49 49
50 #region IRegionModule interface 50 #region IRegionModule interface
51 51
52 public void Initialise(IConfigSource config) 52 public void Initialise(IConfigSource config)
53 { 53 {
54 //// This module is only on for standalones in hypergrid mode 54 //// This module is only on for standalones in hypergrid mode
55 //enabled = ((!config.Configs["Startup"].GetBoolean("gridmode", true)) && 55 //enabled = ((!config.Configs["Startup"].GetBoolean("gridmode", true)) &&
56 // config.Configs["Startup"].GetBoolean("hypergrid", true)) || 56 // config.Configs["Startup"].GetBoolean("hypergrid", true)) ||
57 // ((config.Configs["MXP"] != null) && config.Configs["MXP"].GetBoolean("Enabled", true)); 57 // ((config.Configs["MXP"] != null) && config.Configs["MXP"].GetBoolean("Enabled", true));
58 //m_log.DebugFormat("[RegionAssetService]: enabled? {0}", enabled); 58 //m_log.DebugFormat("[RegionAssetService]: enabled? {0}", enabled);
59 m_Config = config; 59 m_Config = config;
60 IConfig moduleConfig = config.Configs["Modules"]; 60 IConfig moduleConfig = config.Configs["Modules"];
61 if (moduleConfig != null) 61 if (moduleConfig != null)
62 { 62 {
63 m_Enabled = moduleConfig.GetBoolean("AssetServiceInConnector", false); 63 m_Enabled = moduleConfig.GetBoolean("AssetServiceInConnector", false);
64 if (m_Enabled) 64 if (m_Enabled)
65 { 65 {
66 m_log.Info("[ASSET IN CONNECTOR]: AssetServiceInConnector enabled"); 66 m_log.Info("[ASSET IN CONNECTOR]: AssetServiceInConnector enabled");
67 } 67 }
68 68
69 } 69 }
70 } 70 }
71 71
72 public void PostInitialise() 72 public void PostInitialise()
73 { 73 {
74 } 74 }
75 75
76 public void Close() 76 public void Close()
77 { 77 {
78 } 78 }
79 79
80 public string Name 80 public string Name
81 { 81 {
82 get { return "RegionAssetService"; } 82 get { return "RegionAssetService"; }
83 } 83 }
84 84
85 public void AddRegion(Scene scene) 85 public void AddRegion(Scene scene)
86 { 86 {
87 if (!m_Enabled) 87 if (!m_Enabled)
88 return; 88 return;
89 89
90 if (!m_Registered) 90 if (!m_Registered)
91 { 91 {
92 m_Registered = true; 92 m_Registered = true;
93 93
94 m_log.Info("[RegionAssetService]: Starting..."); 94 m_log.Info("[RegionAssetService]: Starting...");
95 95
96 Object[] args = new Object[] { m_Config, scene.CommsManager.HttpServer }; 96 Object[] args = new Object[] { m_Config, scene.CommsManager.HttpServer };
97 97
98 ServerUtils.LoadPlugin<IServiceConnector>("OpenSim.Server.Handlers.dll:AssetServiceConnector", args); 98 ServerUtils.LoadPlugin<IServiceConnector>("OpenSim.Server.Handlers.dll:AssetServiceConnector", args);
99 } 99 }
100 } 100 }
101 101
102 public void RemoveRegion(Scene scene) 102 public void RemoveRegion(Scene scene)
103 { 103 {
104 } 104 }
105 105
106 public void RegionLoaded(Scene scene) 106 public void RegionLoaded(Scene scene)
107 { 107 {
108 } 108 }
109 109
110 #endregion 110 #endregion
111 111
112 } 112 }
113} 113}
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Authentication/HGAuthServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Authentication/HGAuthServiceInConnectorModule.cs
index e1517a0..b3b4320 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Authentication/HGAuthServiceInConnectorModule.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Authentication/HGAuthServiceInConnectorModule.cs
@@ -1,117 +1,117 @@
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
28using System; 28using System;
29using System.Reflection; 29using System.Reflection;
30using System.Collections.Generic; 30using System.Collections.Generic;
31using log4net; 31using log4net;
32using Nini.Config; 32using Nini.Config;
33using OpenSim.Framework; 33using OpenSim.Framework;
34using OpenSim.Framework.Servers.HttpServer; 34using OpenSim.Framework.Servers.HttpServer;
35using OpenSim.Region.Framework.Scenes; 35using OpenSim.Region.Framework.Scenes;
36using OpenSim.Region.Framework.Interfaces; 36using OpenSim.Region.Framework.Interfaces;
37using OpenSim.Server.Base; 37using OpenSim.Server.Base;
38using OpenSim.Services.Interfaces; 38using OpenSim.Services.Interfaces;
39using OpenSim.Server.Handlers.Authentication; 39using OpenSim.Server.Handlers.Authentication;
40 40
41 41
42namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Authentication 42namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Authentication
43{ 43{
44 public class HGAuthServiceInConnectorModule : ISharedRegionModule 44 public class HGAuthServiceInConnectorModule : ISharedRegionModule
45 { 45 {
46 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 46 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
47 private static bool m_Enabled = false; 47 private static bool m_Enabled = false;
48 private static bool m_Registered = false; 48 private static bool m_Registered = false;
49 49
50 private IConfigSource m_Config; 50 private IConfigSource m_Config;
51 51
52 #region IRegionModule interface 52 #region IRegionModule interface
53 53
54 public void Initialise(IConfigSource config) 54 public void Initialise(IConfigSource config)
55 { 55 {
56 m_Config = config; 56 m_Config = config;
57 57
58 IConfig moduleConfig = config.Configs["Modules"]; 58 IConfig moduleConfig = config.Configs["Modules"];
59 if (moduleConfig != null) 59 if (moduleConfig != null)
60 { 60 {
61 // Boolean because there may be many of these in peaceful coexistence 61 // Boolean because there may be many of these in peaceful coexistence
62 m_Enabled = moduleConfig.GetBoolean("HGAuthServiceInConnector", false); 62 m_Enabled = moduleConfig.GetBoolean("HGAuthServiceInConnector", false);
63 if (m_Enabled) 63 if (m_Enabled)
64 { 64 {
65 m_log.Info("[HGAUTH IN CONNECTOR]: HGAuthServiceInConnector enabled"); 65 m_log.Info("[HGAUTH IN CONNECTOR]: HGAuthServiceInConnector enabled");
66 } 66 }
67 67
68 } 68 }
69 69
70 } 70 }
71 71
72 public void PostInitialise() 72 public void PostInitialise()
73 { 73 {
74 if (!m_Enabled) 74 if (!m_Enabled)
75 return; 75 return;
76 76
77 m_log.Info("[HGAUTH IN CONNECTOR]: Starting..."); 77 m_log.Info("[HGAUTH IN CONNECTOR]: Starting...");
78 } 78 }
79 79
80 public void Close() 80 public void Close()
81 { 81 {
82 } 82 }
83 83
84 public string Name 84 public string Name
85 { 85 {
86 get { return "HGAuthServiceInConnectorModule"; } 86 get { return "HGAuthServiceInConnectorModule"; }
87 } 87 }
88 88
89 public void AddRegion(Scene scene) 89 public void AddRegion(Scene scene)
90 { 90 {
91 if (!m_Enabled) 91 if (!m_Enabled)
92 return; 92 return;
93 93
94 if (!m_Registered) 94 if (!m_Registered)
95 { 95 {
96 m_Registered = true; 96 m_Registered = true;
97 new HGAuthServiceInConnector(m_Config, scene.CommsManager.HttpServer); 97 new HGAuthServiceInConnector(m_Config, scene.CommsManager.HttpServer);
98 98
99 //Object[] args = new Object[] { m_Config, scene.CommsManager.HttpServer }; 99 //Object[] args = new Object[] { m_Config, scene.CommsManager.HttpServer };
100 //ServerUtils.LoadPlugin<IAuthenticationService>("OpenSim.Server.Handlers.dll:HGAuthServiceInConnector", args); 100 //ServerUtils.LoadPlugin<IAuthenticationService>("OpenSim.Server.Handlers.dll:HGAuthServiceInConnector", args);
101 } 101 }
102 102
103 103
104 } 104 }
105 105
106 public void RemoveRegion(Scene scene) 106 public void RemoveRegion(Scene scene)
107 { 107 {
108 } 108 }
109 109
110 public void RegionLoaded(Scene scene) 110 public void RegionLoaded(Scene scene)
111 { 111 {
112 } 112 }
113 113
114 #endregion 114 #endregion
115 115
116 } 116 }
117} 117}
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Inventory/InventoryServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Inventory/InventoryServiceInConnectorModule.cs
index 8ca4938..480500a 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Inventory/InventoryServiceInConnectorModule.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Inventory/InventoryServiceInConnectorModule.cs
@@ -1,113 +1,113 @@
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
28using System; 28using System;
29using System.Reflection; 29using System.Reflection;
30using System.Collections.Generic; 30using System.Collections.Generic;
31using log4net; 31using log4net;
32using Nini.Config; 32using Nini.Config;
33using OpenSim.Framework; 33using OpenSim.Framework;
34using OpenSim.Framework.Servers.HttpServer; 34using OpenSim.Framework.Servers.HttpServer;
35using OpenSim.Region.Framework.Scenes; 35using OpenSim.Region.Framework.Scenes;
36using OpenSim.Region.Framework.Interfaces; 36using OpenSim.Region.Framework.Interfaces;
37using OpenSim.Server.Base; 37using OpenSim.Server.Base;
38using OpenSim.Server.Handlers.Base; 38using OpenSim.Server.Handlers.Base;
39 39
40namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Inventory 40namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Inventory
41{ 41{
42 public class InventoryServiceInConnectorModule : ISharedRegionModule 42 public class InventoryServiceInConnectorModule : ISharedRegionModule
43 { 43 {
44 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 44 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
45 private static bool m_Enabled = false; 45 private static bool m_Enabled = false;
46 46
47 private IConfigSource m_Config; 47 private IConfigSource m_Config;
48 bool m_Registered = false; 48 bool m_Registered = false;
49 49
50 #region IRegionModule interface 50 #region IRegionModule interface
51 51
52 public void Initialise(IConfigSource config) 52 public void Initialise(IConfigSource config)
53 { 53 {
54 //// This module is only on for standalones in hypergrid mode 54 //// This module is only on for standalones in hypergrid mode
55 //enabled = (!config.Configs["Startup"].GetBoolean("gridmode", true)) && 55 //enabled = (!config.Configs["Startup"].GetBoolean("gridmode", true)) &&
56 // config.Configs["Startup"].GetBoolean("hypergrid", true); 56 // config.Configs["Startup"].GetBoolean("hypergrid", true);
57 //m_log.DebugFormat("[RegionInventoryService]: enabled? {0}", enabled); 57 //m_log.DebugFormat("[RegionInventoryService]: enabled? {0}", enabled);
58 m_Config = config; 58 m_Config = config;
59 IConfig moduleConfig = config.Configs["Modules"]; 59 IConfig moduleConfig = config.Configs["Modules"];
60 if (moduleConfig != null) 60 if (moduleConfig != null)
61 { 61 {
62 m_Enabled = moduleConfig.GetBoolean("InventoryServiceInConnector", false); 62 m_Enabled = moduleConfig.GetBoolean("InventoryServiceInConnector", false);
63 if (m_Enabled) 63 if (m_Enabled)
64 { 64 {
65 m_log.Info("[INVENTORY IN CONNECTOR]: Inventory Service In Connector enabled"); 65 m_log.Info("[INVENTORY IN CONNECTOR]: Inventory Service In Connector enabled");
66 } 66 }
67 67
68 } 68 }
69 69
70 } 70 }
71 71
72 public void PostInitialise() 72 public void PostInitialise()
73 { 73 {
74 } 74 }
75 75
76 public void Close() 76 public void Close()
77 { 77 {
78 } 78 }
79 79
80 public string Name 80 public string Name
81 { 81 {
82 get { return "RegionInventoryService"; } 82 get { return "RegionInventoryService"; }
83 } 83 }
84 84
85 public void AddRegion(Scene scene) 85 public void AddRegion(Scene scene)
86 { 86 {
87 if (!m_Enabled) 87 if (!m_Enabled)
88 return; 88 return;
89 89
90 if (!m_Registered) 90 if (!m_Registered)
91 { 91 {
92 m_Registered = true; 92 m_Registered = true;
93 93
94 m_log.Info("[RegionInventoryService]: Starting..."); 94 m_log.Info("[RegionInventoryService]: Starting...");
95 95
96 Object[] args = new Object[] { m_Config, scene.CommsManager.HttpServer }; 96 Object[] args = new Object[] { m_Config, scene.CommsManager.HttpServer };
97 97
98 ServerUtils.LoadPlugin<IServiceConnector>("OpenSim.Server.Handlers.dll:InventoryServiceInConnector", args); 98 ServerUtils.LoadPlugin<IServiceConnector>("OpenSim.Server.Handlers.dll:InventoryServiceInConnector", args);
99 } 99 }
100 } 100 }
101 101
102 public void RemoveRegion(Scene scene) 102 public void RemoveRegion(Scene scene)
103 { 103 {
104 } 104 }
105 105
106 public void RegionLoaded(Scene scene) 106 public void RegionLoaded(Scene scene)
107 { 107 {
108 } 108 }
109 109
110 #endregion 110 #endregion
111 111
112 } 112 }
113} 113}
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Land/LandServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Land/LandServiceInConnectorModule.cs
index 9b6cb4d..a3b2440 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Land/LandServiceInConnectorModule.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Land/LandServiceInConnectorModule.cs
@@ -1,137 +1,137 @@
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
28using System; 28using System;
29using System.Reflection; 29using System.Reflection;
30using System.Collections.Generic; 30using System.Collections.Generic;
31using log4net; 31using log4net;
32using Nini.Config; 32using Nini.Config;
33using OpenSim.Framework; 33using OpenSim.Framework;
34using OpenSim.Framework.Servers.HttpServer; 34using OpenSim.Framework.Servers.HttpServer;
35using OpenSim.Region.Framework.Scenes; 35using OpenSim.Region.Framework.Scenes;
36using OpenSim.Region.Framework.Interfaces; 36using OpenSim.Region.Framework.Interfaces;
37using OpenSim.Server.Base; 37using OpenSim.Server.Base;
38using OpenSim.Server.Handlers.Base; 38using OpenSim.Server.Handlers.Base;
39using OpenSim.Services.Interfaces; 39using OpenSim.Services.Interfaces;
40 40
41 41
42namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Land 42namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Land
43{ 43{
44 public class LandServiceInConnectorModule : ISharedRegionModule, ILandService 44 public class LandServiceInConnectorModule : ISharedRegionModule, ILandService
45 { 45 {
46 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 46 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
47 private static bool m_Enabled = false; 47 private static bool m_Enabled = false;
48 private static bool m_Registered = false; 48 private static bool m_Registered = false;
49 49
50 private IConfigSource m_Config; 50 private IConfigSource m_Config;
51 private List<Scene> m_Scenes = new List<Scene>(); 51 private List<Scene> m_Scenes = new List<Scene>();
52 52
53 #region IRegionModule interface 53 #region IRegionModule interface
54 54
55 public void Initialise(IConfigSource config) 55 public void Initialise(IConfigSource config)
56 { 56 {
57 m_Config = config; 57 m_Config = config;
58 58
59 IConfig moduleConfig = config.Configs["Modules"]; 59 IConfig moduleConfig = config.Configs["Modules"];
60 if (moduleConfig != null) 60 if (moduleConfig != null)
61 { 61 {
62 m_Enabled = moduleConfig.GetBoolean("LandServiceInConnector", false); 62 m_Enabled = moduleConfig.GetBoolean("LandServiceInConnector", false);
63 if (m_Enabled) 63 if (m_Enabled)
64 { 64 {
65 m_log.Info("[LAND IN CONNECTOR]: LandServiceInConnector enabled"); 65 m_log.Info("[LAND IN CONNECTOR]: LandServiceInConnector enabled");
66 } 66 }
67 67
68 } 68 }
69 69
70 } 70 }
71 71
72 public void PostInitialise() 72 public void PostInitialise()
73 { 73 {
74 if (!m_Enabled) 74 if (!m_Enabled)
75 return; 75 return;
76 76
77 m_log.Info("[LAND IN CONNECTOR]: Starting..."); 77 m_log.Info("[LAND IN CONNECTOR]: Starting...");
78 } 78 }
79 79
80 public void Close() 80 public void Close()
81 { 81 {
82 } 82 }
83 83
84 public string Name 84 public string Name
85 { 85 {
86 get { return "LandServiceInConnectorModule"; } 86 get { return "LandServiceInConnectorModule"; }
87 } 87 }
88 88
89 public void AddRegion(Scene scene) 89 public void AddRegion(Scene scene)
90 { 90 {
91 if (!m_Enabled) 91 if (!m_Enabled)
92 return; 92 return;
93 93
94 if (!m_Registered) 94 if (!m_Registered)
95 { 95 {
96 m_Registered = true; 96 m_Registered = true;
97 Object[] args = new Object[] { m_Config, scene.CommsManager.HttpServer, this, scene }; 97 Object[] args = new Object[] { m_Config, scene.CommsManager.HttpServer, this, scene };
98 ServerUtils.LoadPlugin<IServiceConnector>("OpenSim.Server.Handlers.dll:LandServiceInConnector", args); 98 ServerUtils.LoadPlugin<IServiceConnector>("OpenSim.Server.Handlers.dll:LandServiceInConnector", args);
99 } 99 }
100 100
101 m_Scenes.Add(scene); 101 m_Scenes.Add(scene);
102 102
103 } 103 }
104 104
105 public void RemoveRegion(Scene scene) 105 public void RemoveRegion(Scene scene)
106 { 106 {
107 if (m_Enabled && m_Scenes.Contains(scene)) 107 if (m_Enabled && m_Scenes.Contains(scene))
108 m_Scenes.Remove(scene); 108 m_Scenes.Remove(scene);
109 } 109 }
110 110
111 public void RegionLoaded(Scene scene) 111 public void RegionLoaded(Scene scene)
112 { 112 {
113 } 113 }
114 114
115 #endregion 115 #endregion
116 116
117 #region ILandService 117 #region ILandService
118 118
119 public LandData GetLandData(ulong regionHandle, uint x, uint y) 119 public LandData GetLandData(ulong regionHandle, uint x, uint y)
120 { 120 {
121 m_log.DebugFormat("[LAND IN CONNECTOR]: GetLandData for {0}. Count = {2}", 121 m_log.DebugFormat("[LAND IN CONNECTOR]: GetLandData for {0}. Count = {2}",
122 regionHandle, m_Scenes.Count); 122 regionHandle, m_Scenes.Count);
123 foreach (Scene s in m_Scenes) 123 foreach (Scene s in m_Scenes)
124 { 124 {
125 if (s.RegionInfo.RegionHandle == regionHandle) 125 if (s.RegionInfo.RegionHandle == regionHandle)
126 { 126 {
127 m_log.Debug("[LAND IN CONNECTOR]: Found region to GetLandData from"); 127 m_log.Debug("[LAND IN CONNECTOR]: Found region to GetLandData from");
128 return s.GetLandData(x, y); 128 return s.GetLandData(x, y);
129 } 129 }
130 } 130 }
131 m_log.DebugFormat("[LAND IN CONNECTOR]: region handle {0} not found", regionHandle); 131 m_log.DebugFormat("[LAND IN CONNECTOR]: region handle {0} not found", regionHandle);
132 return null; 132 return null;
133 } 133 }
134 134
135 #endregion ILandService 135 #endregion ILandService
136 } 136 }
137} 137}
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Neighbour/NeighbourServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Neighbour/NeighbourServiceInConnectorModule.cs
index 1662fd8..a6c2e7c 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Neighbour/NeighbourServiceInConnectorModule.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Neighbour/NeighbourServiceInConnectorModule.cs
@@ -1,137 +1,137 @@
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
28using System; 28using System;
29using System.Reflection; 29using System.Reflection;
30using System.Collections.Generic; 30using System.Collections.Generic;
31using log4net; 31using log4net;
32using Nini.Config; 32using Nini.Config;
33using OpenSim.Framework; 33using OpenSim.Framework;
34using OpenSim.Framework.Servers.HttpServer; 34using OpenSim.Framework.Servers.HttpServer;
35using OpenSim.Region.Framework.Scenes; 35using OpenSim.Region.Framework.Scenes;
36using OpenSim.Region.Framework.Interfaces; 36using OpenSim.Region.Framework.Interfaces;
37using OpenSim.Server.Base; 37using OpenSim.Server.Base;
38using OpenSim.Server.Handlers.Base; 38using OpenSim.Server.Handlers.Base;
39using OpenSim.Services.Interfaces; 39using OpenSim.Services.Interfaces;
40 40
41 41
42namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Neighbour 42namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Neighbour
43{ 43{
44 public class NeighbourServiceInConnectorModule : ISharedRegionModule, INeighbourService 44 public class NeighbourServiceInConnectorModule : ISharedRegionModule, INeighbourService
45 { 45 {
46 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 46 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
47 private static bool m_Enabled = false; 47 private static bool m_Enabled = false;
48 private static bool m_Registered = false; 48 private static bool m_Registered = false;
49 49
50 private IConfigSource m_Config; 50 private IConfigSource m_Config;
51 private List<Scene> m_Scenes = new List<Scene>(); 51 private List<Scene> m_Scenes = new List<Scene>();
52 52
53 #region IRegionModule interface 53 #region IRegionModule interface
54 54
55 public void Initialise(IConfigSource config) 55 public void Initialise(IConfigSource config)
56 { 56 {
57 m_Config = config; 57 m_Config = config;
58 58
59 IConfig moduleConfig = config.Configs["Modules"]; 59 IConfig moduleConfig = config.Configs["Modules"];
60 if (moduleConfig != null) 60 if (moduleConfig != null)
61 { 61 {
62 m_Enabled = moduleConfig.GetBoolean("NeighbourServiceInConnector", false); 62 m_Enabled = moduleConfig.GetBoolean("NeighbourServiceInConnector", false);
63 if (m_Enabled) 63 if (m_Enabled)
64 { 64 {
65 m_log.Info("[NEIGHBOUR IN CONNECTOR]: NeighbourServiceInConnector enabled"); 65 m_log.Info("[NEIGHBOUR IN CONNECTOR]: NeighbourServiceInConnector enabled");
66 } 66 }
67 67
68 } 68 }
69 69
70 } 70 }
71 71
72 public void PostInitialise() 72 public void PostInitialise()
73 { 73 {
74 if (!m_Enabled) 74 if (!m_Enabled)
75 return; 75 return;
76 76
77 m_log.Info("[NEIGHBOUR IN CONNECTOR]: Starting..."); 77 m_log.Info("[NEIGHBOUR IN CONNECTOR]: Starting...");
78 } 78 }
79 79
80 public void Close() 80 public void Close()
81 { 81 {
82 } 82 }
83 83
84 public string Name 84 public string Name
85 { 85 {
86 get { return "NeighbourServiceInConnectorModule"; } 86 get { return "NeighbourServiceInConnectorModule"; }
87 } 87 }
88 88
89 public void AddRegion(Scene scene) 89 public void AddRegion(Scene scene)
90 { 90 {
91 if (!m_Enabled) 91 if (!m_Enabled)
92 return; 92 return;
93 93
94 if (!m_Registered) 94 if (!m_Registered)
95 { 95 {
96 m_Registered = true; 96 m_Registered = true;
97 Object[] args = new Object[] { m_Config, scene.CommsManager.HttpServer, this, scene }; 97 Object[] args = new Object[] { m_Config, scene.CommsManager.HttpServer, this, scene };
98 ServerUtils.LoadPlugin<IServiceConnector>("OpenSim.Server.Handlers.dll:NeighbourServiceInConnector", args); 98 ServerUtils.LoadPlugin<IServiceConnector>("OpenSim.Server.Handlers.dll:NeighbourServiceInConnector", args);
99 } 99 }
100 100
101 m_Scenes.Add(scene); 101 m_Scenes.Add(scene);
102 102
103 } 103 }
104 104
105 public void RemoveRegion(Scene scene) 105 public void RemoveRegion(Scene scene)
106 { 106 {
107 if (m_Enabled && m_Scenes.Contains(scene)) 107 if (m_Enabled && m_Scenes.Contains(scene))
108 m_Scenes.Remove(scene); 108 m_Scenes.Remove(scene);
109 } 109 }
110 110
111 public void RegionLoaded(Scene scene) 111 public void RegionLoaded(Scene scene)
112 { 112 {
113 } 113 }
114 114
115 #endregion 115 #endregion
116 116
117 #region INeighbourService 117 #region INeighbourService
118 118
119 public bool HelloNeighbour(ulong regionHandle, RegionInfo thisRegion) 119 public bool HelloNeighbour(ulong regionHandle, RegionInfo thisRegion)
120 { 120 {
121 m_log.DebugFormat("[NEIGHBOUR IN CONNECTOR]: HelloNeighbour from {0}, to {1}. Count = {2}", 121 m_log.DebugFormat("[NEIGHBOUR IN CONNECTOR]: HelloNeighbour from {0}, to {1}. Count = {2}",
122 thisRegion.RegionName, regionHandle, m_Scenes.Count); 122 thisRegion.RegionName, regionHandle, m_Scenes.Count);
123 foreach (Scene s in m_Scenes) 123 foreach (Scene s in m_Scenes)
124 { 124 {
125 if (s.RegionInfo.RegionHandle == regionHandle) 125 if (s.RegionInfo.RegionHandle == regionHandle)
126 { 126 {
127 m_log.Debug("[NEIGHBOUR IN CONNECTOR]: Found region to SendHelloNeighbour"); 127 m_log.Debug("[NEIGHBOUR IN CONNECTOR]: Found region to SendHelloNeighbour");
128 return s.IncomingHelloNeighbour(thisRegion); 128 return s.IncomingHelloNeighbour(thisRegion);
129 } 129 }
130 } 130 }
131 m_log.DebugFormat("[NEIGHBOUR IN CONNECTOR]: region handle {0} not found", regionHandle); 131 m_log.DebugFormat("[NEIGHBOUR IN CONNECTOR]: region handle {0} not found", regionHandle);
132 return false; 132 return false;
133 } 133 }
134 134
135 #endregion INeighbourService 135 #endregion INeighbourService
136 } 136 }
137} 137}
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Simulation/SimulationServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Simulation/SimulationServiceInConnectorModule.cs
index 4f92244..151b455 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Simulation/SimulationServiceInConnectorModule.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Simulation/SimulationServiceInConnectorModule.cs
@@ -1,113 +1,113 @@
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
28using System; 28using System;
29using System.Reflection; 29using System.Reflection;
30using System.Collections.Generic; 30using System.Collections.Generic;
31using log4net; 31using log4net;
32using Nini.Config; 32using Nini.Config;
33using OpenSim.Framework; 33using OpenSim.Framework;
34using OpenSim.Framework.Servers.HttpServer; 34using OpenSim.Framework.Servers.HttpServer;
35using OpenSim.Region.Framework.Scenes; 35using OpenSim.Region.Framework.Scenes;
36using OpenSim.Region.Framework.Interfaces; 36using OpenSim.Region.Framework.Interfaces;
37using OpenSim.Server.Base; 37using OpenSim.Server.Base;
38using OpenSim.Server.Handlers.Base; 38using OpenSim.Server.Handlers.Base;
39 39
40 40
41namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Simulation 41namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Simulation
42{ 42{
43 // Under construction 43 // Under construction
44 public class SimulationServiceInConnectorModule : ISharedRegionModule 44 public class SimulationServiceInConnectorModule : ISharedRegionModule
45 { 45 {
46 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 46 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
47 private static bool m_Enabled = false; 47 private static bool m_Enabled = false;
48 48
49 private IConfigSource m_Config; 49 private IConfigSource m_Config;
50 bool m_Registered = false; 50 bool m_Registered = false;
51 51
52 #region IRegionModule interface 52 #region IRegionModule interface
53 53
54 public void Initialise(IConfigSource config) 54 public void Initialise(IConfigSource config)
55 { 55 {
56 m_Config = config; 56 m_Config = config;
57 57
58 IConfig moduleConfig = config.Configs["Modules"]; 58 IConfig moduleConfig = config.Configs["Modules"];
59 if (moduleConfig != null) 59 if (moduleConfig != null)
60 { 60 {
61 string name = moduleConfig.GetString("SimulationService", ""); 61 string name = moduleConfig.GetString("SimulationService", "");
62 if (name == Name) 62 if (name == Name)
63 { 63 {
64 m_Enabled = true; 64 m_Enabled = true;
65 m_log.Info("[SIM SERVICE]: SimulationService enabled"); 65 m_log.Info("[SIM SERVICE]: SimulationService enabled");
66 66
67 } 67 }
68 } 68 }
69 69
70 } 70 }
71 71
72 public void PostInitialise() 72 public void PostInitialise()
73 { 73 {
74 } 74 }
75 75
76 public void Close() 76 public void Close()
77 { 77 {
78 } 78 }
79 79
80 public string Name 80 public string Name
81 { 81 {
82 get { return "SimulationService"; } 82 get { return "SimulationService"; }
83 } 83 }
84 84
85 public void AddRegion(Scene scene) 85 public void AddRegion(Scene scene)
86 { 86 {
87 if (!m_Enabled) 87 if (!m_Enabled)
88 return; 88 return;
89 89
90 if (!m_Registered) 90 if (!m_Registered)
91 { 91 {
92 m_Registered = true; 92 m_Registered = true;
93 93
94 m_log.Info("[SIM SERVICE]: Starting..."); 94 m_log.Info("[SIM SERVICE]: Starting...");
95 95
96 Object[] args = new Object[] { m_Config, scene.CommsManager.HttpServer, scene }; 96 Object[] args = new Object[] { m_Config, scene.CommsManager.HttpServer, scene };
97 97
98 ServerUtils.LoadPlugin<IServiceConnector>("OpenSim.Server.Handlers.dll:SimulationServiceInConnector", args); 98 ServerUtils.LoadPlugin<IServiceConnector>("OpenSim.Server.Handlers.dll:SimulationServiceInConnector", args);
99 } 99 }
100 } 100 }
101 101
102 public void RemoveRegion(Scene scene) 102 public void RemoveRegion(Scene scene)
103 { 103 {
104 } 104 }
105 105
106 public void RegionLoaded(Scene scene) 106 public void RegionLoaded(Scene scene)
107 { 107 {
108 } 108 }
109 109
110 #endregion 110 #endregion
111 111
112 } 112 }
113} 113}
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Land/LocalLandServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Land/LocalLandServiceConnector.cs
index a9d9663..73d12e5 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Land/LocalLandServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Land/LocalLandServiceConnector.cs
@@ -1,135 +1,135 @@
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
28using log4net; 28using log4net;
29using Nini.Config; 29using Nini.Config;
30using System; 30using System;
31using System.Collections.Generic; 31using System.Collections.Generic;
32using System.Reflection; 32using System.Reflection;
33using OpenSim.Framework; 33using OpenSim.Framework;
34using OpenSim.Server.Base; 34using OpenSim.Server.Base;
35using OpenSim.Region.Framework.Interfaces; 35using OpenSim.Region.Framework.Interfaces;
36using OpenSim.Region.Framework.Scenes; 36using OpenSim.Region.Framework.Scenes;
37using OpenSim.Services.Interfaces; 37using OpenSim.Services.Interfaces;
38 38
39namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Land 39namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Land
40{ 40{
41 public class LocalLandServicesConnector : 41 public class LocalLandServicesConnector :
42 ISharedRegionModule, ILandService 42 ISharedRegionModule, ILandService
43 { 43 {
44 private static readonly ILog m_log = 44 private static readonly ILog m_log =
45 LogManager.GetLogger( 45 LogManager.GetLogger(
46 MethodBase.GetCurrentMethod().DeclaringType); 46 MethodBase.GetCurrentMethod().DeclaringType);
47 47
48 private List<Scene> m_Scenes = new List<Scene>(); 48 private List<Scene> m_Scenes = new List<Scene>();
49 49
50 private bool m_Enabled = false; 50 private bool m_Enabled = false;
51 51
52 public LocalLandServicesConnector() 52 public LocalLandServicesConnector()
53 { 53 {
54 } 54 }
55 55
56 public LocalLandServicesConnector(List<Scene> scenes) 56 public LocalLandServicesConnector(List<Scene> scenes)
57 { 57 {
58 m_Scenes = scenes; 58 m_Scenes = scenes;
59 } 59 }
60 60
61 #region ISharedRegionModule 61 #region ISharedRegionModule
62 62
63 public string Name 63 public string Name
64 { 64 {
65 get { return "LocalLandServicesConnector"; } 65 get { return "LocalLandServicesConnector"; }
66 } 66 }
67 67
68 public void Initialise(IConfigSource source) 68 public void Initialise(IConfigSource source)
69 { 69 {
70 IConfig moduleConfig = source.Configs["Modules"]; 70 IConfig moduleConfig = source.Configs["Modules"];
71 if (moduleConfig != null) 71 if (moduleConfig != null)
72 { 72 {
73 string name = moduleConfig.GetString("LandServices", this.Name); 73 string name = moduleConfig.GetString("LandServices", this.Name);
74 if (name == Name) 74 if (name == Name)
75 { 75 {
76 m_Enabled = true; 76 m_Enabled = true;
77 m_log.Info("[LAND CONNECTOR]: Local land connector enabled"); 77 m_log.Info("[LAND CONNECTOR]: Local land connector enabled");
78 } 78 }
79 } 79 }
80 } 80 }
81 81
82 public void Close() 82 public void Close()
83 { 83 {
84 } 84 }
85 85
86 public void AddRegion(Scene scene) 86 public void AddRegion(Scene scene)
87 { 87 {
88 m_Scenes.Add(scene); 88 m_Scenes.Add(scene);
89 89
90 if (!m_Enabled) 90 if (!m_Enabled)
91 return; 91 return;
92 92
93 scene.RegisterModuleInterface<ILandService>(this); 93 scene.RegisterModuleInterface<ILandService>(this);
94 } 94 }
95 95
96 public void RegionLoaded(Scene scene) 96 public void RegionLoaded(Scene scene)
97 { 97 {
98 } 98 }
99 99
100 public void PostInitialise() 100 public void PostInitialise()
101 { 101 {
102 } 102 }
103 103
104 public void RemoveRegion(Scene scene) 104 public void RemoveRegion(Scene scene)
105 { 105 {
106 if (m_Scenes.Contains(scene)) 106 if (m_Scenes.Contains(scene))
107 m_Scenes.Remove(scene); 107 m_Scenes.Remove(scene);
108 } 108 }
109 109
110 #endregion ISharedRegionModule 110 #endregion ISharedRegionModule
111 111
112 #region ILandService 112 #region ILandService
113 113
114 public LandData GetLandData(ulong regionHandle, uint x, uint y) 114 public LandData GetLandData(ulong regionHandle, uint x, uint y)
115 { 115 {
116 m_log.DebugFormat("[LAND CONNECTOR]: request for land data in {0} at {1}, {2}", 116 m_log.DebugFormat("[LAND CONNECTOR]: request for land data in {0} at {1}, {2}",
117 regionHandle, x, y); 117 regionHandle, x, y);
118 118
119 foreach (Scene s in m_Scenes) 119 foreach (Scene s in m_Scenes)
120 { 120 {
121 if (s.RegionInfo.RegionHandle == regionHandle) 121 if (s.RegionInfo.RegionHandle == regionHandle)
122 { 122 {
123 LandData land = s.GetLandData(x, y); 123 LandData land = s.GetLandData(x, y);
124 return land; 124 return land;
125 } 125 }
126 } 126 }
127 127
128 m_log.Debug("[LAND CONNECTOR]: didn't find land data locally."); 128 m_log.Debug("[LAND CONNECTOR]: didn't find land data locally.");
129 return null; 129 return null;
130 130
131 } 131 }
132 132
133 #endregion ILandService 133 #endregion ILandService
134 } 134 }
135} 135}
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Land/RemoteLandServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Land/RemoteLandServiceConnector.cs
index f64a1ce..27f811c 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Land/RemoteLandServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Land/RemoteLandServiceConnector.cs
@@ -1,116 +1,116 @@
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
28using log4net; 28using log4net;
29using System; 29using System;
30using System.Collections.Generic; 30using System.Collections.Generic;
31using System.Reflection; 31using System.Reflection;
32using Nini.Config; 32using Nini.Config;
33using OpenSim.Framework; 33using OpenSim.Framework;
34using OpenSim.Services.Connectors; 34using OpenSim.Services.Connectors;
35using OpenSim.Region.Framework.Interfaces; 35using OpenSim.Region.Framework.Interfaces;
36using OpenSim.Region.Framework.Scenes; 36using OpenSim.Region.Framework.Scenes;
37using OpenSim.Services.Interfaces; 37using OpenSim.Services.Interfaces;
38using OpenSim.Server.Base; 38using OpenSim.Server.Base;
39 39
40namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Land 40namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Land
41{ 41{
42 public class RemoteLandServicesConnector : 42 public class RemoteLandServicesConnector :
43 LandServicesConnector, ISharedRegionModule, ILandService 43 LandServicesConnector, ISharedRegionModule, ILandService
44 { 44 {
45 private static readonly ILog m_log = 45 private static readonly ILog m_log =
46 LogManager.GetLogger( 46 LogManager.GetLogger(
47 MethodBase.GetCurrentMethod().DeclaringType); 47 MethodBase.GetCurrentMethod().DeclaringType);
48 48
49 private bool m_Enabled = false; 49 private bool m_Enabled = false;
50 private LocalLandServicesConnector m_LocalService; 50 private LocalLandServicesConnector m_LocalService;
51 51
52 public string Name 52 public string Name
53 { 53 {
54 get { return "RemoteLandServicesConnector"; } 54 get { return "RemoteLandServicesConnector"; }
55 } 55 }
56 56
57 public void Initialise(IConfigSource source) 57 public void Initialise(IConfigSource source)
58 { 58 {
59 IConfig moduleConfig = source.Configs["Modules"]; 59 IConfig moduleConfig = source.Configs["Modules"];
60 if (moduleConfig != null) 60 if (moduleConfig != null)
61 { 61 {
62 string name = moduleConfig.GetString("LandServices", ""); 62 string name = moduleConfig.GetString("LandServices", "");
63 if (name == Name) 63 if (name == Name)
64 { 64 {
65 m_LocalService = new LocalLandServicesConnector(); 65 m_LocalService = new LocalLandServicesConnector();
66 66
67 m_Enabled = true; 67 m_Enabled = true;
68 68
69 m_log.Info("[LAND CONNECTOR]: Remote Land connector enabled"); 69 m_log.Info("[LAND CONNECTOR]: Remote Land connector enabled");
70 } 70 }
71 } 71 }
72 } 72 }
73 73
74 public void PostInitialise() 74 public void PostInitialise()
75 { 75 {
76 } 76 }
77 77
78 public void Close() 78 public void Close()
79 { 79 {
80 } 80 }
81 81
82 public void AddRegion(Scene scene) 82 public void AddRegion(Scene scene)
83 { 83 {
84 if (!m_Enabled) 84 if (!m_Enabled)
85 return; 85 return;
86 86
87 m_MapService = scene.CommsManager.GridService; 87 m_MapService = scene.CommsManager.GridService;
88 m_LocalService.AddRegion(scene); 88 m_LocalService.AddRegion(scene);
89 scene.RegisterModuleInterface<ILandService>(this); 89 scene.RegisterModuleInterface<ILandService>(this);
90 } 90 }
91 91
92 public void RemoveRegion(Scene scene) 92 public void RemoveRegion(Scene scene)
93 { 93 {
94 if (m_Enabled) 94 if (m_Enabled)
95 m_LocalService.RemoveRegion(scene); 95 m_LocalService.RemoveRegion(scene);
96 } 96 }
97 97
98 public void RegionLoaded(Scene scene) 98 public void RegionLoaded(Scene scene)
99 { 99 {
100 } 100 }
101 101
102 102
103 #region ILandService 103 #region ILandService
104 104
105 public override LandData GetLandData(ulong regionHandle, uint x, uint y) 105 public override LandData GetLandData(ulong regionHandle, uint x, uint y)
106 { 106 {
107 LandData land = m_LocalService.GetLandData(regionHandle, x, y); 107 LandData land = m_LocalService.GetLandData(regionHandle, x, y);
108 if (land != null) 108 if (land != null)
109 return land; 109 return land;
110 110
111 return base.GetLandData(regionHandle, x, y); 111 return base.GetLandData(regionHandle, x, y);
112 112
113 } 113 }
114 #endregion ILandService 114 #endregion ILandService
115 } 115 }
116} 116}
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneBaseTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneBaseTests.cs
index 54bf51b..87bd20e 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneBaseTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneBaseTests.cs
@@ -1,80 +1,80 @@
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
28using System; 28using System;
29using NUnit.Framework; 29using NUnit.Framework;
30using OpenMetaverse; 30using OpenMetaverse;
31using OpenSim.Framework; 31using OpenSim.Framework;
32 32
33namespace OpenSim.Region.Framework.Scenes.Tests 33namespace OpenSim.Region.Framework.Scenes.Tests
34{ 34{
35 /// <summary> 35 /// <summary>
36 /// Scene presence tests 36 /// Scene presence tests
37 /// </summary> 37 /// </summary>
38 [TestFixture] 38 [TestFixture]
39 public class SceneBaseTests 39 public class SceneBaseTests
40 { 40 {
41 private class SceneBaseImpl : SceneBase 41 private class SceneBaseImpl : SceneBase
42 { 42 {
43 public override void Update() 43 public override void Update()
44 { 44 {
45 throw new NotImplementedException(); 45 throw new NotImplementedException();
46 } 46 }
47 47
48 public override void LoadWorldMap() 48 public override void LoadWorldMap()
49 { 49 {
50 throw new NotImplementedException(); 50 throw new NotImplementedException();
51 } 51 }
52 52
53 public override void AddNewClient(IClientAPI client) 53 public override void AddNewClient(IClientAPI client)
54 { 54 {
55 throw new NotImplementedException(); 55 throw new NotImplementedException();
56 } 56 }
57 57
58 public override void RemoveClient(UUID agentID) 58 public override void RemoveClient(UUID agentID)
59 { 59 {
60 throw new NotImplementedException(); 60 throw new NotImplementedException();
61 } 61 }
62 62
63 public override void CloseAllAgents(uint circuitcode) 63 public override void CloseAllAgents(uint circuitcode)
64 { 64 {
65 throw new NotImplementedException(); 65 throw new NotImplementedException();
66 } 66 }
67 67
68 public override bool OtherRegionUp(RegionInfo thisRegion) 68 public override bool OtherRegionUp(RegionInfo thisRegion)
69 { 69 {
70 throw new NotImplementedException(); 70 throw new NotImplementedException();
71 } 71 }
72 } 72 }
73 73
74 [Test] 74 [Test]
75 public void TestConstructor() 75 public void TestConstructor()
76 { 76 {
77 SceneBase scene = new SceneBaseImpl(); 77 SceneBase scene = new SceneBaseImpl();
78 } 78 }
79 } 79 }
80} 80}
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs
index 3c2fa1a..4d6a86b 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs
@@ -1,138 +1,138 @@
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
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using NUnit.Framework; 30using NUnit.Framework;
31using OpenMetaverse; 31using OpenMetaverse;
32using OpenSim.Framework; 32using OpenSim.Framework;
33using OpenSim.Region.Framework.Interfaces; 33using OpenSim.Region.Framework.Interfaces;
34 34
35namespace OpenSim.Region.Framework.Scenes.Tests 35namespace OpenSim.Region.Framework.Scenes.Tests
36{ 36{
37 /// <summary> 37 /// <summary>
38 /// Scene presence tests 38 /// Scene presence tests
39 /// </summary> 39 /// </summary>
40 [TestFixture] 40 [TestFixture]
41 public class SceneTests 41 public class SceneTests
42 { 42 {
43 private class FakeStorageManager : StorageManager 43 private class FakeStorageManager : StorageManager
44 { 44 {
45 private class FakeRegionDataStore : IRegionDataStore 45 private class FakeRegionDataStore : IRegionDataStore
46 { 46 {
47 public void Initialise(string filename) 47 public void Initialise(string filename)
48 { 48 {
49 } 49 }
50 50
51 public void Dispose() 51 public void Dispose()
52 { 52 {
53 } 53 }
54 54
55 public void StoreObject(SceneObjectGroup obj, UUID regionUUID) 55 public void StoreObject(SceneObjectGroup obj, UUID regionUUID)
56 { 56 {
57 throw new NotImplementedException(); 57 throw new NotImplementedException();
58 } 58 }
59 59
60 public void RemoveObject(UUID uuid, UUID regionUUID) 60 public void RemoveObject(UUID uuid, UUID regionUUID)
61 { 61 {
62 throw new NotImplementedException(); 62 throw new NotImplementedException();
63 } 63 }
64 64
65 public void StorePrimInventory(UUID primID, ICollection<TaskInventoryItem> items) 65 public void StorePrimInventory(UUID primID, ICollection<TaskInventoryItem> items)
66 { 66 {
67 throw new NotImplementedException(); 67 throw new NotImplementedException();
68 } 68 }
69 69
70 public List<SceneObjectGroup> LoadObjects(UUID regionUUID) 70 public List<SceneObjectGroup> LoadObjects(UUID regionUUID)
71 { 71 {
72 throw new NotImplementedException(); 72 throw new NotImplementedException();
73 } 73 }
74 74
75 public void StoreTerrain(double[,] terrain, UUID regionID) 75 public void StoreTerrain(double[,] terrain, UUID regionID)
76 { 76 {
77 throw new NotImplementedException(); 77 throw new NotImplementedException();
78 } 78 }
79 79
80 public double[,] LoadTerrain(UUID regionID) 80 public double[,] LoadTerrain(UUID regionID)
81 { 81 {
82 throw new NotImplementedException(); 82 throw new NotImplementedException();
83 } 83 }
84 84
85 public void StoreLandObject(ILandObject Parcel) 85 public void StoreLandObject(ILandObject Parcel)
86 { 86 {
87 throw new NotImplementedException(); 87 throw new NotImplementedException();
88 } 88 }
89 89
90 public void RemoveLandObject(UUID globalID) 90 public void RemoveLandObject(UUID globalID)
91 { 91 {
92 throw new NotImplementedException(); 92 throw new NotImplementedException();
93 } 93 }
94 94
95 public List<LandData> LoadLandObjects(UUID regionUUID) 95 public List<LandData> LoadLandObjects(UUID regionUUID)
96 { 96 {
97 throw new NotImplementedException(); 97 throw new NotImplementedException();
98 } 98 }
99 99
100 public void StoreRegionSettings(RegionSettings rs) 100 public void StoreRegionSettings(RegionSettings rs)
101 { 101 {
102 throw new NotImplementedException(); 102 throw new NotImplementedException();
103 } 103 }
104 104
105 public RegionSettings LoadRegionSettings(UUID regionUUID) 105 public RegionSettings LoadRegionSettings(UUID regionUUID)
106 { 106 {
107 return null; 107 return null;
108 } 108 }
109 109
110 public void Shutdown() 110 public void Shutdown()
111 { 111 {
112 throw new NotImplementedException(); 112 throw new NotImplementedException();
113 } 113 }
114 } 114 }
115 115
116 public FakeStorageManager() : base( new FakeRegionDataStore() ) 116 public FakeStorageManager() : base( new FakeRegionDataStore() )
117 { 117 {
118 } 118 }
119 119
120 public FakeStorageManager(IRegionDataStore storage) : this() 120 public FakeStorageManager(IRegionDataStore storage) : this()
121 { 121 {
122 } 122 }
123 123
124 public FakeStorageManager(string dllName, string connectionstring, string estateconnectionstring) : this() 124 public FakeStorageManager(string dllName, string connectionstring, string estateconnectionstring) : this()
125 { 125 {
126 } 126 }
127 } 127 }
128 128
129 [Test] 129 [Test]
130 public void TestConstructor() 130 public void TestConstructor()
131 { 131 {
132 RegionInfo regionInfo = new RegionInfo(0,0,null,null); 132 RegionInfo regionInfo = new RegionInfo(0,0,null,null);
133 FakeStorageManager storageManager = new FakeStorageManager(); 133 FakeStorageManager storageManager = new FakeStorageManager();
134 134
135 Scene scene = new Scene(regionInfo, null, null, null, storageManager, null, false, false, false, null, null ); 135 Scene scene = new Scene(regionInfo, null, null, null, storageManager, null, false, false, false, null, null );
136 } 136 }
137 } 137 }
138} 138}
diff --git a/OpenSim/Server/Handlers/Authentication/HGAuthServerConnector.cs b/OpenSim/Server/Handlers/Authentication/HGAuthServerConnector.cs
index 2b4c380..2d31564 100644
--- a/OpenSim/Server/Handlers/Authentication/HGAuthServerConnector.cs
+++ b/OpenSim/Server/Handlers/Authentication/HGAuthServerConnector.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
28using System; 28using System;
29using Nini.Config; 29using Nini.Config;
30using OpenSim.Server.Base; 30using OpenSim.Server.Base;
31using OpenSim.Services.Interfaces; 31using OpenSim.Services.Interfaces;
32using OpenSim.Framework.Servers.HttpServer; 32using OpenSim.Framework.Servers.HttpServer;
33using OpenSim.Server.Handlers.Base; 33using OpenSim.Server.Handlers.Base;
34 34
35namespace OpenSim.Server.Handlers.Authentication 35namespace OpenSim.Server.Handlers.Authentication
36{ 36{
37 public class HGAuthServiceInConnector : ServiceConnector 37 public class HGAuthServiceInConnector : ServiceConnector
38 { 38 {
39 private IAuthenticationService m_AuthenticationService; 39 private IAuthenticationService m_AuthenticationService;
40 40
41 public HGAuthServiceInConnector(IConfigSource config, IHttpServer server) : 41 public HGAuthServiceInConnector(IConfigSource config, IHttpServer server) :
42 base(config, server) 42 base(config, server)
43 { 43 {
44 IConfig serverConfig = config.Configs["AuthenticationService"]; 44 IConfig serverConfig = config.Configs["AuthenticationService"];
45 if (serverConfig == null) 45 if (serverConfig == null)
46 throw new Exception("No section 'AuthenticationService' in config file"); 46 throw new Exception("No section 'AuthenticationService' in config file");
47 47
48 string authenticationService = serverConfig.GetString("LocalServiceModule", 48 string authenticationService = serverConfig.GetString("LocalServiceModule",
49 String.Empty); 49 String.Empty);
50 50
51 if (authenticationService == String.Empty) 51 if (authenticationService == String.Empty)
52 throw new Exception("No AuthenticationService in config file"); 52 throw new Exception("No AuthenticationService in config file");
53 53
54 Object[] args = new Object[] { config }; 54 Object[] args = new Object[] { config };
55 m_AuthenticationService = ServerUtils.LoadPlugin<IAuthenticationService>(authenticationService, args); 55 m_AuthenticationService = ServerUtils.LoadPlugin<IAuthenticationService>(authenticationService, args);
56 56
57 HGAuthenticationHandlers m_handlers = new HGAuthenticationHandlers(m_AuthenticationService); 57 HGAuthenticationHandlers m_handlers = new HGAuthenticationHandlers(m_AuthenticationService);
58 server.AddXmlRPCHandler("hg_new_auth_key", m_handlers.GenerateKeyMethod); 58 server.AddXmlRPCHandler("hg_new_auth_key", m_handlers.GenerateKeyMethod);
59 server.AddXmlRPCHandler("hg_verify_auth_key", m_handlers.VerifyKeyMethod); 59 server.AddXmlRPCHandler("hg_verify_auth_key", m_handlers.VerifyKeyMethod);
60 } 60 }
61 } 61 }
62} 62}
diff --git a/OpenSim/Server/Handlers/Authentication/HGAuthenticationHandlers.cs b/OpenSim/Server/Handlers/Authentication/HGAuthenticationHandlers.cs
index 1bcbaf5..58a1823 100644
--- a/OpenSim/Server/Handlers/Authentication/HGAuthenticationHandlers.cs
+++ b/OpenSim/Server/Handlers/Authentication/HGAuthenticationHandlers.cs
@@ -1,117 +1,117 @@
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
28using System; 28using System;
29using System.Collections; 29using System.Collections;
30using System.IO; 30using System.IO;
31using System.Reflection; 31using System.Reflection;
32using System.Net; 32using System.Net;
33using System.Text; 33using System.Text;
34 34
35using OpenSim.Server.Base; 35using OpenSim.Server.Base;
36using OpenSim.Server.Handlers.Base; 36using OpenSim.Server.Handlers.Base;
37using OpenSim.Services.Interfaces; 37using OpenSim.Services.Interfaces;
38using OpenSim.Framework; 38using OpenSim.Framework;
39using OpenSim.Framework.Servers.HttpServer; 39using OpenSim.Framework.Servers.HttpServer;
40 40
41using OpenMetaverse; 41using OpenMetaverse;
42using OpenMetaverse.StructuredData; 42using OpenMetaverse.StructuredData;
43using Nwc.XmlRpc; 43using Nwc.XmlRpc;
44using Nini.Config; 44using Nini.Config;
45using log4net; 45using log4net;
46 46
47namespace OpenSim.Server.Handlers.Authentication 47namespace OpenSim.Server.Handlers.Authentication
48{ 48{
49 public class HGAuthenticationHandlers 49 public class HGAuthenticationHandlers
50 { 50 {
51 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 51 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
52 52
53 private IAuthenticationService m_LocalService; 53 private IAuthenticationService m_LocalService;
54 54
55 public HGAuthenticationHandlers(IAuthenticationService service) 55 public HGAuthenticationHandlers(IAuthenticationService service)
56 { 56 {
57 m_LocalService = service; 57 m_LocalService = service;
58 } 58 }
59 59
60 60
61 public XmlRpcResponse GenerateKeyMethod(XmlRpcRequest request, IPEndPoint remoteClient) 61 public XmlRpcResponse GenerateKeyMethod(XmlRpcRequest request, IPEndPoint remoteClient)
62 { 62 {
63 XmlRpcResponse response = new XmlRpcResponse(); 63 XmlRpcResponse response = new XmlRpcResponse();
64 64
65 if (request.Params.Count < 2) 65 if (request.Params.Count < 2)
66 { 66 {
67 response.IsFault = true; 67 response.IsFault = true;
68 response.SetFault(-1, "Invalid parameters"); 68 response.SetFault(-1, "Invalid parameters");
69 return response; 69 return response;
70 } 70 }
71 71
72 // Verify the key of who's calling 72 // Verify the key of who's calling
73 UUID userID = UUID.Zero; 73 UUID userID = UUID.Zero;
74 string authKey = string.Empty; 74 string authKey = string.Empty;
75 UUID.TryParse((string)request.Params[0], out userID); 75 UUID.TryParse((string)request.Params[0], out userID);
76 authKey = (string)request.Params[1]; 76 authKey = (string)request.Params[1];
77 77
78 m_log.InfoFormat("[AUTH HANDLER] GenerateKey called with authToken {0}", authKey); 78 m_log.InfoFormat("[AUTH HANDLER] GenerateKey called with authToken {0}", authKey);
79 string newKey = string.Empty; 79 string newKey = string.Empty;
80 80
81 newKey = m_LocalService.GetKey(userID, authKey.ToString()); 81 newKey = m_LocalService.GetKey(userID, authKey.ToString());
82 82
83 response.Value = (string)newKey; 83 response.Value = (string)newKey;
84 return response; 84 return response;
85 } 85 }
86 86
87 public XmlRpcResponse VerifyKeyMethod(XmlRpcRequest request, IPEndPoint remoteClient) 87 public XmlRpcResponse VerifyKeyMethod(XmlRpcRequest request, IPEndPoint remoteClient)
88 { 88 {
89 bool success = false; 89 bool success = false;
90 XmlRpcResponse response = new XmlRpcResponse(); 90 XmlRpcResponse response = new XmlRpcResponse();
91 91
92 if (request.Params.Count != 2) 92 if (request.Params.Count != 2)
93 { 93 {
94 response.IsFault = true; 94 response.IsFault = true;
95 response.SetFault(-1, "Invalid parameters"); 95 response.SetFault(-1, "Invalid parameters");
96 return response; 96 return response;
97 } 97 }
98 98
99 // Verify the key of who's calling 99 // Verify the key of who's calling
100 UUID userID = UUID.Zero; 100 UUID userID = UUID.Zero;
101 string authKey = string.Empty; 101 string authKey = string.Empty;
102 if (UUID.TryParse((string)request.Params[0], out userID)) 102 if (UUID.TryParse((string)request.Params[0], out userID))
103 { 103 {
104 authKey = (string)request.Params[1]; 104 authKey = (string)request.Params[1];
105 105
106 m_log.InfoFormat("[AUTH HANDLER] VerifyKey called with key {0}", authKey); 106 m_log.InfoFormat("[AUTH HANDLER] VerifyKey called with key {0}", authKey);
107 107
108 success = m_LocalService.VerifyKey(userID, authKey); 108 success = m_LocalService.VerifyKey(userID, authKey);
109 } 109 }
110 110
111 m_log.DebugFormat("[AUTH HANDLER]: Response to VerifyKey is {0}", success); 111 m_log.DebugFormat("[AUTH HANDLER]: Response to VerifyKey is {0}", success);
112 response.Value = success; 112 response.Value = success;
113 return response; 113 return response;
114 } 114 }
115 115
116 } 116 }
117} 117}
diff --git a/OpenSim/Server/Handlers/Land/LandHandlers.cs b/OpenSim/Server/Handlers/Land/LandHandlers.cs
index b15d7f6..a21f9de 100644
--- a/OpenSim/Server/Handlers/Land/LandHandlers.cs
+++ b/OpenSim/Server/Handlers/Land/LandHandlers.cs
@@ -1,94 +1,94 @@
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
28using System; 28using System;
29using System.Collections; 29using System.Collections;
30using System.IO; 30using System.IO;
31using System.Reflection; 31using System.Reflection;
32using System.Net; 32using System.Net;
33using System.Text; 33using System.Text;
34 34
35using OpenSim.Server.Base; 35using OpenSim.Server.Base;
36using OpenSim.Server.Handlers.Base; 36using OpenSim.Server.Handlers.Base;
37using OpenSim.Services.Interfaces; 37using OpenSim.Services.Interfaces;
38using OpenSim.Framework; 38using OpenSim.Framework;
39using OpenSim.Framework.Servers.HttpServer; 39using OpenSim.Framework.Servers.HttpServer;
40 40
41using OpenMetaverse; 41using OpenMetaverse;
42using OpenMetaverse.StructuredData; 42using OpenMetaverse.StructuredData;
43using Nwc.XmlRpc; 43using Nwc.XmlRpc;
44using Nini.Config; 44using Nini.Config;
45using log4net; 45using log4net;
46 46
47 47
48namespace OpenSim.Server.Handlers.Land 48namespace OpenSim.Server.Handlers.Land
49{ 49{
50 public class LandHandlers 50 public class LandHandlers
51 { 51 {
52 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 52 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
53 53
54 private ILandService m_LocalService; 54 private ILandService m_LocalService;
55 55
56 public LandHandlers(ILandService service) 56 public LandHandlers(ILandService service)
57 { 57 {
58 m_LocalService = service; 58 m_LocalService = service;
59 } 59 }
60 60
61 public XmlRpcResponse GetLandData(XmlRpcRequest request, IPEndPoint remoteClient) 61 public XmlRpcResponse GetLandData(XmlRpcRequest request, IPEndPoint remoteClient)
62 { 62 {
63 Hashtable requestData = (Hashtable)request.Params[0]; 63 Hashtable requestData = (Hashtable)request.Params[0];
64 ulong regionHandle = Convert.ToUInt64(requestData["region_handle"]); 64 ulong regionHandle = Convert.ToUInt64(requestData["region_handle"]);
65 uint x = Convert.ToUInt32(requestData["x"]); 65 uint x = Convert.ToUInt32(requestData["x"]);
66 uint y = Convert.ToUInt32(requestData["y"]); 66 uint y = Convert.ToUInt32(requestData["y"]);
67 m_log.DebugFormat("[LAND HANDLER]: Got request for land data at {0}, {1} for region {2}", x, y, regionHandle); 67 m_log.DebugFormat("[LAND HANDLER]: Got request for land data at {0}, {1} for region {2}", x, y, regionHandle);
68 68
69 LandData landData = m_LocalService.GetLandData(regionHandle, x, y); 69 LandData landData = m_LocalService.GetLandData(regionHandle, x, y);
70 Hashtable hash = new Hashtable(); 70 Hashtable hash = new Hashtable();
71 if (landData != null) 71 if (landData != null)
72 { 72 {
73 // for now, only push out the data we need for answering a ParcelInfoReqeust 73 // for now, only push out the data we need for answering a ParcelInfoReqeust
74 hash["AABBMax"] = landData.AABBMax.ToString(); 74 hash["AABBMax"] = landData.AABBMax.ToString();
75 hash["AABBMin"] = landData.AABBMin.ToString(); 75 hash["AABBMin"] = landData.AABBMin.ToString();
76 hash["Area"] = landData.Area.ToString(); 76 hash["Area"] = landData.Area.ToString();
77 hash["AuctionID"] = landData.AuctionID.ToString(); 77 hash["AuctionID"] = landData.AuctionID.ToString();
78 hash["Description"] = landData.Description; 78 hash["Description"] = landData.Description;
79 hash["Flags"] = landData.Flags.ToString(); 79 hash["Flags"] = landData.Flags.ToString();
80 hash["GlobalID"] = landData.GlobalID.ToString(); 80 hash["GlobalID"] = landData.GlobalID.ToString();
81 hash["Name"] = landData.Name; 81 hash["Name"] = landData.Name;
82 hash["OwnerID"] = landData.OwnerID.ToString(); 82 hash["OwnerID"] = landData.OwnerID.ToString();
83 hash["SalePrice"] = landData.SalePrice.ToString(); 83 hash["SalePrice"] = landData.SalePrice.ToString();
84 hash["SnapshotID"] = landData.SnapshotID.ToString(); 84 hash["SnapshotID"] = landData.SnapshotID.ToString();
85 hash["UserLocation"] = landData.UserLocation.ToString(); 85 hash["UserLocation"] = landData.UserLocation.ToString();
86 } 86 }
87 87
88 XmlRpcResponse response = new XmlRpcResponse(); 88 XmlRpcResponse response = new XmlRpcResponse();
89 response.Value = hash; 89 response.Value = hash;
90 return response; 90 return response;
91 } 91 }
92 } 92 }
93 93
94} 94}
diff --git a/OpenSim/Server/Handlers/Land/LandServiceInConnector.cs b/OpenSim/Server/Handlers/Land/LandServiceInConnector.cs
index f550b10..10e3b47 100644
--- a/OpenSim/Server/Handlers/Land/LandServiceInConnector.cs
+++ b/OpenSim/Server/Handlers/Land/LandServiceInConnector.cs
@@ -1,66 +1,66 @@
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
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Reflection; 30using System.Reflection;
31using log4net; 31using log4net;
32using Nini.Config; 32using Nini.Config;
33using OpenSim.Server.Base; 33using OpenSim.Server.Base;
34using OpenSim.Services.Interfaces; 34using OpenSim.Services.Interfaces;
35using OpenSim.Framework; 35using OpenSim.Framework;
36using OpenSim.Framework.Servers.HttpServer; 36using OpenSim.Framework.Servers.HttpServer;
37using OpenSim.Server.Handlers.Base; 37using OpenSim.Server.Handlers.Base;
38 38
39namespace OpenSim.Server.Handlers.Land 39namespace OpenSim.Server.Handlers.Land
40{ 40{
41 public class LandServiceInConnector : ServiceConnector 41 public class LandServiceInConnector : ServiceConnector
42 { 42 {
43 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 43 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
44 44
45 private ILandService m_LandService; 45 private ILandService m_LandService;
46 // TODO : private IAuthenticationService m_AuthenticationService; 46 // TODO : private IAuthenticationService m_AuthenticationService;
47 47
48 public LandServiceInConnector(IConfigSource source, IHttpServer server, ILandService service, IScene scene) : 48 public LandServiceInConnector(IConfigSource source, IHttpServer server, ILandService service, IScene scene) :
49 base(source, server) 49 base(source, server)
50 { 50 {
51 m_LandService = service; 51 m_LandService = service;
52 if (m_LandService == null) 52 if (m_LandService == null)
53 { 53 {
54 m_log.Error("[LAND IN CONNECTOR]: Land service was not provided"); 54 m_log.Error("[LAND IN CONNECTOR]: Land service was not provided");
55 return; 55 return;
56 } 56 }
57 57
58 //bool authentication = neighbourConfig.GetBoolean("RequireAuthentication", false); 58 //bool authentication = neighbourConfig.GetBoolean("RequireAuthentication", false);
59 //if (authentication) 59 //if (authentication)
60 // m_AuthenticationService = scene.RequestModuleInterface<IAuthenticationService>(); 60 // m_AuthenticationService = scene.RequestModuleInterface<IAuthenticationService>();
61 61
62 LandHandlers landHandlers = new LandHandlers(m_LandService); 62 LandHandlers landHandlers = new LandHandlers(m_LandService);
63 server.AddXmlRPCHandler("land_data", landHandlers.GetLandData, false); 63 server.AddXmlRPCHandler("land_data", landHandlers.GetLandData, false);
64 } 64 }
65 } 65 }
66} 66}
diff --git a/OpenSim/Services/Connectors/Asset/HGAssetServiceConnector.cs b/OpenSim/Services/Connectors/Asset/HGAssetServiceConnector.cs
index 31e0aa9..677169d 100644
--- a/OpenSim/Services/Connectors/Asset/HGAssetServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Asset/HGAssetServiceConnector.cs
@@ -1,178 +1,178 @@
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
28using log4net; 28using log4net;
29using Nini.Config; 29using Nini.Config;
30using System; 30using System;
31using System.Collections.Generic; 31using System.Collections.Generic;
32using System.Reflection; 32using System.Reflection;
33using OpenSim.Framework; 33using OpenSim.Framework;
34using OpenSim.Services.Interfaces; 34using OpenSim.Services.Interfaces;
35 35
36namespace OpenSim.Services.Connectors 36namespace OpenSim.Services.Connectors
37{ 37{
38 public class HGAssetServiceConnector : IAssetService 38 public class HGAssetServiceConnector : IAssetService
39 { 39 {
40 private static readonly ILog m_log = 40 private static readonly ILog m_log =
41 LogManager.GetLogger( 41 LogManager.GetLogger(
42 MethodBase.GetCurrentMethod().DeclaringType); 42 MethodBase.GetCurrentMethod().DeclaringType);
43 43
44 private Dictionary<string, AssetServicesConnector> m_connectors = new Dictionary<string, AssetServicesConnector>(); 44 private Dictionary<string, AssetServicesConnector> m_connectors = new Dictionary<string, AssetServicesConnector>();
45 45
46 public HGAssetServiceConnector(IConfigSource source) 46 public HGAssetServiceConnector(IConfigSource source)
47 { 47 {
48 IConfig moduleConfig = source.Configs["Modules"]; 48 IConfig moduleConfig = source.Configs["Modules"];
49 if (moduleConfig != null) 49 if (moduleConfig != null)
50 { 50 {
51 // string name = moduleConfig.GetString("AssetServices", ""); 51 // string name = moduleConfig.GetString("AssetServices", "");
52 52
53 IConfig assetConfig = source.Configs["AssetService"]; 53 IConfig assetConfig = source.Configs["AssetService"];
54 if (assetConfig == null) 54 if (assetConfig == null)
55 { 55 {
56 m_log.Error("[HG ASSET SERVICE]: AssetService missing from OpenSim.ini"); 56 m_log.Error("[HG ASSET SERVICE]: AssetService missing from OpenSim.ini");
57 return; 57 return;
58 } 58 }
59 59
60 m_log.Info("[HG ASSET SERVICE]: HG asset service enabled"); 60 m_log.Info("[HG ASSET SERVICE]: HG asset service enabled");
61 } 61 }
62 } 62 }
63 63
64 private bool StringToUrlAndAssetID(string id, out string url, out string assetID) 64 private bool StringToUrlAndAssetID(string id, out string url, out string assetID)
65 { 65 {
66 url = String.Empty; 66 url = String.Empty;
67 assetID = String.Empty; 67 assetID = String.Empty;
68 68
69 Uri assetUri; 69 Uri assetUri;
70 70
71 if (Uri.TryCreate(id, UriKind.Absolute, out assetUri) && 71 if (Uri.TryCreate(id, UriKind.Absolute, out assetUri) &&
72 assetUri.Scheme == Uri.UriSchemeHttp) 72 assetUri.Scheme == Uri.UriSchemeHttp)
73 { 73 {
74 url = "http://" + assetUri.Authority; 74 url = "http://" + assetUri.Authority;
75 assetID = assetUri.LocalPath.Trim(new char[] {'/'}); 75 assetID = assetUri.LocalPath.Trim(new char[] {'/'});
76 return true; 76 return true;
77 } 77 }
78 78
79 return false; 79 return false;
80 } 80 }
81 81
82 private IAssetService GetConnector(string url) 82 private IAssetService GetConnector(string url)
83 { 83 {
84 AssetServicesConnector connector = null; 84 AssetServicesConnector connector = null;
85 lock (m_connectors) 85 lock (m_connectors)
86 { 86 {
87 if (m_connectors.ContainsKey(url)) 87 if (m_connectors.ContainsKey(url))
88 { 88 {
89 connector = m_connectors[url]; 89 connector = m_connectors[url];
90 } 90 }
91 else 91 else
92 { 92 {
93 // We're instantiating this class explicitly, but this won't 93 // We're instantiating this class explicitly, but this won't
94 // work in general, because the remote grid may be running 94 // work in general, because the remote grid may be running
95 // an asset server that has a different protocol. 95 // an asset server that has a different protocol.
96 // Eventually we will want a piece of protocol asking 96 // Eventually we will want a piece of protocol asking
97 // the remote server about its kind. Definitely cool thing to do! 97 // the remote server about its kind. Definitely cool thing to do!
98 connector = new AssetServicesConnector(url); 98 connector = new AssetServicesConnector(url);
99 m_connectors.Add(url, connector); 99 m_connectors.Add(url, connector);
100 } 100 }
101 } 101 }
102 return connector; 102 return connector;
103 } 103 }
104 104
105 public AssetBase Get(string id) 105 public AssetBase Get(string id)
106 { 106 {
107 string url = string.Empty; 107 string url = string.Empty;
108 string assetID = string.Empty; 108 string assetID = string.Empty;
109 109
110 if (StringToUrlAndAssetID(id, out url, out assetID)) 110 if (StringToUrlAndAssetID(id, out url, out assetID))
111 { 111 {
112 IAssetService connector = GetConnector(url); 112 IAssetService connector = GetConnector(url);
113 return connector.Get(assetID); 113 return connector.Get(assetID);
114 } 114 }
115 115
116 return null; 116 return null;
117 } 117 }
118 118
119 public AssetMetadata GetMetadata(string id) 119 public AssetMetadata GetMetadata(string id)
120 { 120 {
121 string url = string.Empty; 121 string url = string.Empty;
122 string assetID = string.Empty; 122 string assetID = string.Empty;
123 123
124 if (StringToUrlAndAssetID(id, out url, out assetID)) 124 if (StringToUrlAndAssetID(id, out url, out assetID))
125 { 125 {
126 IAssetService connector = GetConnector(url); 126 IAssetService connector = GetConnector(url);
127 return connector.GetMetadata(assetID); 127 return connector.GetMetadata(assetID);
128 } 128 }
129 129
130 return null; 130 return null;
131 } 131 }
132 132
133 public byte[] GetData(string id) 133 public byte[] GetData(string id)
134 { 134 {
135 return null; 135 return null;
136 } 136 }
137 137
138 public bool Get(string id, Object sender, AssetRetrieved handler) 138 public bool Get(string id, Object sender, AssetRetrieved handler)
139 { 139 {
140 string url = string.Empty; 140 string url = string.Empty;
141 string assetID = string.Empty; 141 string assetID = string.Empty;
142 142
143 if (StringToUrlAndAssetID(id, out url, out assetID)) 143 if (StringToUrlAndAssetID(id, out url, out assetID))
144 { 144 {
145 IAssetService connector = GetConnector(url); 145 IAssetService connector = GetConnector(url);
146 return connector.Get(assetID, sender, handler); 146 return connector.Get(assetID, sender, handler);
147 } 147 }
148 148
149 return false; 149 return false;
150 } 150 }
151 151
152 public string Store(AssetBase asset) 152 public string Store(AssetBase asset)
153 { 153 {
154 string url = string.Empty; 154 string url = string.Empty;
155 string assetID = string.Empty; 155 string assetID = string.Empty;
156 156
157 if (StringToUrlAndAssetID(asset.ID, out url, out assetID)) 157 if (StringToUrlAndAssetID(asset.ID, out url, out assetID))
158 { 158 {
159 IAssetService connector = GetConnector(url); 159 IAssetService connector = GetConnector(url);
160 // Restore the assetID to a simple UUID 160 // Restore the assetID to a simple UUID
161 asset.ID = assetID; 161 asset.ID = assetID;
162 return connector.Store(asset); 162 return connector.Store(asset);
163 } 163 }
164 164
165 return String.Empty; 165 return String.Empty;
166 } 166 }
167 167
168 public bool UpdateContent(string id, byte[] data) 168 public bool UpdateContent(string id, byte[] data)
169 { 169 {
170 return false; 170 return false;
171 } 171 }
172 172
173 public bool Delete(string id) 173 public bool Delete(string id)
174 { 174 {
175 return false; 175 return false;
176 } 176 }
177 } 177 }
178} 178}
diff --git a/OpenSim/Services/Connectors/Inventory/HGInventoryServiceConnector.cs b/OpenSim/Services/Connectors/Inventory/HGInventoryServiceConnector.cs
index e943ae4..01e517c 100644
--- a/OpenSim/Services/Connectors/Inventory/HGInventoryServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Inventory/HGInventoryServiceConnector.cs
@@ -1,241 +1,241 @@
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
28using log4net; 28using log4net;
29using Nini.Config; 29using Nini.Config;
30using System; 30using System;
31using System.Collections.Generic; 31using System.Collections.Generic;
32using System.Reflection; 32using System.Reflection;
33using OpenSim.Framework; 33using OpenSim.Framework;
34using OpenSim.Services.Interfaces; 34using OpenSim.Services.Interfaces;
35using OpenMetaverse; 35using OpenMetaverse;
36 36
37namespace OpenSim.Services.Connectors.Inventory 37namespace OpenSim.Services.Connectors.Inventory
38{ 38{
39 public class HGInventoryServiceConnector : ISessionAuthInventoryService 39 public class HGInventoryServiceConnector : ISessionAuthInventoryService
40 { 40 {
41 private static readonly ILog m_log = 41 private static readonly ILog m_log =
42 LogManager.GetLogger( 42 LogManager.GetLogger(
43 MethodBase.GetCurrentMethod().DeclaringType); 43 MethodBase.GetCurrentMethod().DeclaringType);
44 44
45 private Dictionary<string, InventoryServicesConnector> m_connectors = new Dictionary<string, InventoryServicesConnector>(); 45 private Dictionary<string, InventoryServicesConnector> m_connectors = new Dictionary<string, InventoryServicesConnector>();
46 46
47 public HGInventoryServiceConnector(IConfigSource source) 47 public HGInventoryServiceConnector(IConfigSource source)
48 { 48 {
49 IConfig moduleConfig = source.Configs["Modules"]; 49 IConfig moduleConfig = source.Configs["Modules"];
50 if (moduleConfig != null) 50 if (moduleConfig != null)
51 { 51 {
52 52
53 IConfig inventoryConfig = source.Configs["InventoryService"]; 53 IConfig inventoryConfig = source.Configs["InventoryService"];
54 if (inventoryConfig == null) 54 if (inventoryConfig == null)
55 { 55 {
56 m_log.Error("[HG INVENTORY SERVICE]: InventoryService missing from OpenSim.ini"); 56 m_log.Error("[HG INVENTORY SERVICE]: InventoryService missing from OpenSim.ini");
57 return; 57 return;
58 } 58 }
59 59
60 m_log.Info("[HG INVENTORY SERVICE]: HG inventory service enabled"); 60 m_log.Info("[HG INVENTORY SERVICE]: HG inventory service enabled");
61 } 61 }
62 } 62 }
63 63
64 private bool StringToUrlAndUserID(string id, out string url, out string userID) 64 private bool StringToUrlAndUserID(string id, out string url, out string userID)
65 { 65 {
66 url = String.Empty; 66 url = String.Empty;
67 userID = String.Empty; 67 userID = String.Empty;
68 68
69 Uri assetUri; 69 Uri assetUri;
70 70
71 if (Uri.TryCreate(id, UriKind.Absolute, out assetUri) && 71 if (Uri.TryCreate(id, UriKind.Absolute, out assetUri) &&
72 assetUri.Scheme == Uri.UriSchemeHttp) 72 assetUri.Scheme == Uri.UriSchemeHttp)
73 { 73 {
74 url = "http://" + assetUri.Authority; 74 url = "http://" + assetUri.Authority;
75 userID = assetUri.LocalPath.Trim(new char[] { '/' }); 75 userID = assetUri.LocalPath.Trim(new char[] { '/' });
76 return true; 76 return true;
77 } 77 }
78 78
79 return false; 79 return false;
80 } 80 }
81 private ISessionAuthInventoryService GetConnector(string url) 81 private ISessionAuthInventoryService GetConnector(string url)
82 { 82 {
83 InventoryServicesConnector connector = null; 83 InventoryServicesConnector connector = null;
84 lock (m_connectors) 84 lock (m_connectors)
85 { 85 {
86 if (m_connectors.ContainsKey(url)) 86 if (m_connectors.ContainsKey(url))
87 { 87 {
88 connector = m_connectors[url]; 88 connector = m_connectors[url];
89 } 89 }
90 else 90 else
91 { 91 {
92 // We're instantiating this class explicitly, but this won't 92 // We're instantiating this class explicitly, but this won't
93 // work in general, because the remote grid may be running 93 // work in general, because the remote grid may be running
94 // an inventory server that has a different protocol. 94 // an inventory server that has a different protocol.
95 // Eventually we will want a piece of protocol asking 95 // Eventually we will want a piece of protocol asking
96 // the remote server about its kind. Definitely cool thing to do! 96 // the remote server about its kind. Definitely cool thing to do!
97 connector = new InventoryServicesConnector(url); 97 connector = new InventoryServicesConnector(url);
98 m_connectors.Add(url, connector); 98 m_connectors.Add(url, connector);
99 } 99 }
100 } 100 }
101 return connector; 101 return connector;
102 } 102 }
103 103
104 public string Host 104 public string Host
105 { 105 {
106 get { return string.Empty; } 106 get { return string.Empty; }
107 } 107 }
108 108
109 public void GetUserInventory(string id, UUID sessionID, InventoryReceiptCallback callback) 109 public void GetUserInventory(string id, UUID sessionID, InventoryReceiptCallback callback)
110 { 110 {
111 m_log.Debug("[HGInventory]: GetUserInventory " + id); 111 m_log.Debug("[HGInventory]: GetUserInventory " + id);
112 string url = string.Empty; 112 string url = string.Empty;
113 string userID = string.Empty; 113 string userID = string.Empty;
114 114
115 if (StringToUrlAndUserID(id, out url, out userID)) 115 if (StringToUrlAndUserID(id, out url, out userID))
116 { 116 {
117 ISessionAuthInventoryService connector = GetConnector(url); 117 ISessionAuthInventoryService connector = GetConnector(url);
118 connector.GetUserInventory(userID, sessionID, callback); 118 connector.GetUserInventory(userID, sessionID, callback);
119 } 119 }
120 120
121 } 121 }
122 122
123 public bool AddFolder(string id, InventoryFolderBase folder, UUID sessionID) 123 public bool AddFolder(string id, InventoryFolderBase folder, UUID sessionID)
124 { 124 {
125 string url = string.Empty; 125 string url = string.Empty;
126 string userID = string.Empty; 126 string userID = string.Empty;
127 127
128 if (StringToUrlAndUserID(id, out url, out userID)) 128 if (StringToUrlAndUserID(id, out url, out userID))
129 { 129 {
130 ISessionAuthInventoryService connector = GetConnector(url); 130 ISessionAuthInventoryService connector = GetConnector(url);
131 return connector.AddFolder(userID, folder, sessionID); 131 return connector.AddFolder(userID, folder, sessionID);
132 } 132 }
133 return false; 133 return false;
134 } 134 }
135 135
136 public bool UpdateFolder(string id, InventoryFolderBase folder, UUID sessionID) 136 public bool UpdateFolder(string id, InventoryFolderBase folder, UUID sessionID)
137 { 137 {
138 string url = string.Empty; 138 string url = string.Empty;
139 string userID = string.Empty; 139 string userID = string.Empty;
140 140
141 if (StringToUrlAndUserID(id, out url, out userID)) 141 if (StringToUrlAndUserID(id, out url, out userID))
142 { 142 {
143 ISessionAuthInventoryService connector = GetConnector(url); 143 ISessionAuthInventoryService connector = GetConnector(url);
144 return connector.UpdateFolder(userID, folder, sessionID); 144 return connector.UpdateFolder(userID, folder, sessionID);
145 } 145 }
146 return false; 146 return false;
147 } 147 }
148 148
149 public bool MoveFolder(string id, InventoryFolderBase folder, UUID sessionID) 149 public bool MoveFolder(string id, InventoryFolderBase folder, UUID sessionID)
150 { 150 {
151 string url = string.Empty; 151 string url = string.Empty;
152 string userID = string.Empty; 152 string userID = string.Empty;
153 153
154 if (StringToUrlAndUserID(id, out url, out userID)) 154 if (StringToUrlAndUserID(id, out url, out userID))
155 { 155 {
156 ISessionAuthInventoryService connector = GetConnector(url); 156 ISessionAuthInventoryService connector = GetConnector(url);
157 return connector.MoveFolder(userID, folder, sessionID); 157 return connector.MoveFolder(userID, folder, sessionID);
158 } 158 }
159 return false; 159 return false;
160 } 160 }
161 161
162 public bool PurgeFolder(string id, InventoryFolderBase folder, UUID sessionID) 162 public bool PurgeFolder(string id, InventoryFolderBase folder, UUID sessionID)
163 { 163 {
164 string url = string.Empty; 164 string url = string.Empty;
165 string userID = string.Empty; 165 string userID = string.Empty;
166 166
167 if (StringToUrlAndUserID(id, out url, out userID)) 167 if (StringToUrlAndUserID(id, out url, out userID))
168 { 168 {
169 ISessionAuthInventoryService connector = GetConnector(url); 169 ISessionAuthInventoryService connector = GetConnector(url);
170 return connector.PurgeFolder(userID, folder, sessionID); 170 return connector.PurgeFolder(userID, folder, sessionID);
171 } 171 }
172 return false; 172 return false;
173 } 173 }
174 174
175 public bool AddItem(string id, InventoryItemBase item, UUID sessionID) 175 public bool AddItem(string id, InventoryItemBase item, UUID sessionID)
176 { 176 {
177 string url = string.Empty; 177 string url = string.Empty;
178 string userID = string.Empty; 178 string userID = string.Empty;
179 179
180 if (StringToUrlAndUserID(id, out url, out userID)) 180 if (StringToUrlAndUserID(id, out url, out userID))
181 { 181 {
182 ISessionAuthInventoryService connector = GetConnector(url); 182 ISessionAuthInventoryService connector = GetConnector(url);
183 return connector.AddItem(userID, item, sessionID); 183 return connector.AddItem(userID, item, sessionID);
184 } 184 }
185 return false; 185 return false;
186 } 186 }
187 187
188 public bool UpdateItem(string id, InventoryItemBase item, UUID sessionID) 188 public bool UpdateItem(string id, InventoryItemBase item, UUID sessionID)
189 { 189 {
190 string url = string.Empty; 190 string url = string.Empty;
191 string userID = string.Empty; 191 string userID = string.Empty;
192 192
193 if (StringToUrlAndUserID(id, out url, out userID)) 193 if (StringToUrlAndUserID(id, out url, out userID))
194 { 194 {
195 ISessionAuthInventoryService connector = GetConnector(url); 195 ISessionAuthInventoryService connector = GetConnector(url);
196 return connector.UpdateItem(userID, item, sessionID); 196 return connector.UpdateItem(userID, item, sessionID);
197 } 197 }
198 return false; 198 return false;
199 } 199 }
200 200
201 public bool DeleteItem(string id, InventoryItemBase item, UUID sessionID) 201 public bool DeleteItem(string id, InventoryItemBase item, UUID sessionID)
202 { 202 {
203 string url = string.Empty; 203 string url = string.Empty;
204 string userID = string.Empty; 204 string userID = string.Empty;
205 205
206 if (StringToUrlAndUserID(id, out url, out userID)) 206 if (StringToUrlAndUserID(id, out url, out userID))
207 { 207 {
208 ISessionAuthInventoryService connector = GetConnector(url); 208 ISessionAuthInventoryService connector = GetConnector(url);
209 return connector.UpdateItem(userID, item, sessionID); 209 return connector.UpdateItem(userID, item, sessionID);
210 } 210 }
211 return false; 211 return false;
212 } 212 }
213 213
214 public InventoryItemBase QueryItem(string id, InventoryItemBase item, UUID sessionID) 214 public InventoryItemBase QueryItem(string id, InventoryItemBase item, UUID sessionID)
215 { 215 {
216 string url = string.Empty; 216 string url = string.Empty;
217 string userID = string.Empty; 217 string userID = string.Empty;
218 218
219 if (StringToUrlAndUserID(id, out url, out userID)) 219 if (StringToUrlAndUserID(id, out url, out userID))
220 { 220 {
221 ISessionAuthInventoryService connector = GetConnector(url); 221 ISessionAuthInventoryService connector = GetConnector(url);
222 return connector.QueryItem(userID, item, sessionID); 222 return connector.QueryItem(userID, item, sessionID);
223 } 223 }
224 return null; 224 return null;
225 } 225 }
226 226
227 public InventoryFolderBase QueryFolder(string id, InventoryFolderBase folder, UUID sessionID) 227 public InventoryFolderBase QueryFolder(string id, InventoryFolderBase folder, UUID sessionID)
228 { 228 {
229 string url = string.Empty; 229 string url = string.Empty;
230 string userID = string.Empty; 230 string userID = string.Empty;
231 231
232 if (StringToUrlAndUserID(id, out url, out userID)) 232 if (StringToUrlAndUserID(id, out url, out userID))
233 { 233 {
234 ISessionAuthInventoryService connector = GetConnector(url); 234 ISessionAuthInventoryService connector = GetConnector(url);
235 return connector.QueryFolder(userID, folder, sessionID); 235 return connector.QueryFolder(userID, folder, sessionID);
236 } 236 }
237 return null; 237 return null;
238 } 238 }
239 239
240 } 240 }
241} 241}
diff --git a/OpenSim/Services/Connectors/Land/LandServiceConnector.cs b/OpenSim/Services/Connectors/Land/LandServiceConnector.cs
index e9375f5..0243f1f 100644
--- a/OpenSim/Services/Connectors/Land/LandServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Land/LandServiceConnector.cs
@@ -1,125 +1,125 @@
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
28using log4net; 28using log4net;
29using System; 29using System;
30using System.Collections; 30using System.Collections;
31using System.Collections.Generic; 31using System.Collections.Generic;
32using System.IO; 32using System.IO;
33using System.Reflection; 33using System.Reflection;
34using Nini.Config; 34using Nini.Config;
35using OpenSim.Framework; 35using OpenSim.Framework;
36using OpenSim.Framework.Communications; 36using OpenSim.Framework.Communications;
37using OpenSim.Framework.Servers.HttpServer; 37using OpenSim.Framework.Servers.HttpServer;
38using OpenSim.Services.Interfaces; 38using OpenSim.Services.Interfaces;
39using OpenMetaverse; 39using OpenMetaverse;
40using Nwc.XmlRpc; 40using Nwc.XmlRpc;
41 41
42namespace OpenSim.Services.Connectors 42namespace OpenSim.Services.Connectors
43{ 43{
44 public class LandServicesConnector : ILandService 44 public class LandServicesConnector : ILandService
45 { 45 {
46 private static readonly ILog m_log = 46 private static readonly ILog m_log =
47 LogManager.GetLogger( 47 LogManager.GetLogger(
48 MethodBase.GetCurrentMethod().DeclaringType); 48 MethodBase.GetCurrentMethod().DeclaringType);
49 49
50 protected IGridServices m_MapService = null; 50 protected IGridServices m_MapService = null;
51 51
52 public LandServicesConnector() 52 public LandServicesConnector()
53 { 53 {
54 } 54 }
55 55
56 public LandServicesConnector(IGridServices gridServices) 56 public LandServicesConnector(IGridServices gridServices)
57 { 57 {
58 Initialise(gridServices); 58 Initialise(gridServices);
59 } 59 }
60 60
61 public virtual void Initialise(IGridServices gridServices) 61 public virtual void Initialise(IGridServices gridServices)
62 { 62 {
63 m_MapService = gridServices; 63 m_MapService = gridServices;
64 } 64 }
65 65
66 public virtual LandData GetLandData(ulong regionHandle, uint x, uint y) 66 public virtual LandData GetLandData(ulong regionHandle, uint x, uint y)
67 { 67 {
68 LandData landData = null; 68 LandData landData = null;
69 Hashtable hash = new Hashtable(); 69 Hashtable hash = new Hashtable();
70 hash["region_handle"] = regionHandle.ToString(); 70 hash["region_handle"] = regionHandle.ToString();
71 hash["x"] = x.ToString(); 71 hash["x"] = x.ToString();
72 hash["y"] = y.ToString(); 72 hash["y"] = y.ToString();
73 73
74 IList paramList = new ArrayList(); 74 IList paramList = new ArrayList();
75 paramList.Add(hash); 75 paramList.Add(hash);
76 76
77 try 77 try
78 { 78 {
79 RegionInfo info = m_MapService.RequestNeighbourInfo(regionHandle); 79 RegionInfo info = m_MapService.RequestNeighbourInfo(regionHandle);
80 if (info != null) // just to be sure 80 if (info != null) // just to be sure
81 { 81 {
82 XmlRpcRequest request = new XmlRpcRequest("land_data", paramList); 82 XmlRpcRequest request = new XmlRpcRequest("land_data", paramList);
83 string uri = "http://" + info.ExternalEndPoint.Address + ":" + info.HttpPort + "/"; 83 string uri = "http://" + info.ExternalEndPoint.Address + ":" + info.HttpPort + "/";
84 XmlRpcResponse response = request.Send(uri, 10000); 84 XmlRpcResponse response = request.Send(uri, 10000);
85 if (response.IsFault) 85 if (response.IsFault)
86 { 86 {
87 m_log.ErrorFormat("[LAND CONNECTOR] remote call returned an error: {0}", response.FaultString); 87 m_log.ErrorFormat("[LAND CONNECTOR] remote call returned an error: {0}", response.FaultString);
88 } 88 }
89 else 89 else
90 { 90 {
91 hash = (Hashtable)response.Value; 91 hash = (Hashtable)response.Value;
92 try 92 try
93 { 93 {
94 landData = new LandData(); 94 landData = new LandData();
95 landData.AABBMax = Vector3.Parse((string)hash["AABBMax"]); 95 landData.AABBMax = Vector3.Parse((string)hash["AABBMax"]);
96 landData.AABBMin = Vector3.Parse((string)hash["AABBMin"]); 96 landData.AABBMin = Vector3.Parse((string)hash["AABBMin"]);
97 landData.Area = Convert.ToInt32(hash["Area"]); 97 landData.Area = Convert.ToInt32(hash["Area"]);
98 landData.AuctionID = Convert.ToUInt32(hash["AuctionID"]); 98 landData.AuctionID = Convert.ToUInt32(hash["AuctionID"]);
99 landData.Description = (string)hash["Description"]; 99 landData.Description = (string)hash["Description"];
100 landData.Flags = Convert.ToUInt32(hash["Flags"]); 100 landData.Flags = Convert.ToUInt32(hash["Flags"]);
101 landData.GlobalID = new UUID((string)hash["GlobalID"]); 101 landData.GlobalID = new UUID((string)hash["GlobalID"]);
102 landData.Name = (string)hash["Name"]; 102 landData.Name = (string)hash["Name"];
103 landData.OwnerID = new UUID((string)hash["OwnerID"]); 103 landData.OwnerID = new UUID((string)hash["OwnerID"]);
104 landData.SalePrice = Convert.ToInt32(hash["SalePrice"]); 104 landData.SalePrice = Convert.ToInt32(hash["SalePrice"]);
105 landData.SnapshotID = new UUID((string)hash["SnapshotID"]); 105 landData.SnapshotID = new UUID((string)hash["SnapshotID"]);
106 landData.UserLocation = Vector3.Parse((string)hash["UserLocation"]); 106 landData.UserLocation = Vector3.Parse((string)hash["UserLocation"]);
107 m_log.DebugFormat("[OGS1 GRID SERVICES] Got land data for parcel {0}", landData.Name); 107 m_log.DebugFormat("[OGS1 GRID SERVICES] Got land data for parcel {0}", landData.Name);
108 } 108 }
109 catch (Exception e) 109 catch (Exception e)
110 { 110 {
111 m_log.Error("[LAND CONNECTOR] Got exception while parsing land-data:", e); 111 m_log.Error("[LAND CONNECTOR] Got exception while parsing land-data:", e);
112 } 112 }
113 } 113 }
114 } 114 }
115 else m_log.WarnFormat("[LAND CONNECTOR] Couldn't find region with handle {0}", regionHandle); 115 else m_log.WarnFormat("[LAND CONNECTOR] Couldn't find region with handle {0}", regionHandle);
116 } 116 }
117 catch (Exception e) 117 catch (Exception e)
118 { 118 {
119 m_log.ErrorFormat("[LAND CONNECTOR] Couldn't contact region {0}: {1}", regionHandle, e); 119 m_log.ErrorFormat("[LAND CONNECTOR] Couldn't contact region {0}: {1}", regionHandle, e);
120 } 120 }
121 121
122 return landData; 122 return landData;
123 } 123 }
124 } 124 }
125} 125}
diff --git a/OpenSim/Services/Interfaces/ILandService.cs b/OpenSim/Services/Interfaces/ILandService.cs
index 51cc93b..e2f1d1d 100644
--- a/OpenSim/Services/Interfaces/ILandService.cs
+++ b/OpenSim/Services/Interfaces/ILandService.cs
@@ -1,38 +1,38 @@
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
28using System; 28using System;
29using OpenSim.Framework; 29using OpenSim.Framework;
30using OpenMetaverse; 30using OpenMetaverse;
31 31
32namespace OpenSim.Services.Interfaces 32namespace OpenSim.Services.Interfaces
33{ 33{
34 public interface ILandService 34 public interface ILandService
35 { 35 {
36 LandData GetLandData(ulong regionHandle, uint x, uint y); 36 LandData GetLandData(ulong regionHandle, uint x, uint y);
37 } 37 }
38} 38}