aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Server
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Server')
-rw-r--r--OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs93
1 files changed, 66 insertions, 27 deletions
diff --git a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs
index 7164520..16b05df 100644
--- a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs
+++ b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs
@@ -91,7 +91,7 @@ namespace OpenSim.Server.Handlers.Asset
91 sr.Close(); 91 sr.Close();
92 body = body.Trim(); 92 body = body.Trim();
93 93
94 m_log.DebugFormat("[XXX]: query String: {0}", body); 94 //m_log.DebugFormat("[XXX]: query String: {0}", body);
95 95
96 try 96 try
97 { 97 {
@@ -213,7 +213,7 @@ namespace OpenSim.Server.Handlers.Asset
213 result["RESULT"] = "False"; 213 result["RESULT"] = "False";
214 214
215 string xmlString = ServerUtils.BuildXmlResponse(result); 215 string xmlString = ServerUtils.BuildXmlResponse(result);
216 m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); 216 //m_log.DebugFormat("[XXX]: resp string: {0}", xmlString);
217 UTF8Encoding encoding = new UTF8Encoding(); 217 UTF8Encoding encoding = new UTF8Encoding();
218 return encoding.GetBytes(xmlString); 218 return encoding.GetBytes(xmlString);
219 } 219 }
@@ -228,12 +228,20 @@ namespace OpenSim.Server.Handlers.Asset
228 228
229 List<InventoryFolderBase> folders = m_InventoryService.GetInventorySkeleton(new UUID(request["PRINCIPAL"].ToString())); 229 List<InventoryFolderBase> folders = m_InventoryService.GetInventorySkeleton(new UUID(request["PRINCIPAL"].ToString()));
230 230
231 Dictionary<string, object> sfolders = new Dictionary<string, object>();
231 if (folders != null) 232 if (folders != null)
233 {
234 int i = 0;
232 foreach (InventoryFolderBase f in folders) 235 foreach (InventoryFolderBase f in folders)
233 result[f.ID.ToString()] = EncodeFolder(f); 236 {
237 sfolders["folder_" + i.ToString()] = EncodeFolder(f);
238 i++;
239 }
240 }
241 result["FOLDERS"] = sfolders;
234 242
235 string xmlString = ServerUtils.BuildXmlResponse(result); 243 string xmlString = ServerUtils.BuildXmlResponse(result);
236 m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); 244 //m_log.DebugFormat("[XXX]: resp string: {0}", xmlString);
237 UTF8Encoding encoding = new UTF8Encoding(); 245 UTF8Encoding encoding = new UTF8Encoding();
238 return encoding.GetBytes(xmlString); 246 return encoding.GetBytes(xmlString);
239 } 247 }
@@ -246,10 +254,10 @@ namespace OpenSim.Server.Handlers.Asset
246 UUID.TryParse(request["PRINCIPAL"].ToString(), out principal); 254 UUID.TryParse(request["PRINCIPAL"].ToString(), out principal);
247 InventoryFolderBase rfolder = m_InventoryService.GetRootFolder(principal); 255 InventoryFolderBase rfolder = m_InventoryService.GetRootFolder(principal);
248 if (rfolder != null) 256 if (rfolder != null)
249 result[rfolder.ID.ToString()] = EncodeFolder(rfolder); 257 result["folder"] = EncodeFolder(rfolder);
250 258
251 string xmlString = ServerUtils.BuildXmlResponse(result); 259 string xmlString = ServerUtils.BuildXmlResponse(result);
252 m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); 260 //m_log.DebugFormat("[XXX]: resp string: {0}", xmlString);
253 UTF8Encoding encoding = new UTF8Encoding(); 261 UTF8Encoding encoding = new UTF8Encoding();
254 return encoding.GetBytes(xmlString); 262 return encoding.GetBytes(xmlString);
255 } 263 }
@@ -263,10 +271,10 @@ namespace OpenSim.Server.Handlers.Asset
263 Int32.TryParse(request["TYPE"].ToString(), out type); 271 Int32.TryParse(request["TYPE"].ToString(), out type);
264 InventoryFolderBase folder = m_InventoryService.GetFolderForType(principal, (AssetType)type); 272 InventoryFolderBase folder = m_InventoryService.GetFolderForType(principal, (AssetType)type);
265 if (folder != null) 273 if (folder != null)
266 result[folder.ID.ToString()] = EncodeFolder(folder); 274 result["folder"] = EncodeFolder(folder);
267 275
268 string xmlString = ServerUtils.BuildXmlResponse(result); 276 string xmlString = ServerUtils.BuildXmlResponse(result);
269 m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); 277 //m_log.DebugFormat("[XXX]: resp string: {0}", xmlString);
270 UTF8Encoding encoding = new UTF8Encoding(); 278 UTF8Encoding encoding = new UTF8Encoding();
271 return encoding.GetBytes(xmlString); 279 return encoding.GetBytes(xmlString);
272 } 280 }
@@ -283,18 +291,26 @@ namespace OpenSim.Server.Handlers.Asset
283 if (icoll != null) 291 if (icoll != null)
284 { 292 {
285 Dictionary<string, object> folders = new Dictionary<string, object>(); 293 Dictionary<string, object> folders = new Dictionary<string, object>();
294 int i = 0;
286 foreach (InventoryFolderBase f in icoll.Folders) 295 foreach (InventoryFolderBase f in icoll.Folders)
287 folders[f.ID.ToString()] = EncodeFolder(f); 296 {
297 folders["folder_" + i.ToString()] = EncodeFolder(f);
298 i++;
299 }
288 result["FOLDERS"] = folders; 300 result["FOLDERS"] = folders;
289 301
302 i = 0;
290 Dictionary<string, object> items = new Dictionary<string, object>(); 303 Dictionary<string, object> items = new Dictionary<string, object>();
291 foreach (InventoryItemBase i in icoll.Items) 304 foreach (InventoryItemBase it in icoll.Items)
292 items[i.ID.ToString()] = EncodeItem(i); 305 {
306 items["item_" + i.ToString()] = EncodeItem(it);
307 i++;
308 }
293 result["ITEMS"] = items; 309 result["ITEMS"] = items;
294 } 310 }
295 311
296 string xmlString = ServerUtils.BuildXmlResponse(result); 312 string xmlString = ServerUtils.BuildXmlResponse(result);
297 m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); 313 //m_log.DebugFormat("[XXX]: resp string: {0}", xmlString);
298 UTF8Encoding encoding = new UTF8Encoding(); 314 UTF8Encoding encoding = new UTF8Encoding();
299 return encoding.GetBytes(xmlString); 315 return encoding.GetBytes(xmlString);
300 } 316 }
@@ -308,12 +324,21 @@ namespace OpenSim.Server.Handlers.Asset
308 UUID.TryParse(request["FOLDER"].ToString(), out folderID); 324 UUID.TryParse(request["FOLDER"].ToString(), out folderID);
309 325
310 List<InventoryItemBase> items = m_InventoryService.GetFolderItems(principal, folderID); 326 List<InventoryItemBase> items = m_InventoryService.GetFolderItems(principal, folderID);
327 Dictionary<string, object> sitems = new Dictionary<string, object>();
328
311 if (items != null) 329 if (items != null)
330 {
331 int i = 0;
312 foreach (InventoryItemBase item in items) 332 foreach (InventoryItemBase item in items)
313 result[item.ID.ToString()] = EncodeItem(item); 333 {
334 sitems["item_" + i.ToString()] = EncodeItem(item);
335 i++;
336 }
337 }
338 result["ITEMS"] = sitems;
314 339
315 string xmlString = ServerUtils.BuildXmlResponse(result); 340 string xmlString = ServerUtils.BuildXmlResponse(result);
316 m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); 341 //m_log.DebugFormat("[XXX]: resp string: {0}", xmlString);
317 UTF8Encoding encoding = new UTF8Encoding(); 342 UTF8Encoding encoding = new UTF8Encoding();
318 return encoding.GetBytes(xmlString); 343 return encoding.GetBytes(xmlString);
319 } 344 }
@@ -483,10 +508,10 @@ namespace OpenSim.Server.Handlers.Asset
483 InventoryItemBase item = new InventoryItemBase(id); 508 InventoryItemBase item = new InventoryItemBase(id);
484 item = m_InventoryService.GetItem(item); 509 item = m_InventoryService.GetItem(item);
485 if (item != null) 510 if (item != null)
486 result[item.ID.ToString()] = EncodeItem(item); 511 result["item"] = EncodeItem(item);
487 512
488 string xmlString = ServerUtils.BuildXmlResponse(result); 513 string xmlString = ServerUtils.BuildXmlResponse(result);
489 m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); 514 //m_log.DebugFormat("[XXX]: resp string: {0}", xmlString);
490 UTF8Encoding encoding = new UTF8Encoding(); 515 UTF8Encoding encoding = new UTF8Encoding();
491 return encoding.GetBytes(xmlString); 516 return encoding.GetBytes(xmlString);
492 } 517 }
@@ -500,10 +525,10 @@ namespace OpenSim.Server.Handlers.Asset
500 InventoryFolderBase folder = new InventoryFolderBase(id); 525 InventoryFolderBase folder = new InventoryFolderBase(id);
501 folder = m_InventoryService.GetFolder(folder); 526 folder = m_InventoryService.GetFolder(folder);
502 if (folder != null) 527 if (folder != null)
503 result[folder.ID.ToString()] = EncodeFolder(folder); 528 result["folder"] = EncodeFolder(folder);
504 529
505 string xmlString = ServerUtils.BuildXmlResponse(result); 530 string xmlString = ServerUtils.BuildXmlResponse(result);
506 m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); 531 //m_log.DebugFormat("[XXX]: resp string: {0}", xmlString);
507 UTF8Encoding encoding = new UTF8Encoding(); 532 UTF8Encoding encoding = new UTF8Encoding();
508 return encoding.GetBytes(xmlString); 533 return encoding.GetBytes(xmlString);
509 } 534 }
@@ -515,12 +540,20 @@ namespace OpenSim.Server.Handlers.Asset
515 UUID.TryParse(request["PRINCIPAL"].ToString(), out principal); 540 UUID.TryParse(request["PRINCIPAL"].ToString(), out principal);
516 541
517 List<InventoryItemBase> gestures = m_InventoryService.GetActiveGestures(principal); 542 List<InventoryItemBase> gestures = m_InventoryService.GetActiveGestures(principal);
543 Dictionary<string, object> items = new Dictionary<string, object>();
518 if (gestures != null) 544 if (gestures != null)
545 {
546 int i = 0;
519 foreach (InventoryItemBase item in gestures) 547 foreach (InventoryItemBase item in gestures)
520 result[item.ID.ToString()] = EncodeItem(item); 548 {
549 items["item_" + i.ToString()] = EncodeItem(item);
550 i++;
551 }
552 }
553 result["ITEMS"] = items;
521 554
522 string xmlString = ServerUtils.BuildXmlResponse(result); 555 string xmlString = ServerUtils.BuildXmlResponse(result);
523 m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); 556 //m_log.DebugFormat("[XXX]: resp string: {0}", xmlString);
524 UTF8Encoding encoding = new UTF8Encoding(); 557 UTF8Encoding encoding = new UTF8Encoding();
525 return encoding.GetBytes(xmlString); 558 return encoding.GetBytes(xmlString);
526 } 559 }
@@ -537,7 +570,7 @@ namespace OpenSim.Server.Handlers.Asset
537 570
538 result["RESULT"] = perms.ToString(); 571 result["RESULT"] = perms.ToString();
539 string xmlString = ServerUtils.BuildXmlResponse(result); 572 string xmlString = ServerUtils.BuildXmlResponse(result);
540 m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); 573 //m_log.DebugFormat("[XXX]: resp string: {0}", xmlString);
541 UTF8Encoding encoding = new UTF8Encoding(); 574 UTF8Encoding encoding = new UTF8Encoding();
542 return encoding.GetBytes(xmlString); 575 return encoding.GetBytes(xmlString);
543 } 576 }
@@ -549,13 +582,19 @@ namespace OpenSim.Server.Handlers.Asset
549 UUID.TryParse(request["PRINCIPAL"].ToString(), out principal); 582 UUID.TryParse(request["PRINCIPAL"].ToString(), out principal);
550 583
551 Dictionary<AssetType, InventoryFolderBase> sfolders = GetSystemFolders(principal); 584 Dictionary<AssetType, InventoryFolderBase> sfolders = GetSystemFolders(principal);
585 //m_log.DebugFormat("[XXX]: SystemFolders got {0} folders", sfolders.Count);
552 586
553 if (sfolders != null) 587 Dictionary<string, object> folders = new Dictionary<string, object>();
554 foreach (KeyValuePair<AssetType, InventoryFolderBase> kvp in sfolders) 588 int i = 0;
555 result[kvp.Key.ToString()] = EncodeFolder(kvp.Value); 589 foreach (KeyValuePair<AssetType, InventoryFolderBase> kvp in sfolders)
590 {
591 folders["folder_" + i.ToString()] = EncodeFolder(kvp.Value);
592 i++;
593 }
594 result["FOLDERS"] = folders;
556 595
557 string xmlString = ServerUtils.BuildXmlResponse(result); 596 string xmlString = ServerUtils.BuildXmlResponse(result);
558 m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); 597 //m_log.DebugFormat("[XXX]: resp string: {0}", xmlString);
559 UTF8Encoding encoding = new UTF8Encoding(); 598 UTF8Encoding encoding = new UTF8Encoding();
560 return encoding.GetBytes(xmlString); 599 return encoding.GetBytes(xmlString);
561 } 600 }
@@ -589,7 +628,7 @@ namespace OpenSim.Server.Handlers.Asset
589 ret["Flags"] = item.Flags.ToString(); 628 ret["Flags"] = item.Flags.ToString();
590 ret["Folder"] = item.Folder.ToString(); 629 ret["Folder"] = item.Folder.ToString();
591 ret["GroupID"] = item.GroupID.ToString(); 630 ret["GroupID"] = item.GroupID.ToString();
592 ret["GroupedOwned"] = item.GroupOwned.ToString(); 631 ret["GroupOwned"] = item.GroupOwned.ToString();
593 ret["GroupPermissions"] = item.GroupPermissions.ToString(); 632 ret["GroupPermissions"] = item.GroupPermissions.ToString();
594 ret["ID"] = item.ID.ToString(); 633 ret["ID"] = item.ID.ToString();
595 ret["InvType"] = item.InvType.ToString(); 634 ret["InvType"] = item.InvType.ToString();
@@ -664,7 +703,7 @@ namespace OpenSim.Server.Handlers.Asset
664 return folders; 703 return folders;
665 } 704 }
666 } 705 }
667 m_log.WarnFormat("[INVENTORY SERVICE]: System folders for {0} not found", userID); 706 m_log.WarnFormat("[XINVENTORY SERVICE]: System folders for {0} not found", userID);
668 return new Dictionary<AssetType, InventoryFolderBase>(); 707 return new Dictionary<AssetType, InventoryFolderBase>();
669 } 708 }
670 #endregion 709 #endregion