diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs | 131 | ||||
-rw-r--r-- | OpenSim/Server/Handlers/Login/LLLoginHandlers.cs | 12 |
2 files changed, 118 insertions, 25 deletions
diff --git a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs index 34f7dcc..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 | { |
@@ -144,6 +144,8 @@ namespace OpenSim.Server.Handlers.Asset | |||
144 | return HandleGetActiveGestures(request); | 144 | return HandleGetActiveGestures(request); |
145 | case "GETASSETPERMISSIONS": | 145 | case "GETASSETPERMISSIONS": |
146 | return HandleGetAssetPermissions(request); | 146 | return HandleGetAssetPermissions(request); |
147 | case "GETSYSTEMFOLDERS": | ||
148 | return HandleGetSystemFolders(request); | ||
147 | } | 149 | } |
148 | m_log.DebugFormat("[XINVENTORY HANDLER]: unknown method request: {0}", method); | 150 | m_log.DebugFormat("[XINVENTORY HANDLER]: unknown method request: {0}", method); |
149 | } | 151 | } |
@@ -197,7 +199,7 @@ namespace OpenSim.Server.Handlers.Asset | |||
197 | 199 | ||
198 | return ms.ToArray(); | 200 | return ms.ToArray(); |
199 | } | 201 | } |
200 | 202 | ||
201 | byte[] HandleCreateUserInventory(Dictionary<string,object> request) | 203 | byte[] HandleCreateUserInventory(Dictionary<string,object> request) |
202 | { | 204 | { |
203 | Dictionary<string,object> result = new Dictionary<string,object>(); | 205 | Dictionary<string,object> result = new Dictionary<string,object>(); |
@@ -211,7 +213,7 @@ namespace OpenSim.Server.Handlers.Asset | |||
211 | result["RESULT"] = "False"; | 213 | result["RESULT"] = "False"; |
212 | 214 | ||
213 | string xmlString = ServerUtils.BuildXmlResponse(result); | 215 | string xmlString = ServerUtils.BuildXmlResponse(result); |
214 | m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); | 216 | //m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); |
215 | UTF8Encoding encoding = new UTF8Encoding(); | 217 | UTF8Encoding encoding = new UTF8Encoding(); |
216 | return encoding.GetBytes(xmlString); | 218 | return encoding.GetBytes(xmlString); |
217 | } | 219 | } |
@@ -226,12 +228,20 @@ namespace OpenSim.Server.Handlers.Asset | |||
226 | 228 | ||
227 | List<InventoryFolderBase> folders = m_InventoryService.GetInventorySkeleton(new UUID(request["PRINCIPAL"].ToString())); | 229 | List<InventoryFolderBase> folders = m_InventoryService.GetInventorySkeleton(new UUID(request["PRINCIPAL"].ToString())); |
228 | 230 | ||
231 | Dictionary<string, object> sfolders = new Dictionary<string, object>(); | ||
229 | if (folders != null) | 232 | if (folders != null) |
233 | { | ||
234 | int i = 0; | ||
230 | foreach (InventoryFolderBase f in folders) | 235 | foreach (InventoryFolderBase f in folders) |
231 | result[f.ID.ToString()] = EncodeFolder(f); | 236 | { |
237 | sfolders["folder_" + i.ToString()] = EncodeFolder(f); | ||
238 | i++; | ||
239 | } | ||
240 | } | ||
241 | result["FOLDERS"] = sfolders; | ||
232 | 242 | ||
233 | string xmlString = ServerUtils.BuildXmlResponse(result); | 243 | string xmlString = ServerUtils.BuildXmlResponse(result); |
234 | m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); | 244 | //m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); |
235 | UTF8Encoding encoding = new UTF8Encoding(); | 245 | UTF8Encoding encoding = new UTF8Encoding(); |
236 | return encoding.GetBytes(xmlString); | 246 | return encoding.GetBytes(xmlString); |
237 | } | 247 | } |
@@ -244,10 +254,10 @@ namespace OpenSim.Server.Handlers.Asset | |||
244 | UUID.TryParse(request["PRINCIPAL"].ToString(), out principal); | 254 | UUID.TryParse(request["PRINCIPAL"].ToString(), out principal); |
245 | InventoryFolderBase rfolder = m_InventoryService.GetRootFolder(principal); | 255 | InventoryFolderBase rfolder = m_InventoryService.GetRootFolder(principal); |
246 | if (rfolder != null) | 256 | if (rfolder != null) |
247 | result[rfolder.ID.ToString()] = EncodeFolder(rfolder); | 257 | result["folder"] = EncodeFolder(rfolder); |
248 | 258 | ||
249 | string xmlString = ServerUtils.BuildXmlResponse(result); | 259 | string xmlString = ServerUtils.BuildXmlResponse(result); |
250 | m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); | 260 | //m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); |
251 | UTF8Encoding encoding = new UTF8Encoding(); | 261 | UTF8Encoding encoding = new UTF8Encoding(); |
252 | return encoding.GetBytes(xmlString); | 262 | return encoding.GetBytes(xmlString); |
253 | } | 263 | } |
@@ -261,10 +271,10 @@ namespace OpenSim.Server.Handlers.Asset | |||
261 | Int32.TryParse(request["TYPE"].ToString(), out type); | 271 | Int32.TryParse(request["TYPE"].ToString(), out type); |
262 | InventoryFolderBase folder = m_InventoryService.GetFolderForType(principal, (AssetType)type); | 272 | InventoryFolderBase folder = m_InventoryService.GetFolderForType(principal, (AssetType)type); |
263 | if (folder != null) | 273 | if (folder != null) |
264 | result[folder.ID.ToString()] = EncodeFolder(folder); | 274 | result["folder"] = EncodeFolder(folder); |
265 | 275 | ||
266 | string xmlString = ServerUtils.BuildXmlResponse(result); | 276 | string xmlString = ServerUtils.BuildXmlResponse(result); |
267 | m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); | 277 | //m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); |
268 | UTF8Encoding encoding = new UTF8Encoding(); | 278 | UTF8Encoding encoding = new UTF8Encoding(); |
269 | return encoding.GetBytes(xmlString); | 279 | return encoding.GetBytes(xmlString); |
270 | } | 280 | } |
@@ -281,18 +291,26 @@ namespace OpenSim.Server.Handlers.Asset | |||
281 | if (icoll != null) | 291 | if (icoll != null) |
282 | { | 292 | { |
283 | Dictionary<string, object> folders = new Dictionary<string, object>(); | 293 | Dictionary<string, object> folders = new Dictionary<string, object>(); |
294 | int i = 0; | ||
284 | foreach (InventoryFolderBase f in icoll.Folders) | 295 | foreach (InventoryFolderBase f in icoll.Folders) |
285 | folders[f.ID.ToString()] = EncodeFolder(f); | 296 | { |
297 | folders["folder_" + i.ToString()] = EncodeFolder(f); | ||
298 | i++; | ||
299 | } | ||
286 | result["FOLDERS"] = folders; | 300 | result["FOLDERS"] = folders; |
287 | 301 | ||
302 | i = 0; | ||
288 | Dictionary<string, object> items = new Dictionary<string, object>(); | 303 | Dictionary<string, object> items = new Dictionary<string, object>(); |
289 | foreach (InventoryItemBase i in icoll.Items) | 304 | foreach (InventoryItemBase it in icoll.Items) |
290 | items[i.ID.ToString()] = EncodeItem(i); | 305 | { |
306 | items["item_" + i.ToString()] = EncodeItem(it); | ||
307 | i++; | ||
308 | } | ||
291 | result["ITEMS"] = items; | 309 | result["ITEMS"] = items; |
292 | } | 310 | } |
293 | 311 | ||
294 | string xmlString = ServerUtils.BuildXmlResponse(result); | 312 | string xmlString = ServerUtils.BuildXmlResponse(result); |
295 | m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); | 313 | //m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); |
296 | UTF8Encoding encoding = new UTF8Encoding(); | 314 | UTF8Encoding encoding = new UTF8Encoding(); |
297 | return encoding.GetBytes(xmlString); | 315 | return encoding.GetBytes(xmlString); |
298 | } | 316 | } |
@@ -306,12 +324,21 @@ namespace OpenSim.Server.Handlers.Asset | |||
306 | UUID.TryParse(request["FOLDER"].ToString(), out folderID); | 324 | UUID.TryParse(request["FOLDER"].ToString(), out folderID); |
307 | 325 | ||
308 | 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 | |||
309 | if (items != null) | 329 | if (items != null) |
330 | { | ||
331 | int i = 0; | ||
310 | foreach (InventoryItemBase item in items) | 332 | foreach (InventoryItemBase item in items) |
311 | result[item.ID.ToString()] = EncodeItem(item); | 333 | { |
334 | sitems["item_" + i.ToString()] = EncodeItem(item); | ||
335 | i++; | ||
336 | } | ||
337 | } | ||
338 | result["ITEMS"] = sitems; | ||
312 | 339 | ||
313 | string xmlString = ServerUtils.BuildXmlResponse(result); | 340 | string xmlString = ServerUtils.BuildXmlResponse(result); |
314 | m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); | 341 | //m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); |
315 | UTF8Encoding encoding = new UTF8Encoding(); | 342 | UTF8Encoding encoding = new UTF8Encoding(); |
316 | return encoding.GetBytes(xmlString); | 343 | return encoding.GetBytes(xmlString); |
317 | } | 344 | } |
@@ -481,10 +508,10 @@ namespace OpenSim.Server.Handlers.Asset | |||
481 | InventoryItemBase item = new InventoryItemBase(id); | 508 | InventoryItemBase item = new InventoryItemBase(id); |
482 | item = m_InventoryService.GetItem(item); | 509 | item = m_InventoryService.GetItem(item); |
483 | if (item != null) | 510 | if (item != null) |
484 | result[item.ID.ToString()] = EncodeItem(item); | 511 | result["item"] = EncodeItem(item); |
485 | 512 | ||
486 | string xmlString = ServerUtils.BuildXmlResponse(result); | 513 | string xmlString = ServerUtils.BuildXmlResponse(result); |
487 | m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); | 514 | //m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); |
488 | UTF8Encoding encoding = new UTF8Encoding(); | 515 | UTF8Encoding encoding = new UTF8Encoding(); |
489 | return encoding.GetBytes(xmlString); | 516 | return encoding.GetBytes(xmlString); |
490 | } | 517 | } |
@@ -498,10 +525,10 @@ namespace OpenSim.Server.Handlers.Asset | |||
498 | InventoryFolderBase folder = new InventoryFolderBase(id); | 525 | InventoryFolderBase folder = new InventoryFolderBase(id); |
499 | folder = m_InventoryService.GetFolder(folder); | 526 | folder = m_InventoryService.GetFolder(folder); |
500 | if (folder != null) | 527 | if (folder != null) |
501 | result[folder.ID.ToString()] = EncodeFolder(folder); | 528 | result["folder"] = EncodeFolder(folder); |
502 | 529 | ||
503 | string xmlString = ServerUtils.BuildXmlResponse(result); | 530 | string xmlString = ServerUtils.BuildXmlResponse(result); |
504 | m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); | 531 | //m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); |
505 | UTF8Encoding encoding = new UTF8Encoding(); | 532 | UTF8Encoding encoding = new UTF8Encoding(); |
506 | return encoding.GetBytes(xmlString); | 533 | return encoding.GetBytes(xmlString); |
507 | } | 534 | } |
@@ -513,12 +540,20 @@ namespace OpenSim.Server.Handlers.Asset | |||
513 | UUID.TryParse(request["PRINCIPAL"].ToString(), out principal); | 540 | UUID.TryParse(request["PRINCIPAL"].ToString(), out principal); |
514 | 541 | ||
515 | List<InventoryItemBase> gestures = m_InventoryService.GetActiveGestures(principal); | 542 | List<InventoryItemBase> gestures = m_InventoryService.GetActiveGestures(principal); |
543 | Dictionary<string, object> items = new Dictionary<string, object>(); | ||
516 | if (gestures != null) | 544 | if (gestures != null) |
545 | { | ||
546 | int i = 0; | ||
517 | foreach (InventoryItemBase item in gestures) | 547 | foreach (InventoryItemBase item in gestures) |
518 | result[item.ID.ToString()] = EncodeItem(item); | 548 | { |
549 | items["item_" + i.ToString()] = EncodeItem(item); | ||
550 | i++; | ||
551 | } | ||
552 | } | ||
553 | result["ITEMS"] = items; | ||
519 | 554 | ||
520 | string xmlString = ServerUtils.BuildXmlResponse(result); | 555 | string xmlString = ServerUtils.BuildXmlResponse(result); |
521 | m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); | 556 | //m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); |
522 | UTF8Encoding encoding = new UTF8Encoding(); | 557 | UTF8Encoding encoding = new UTF8Encoding(); |
523 | return encoding.GetBytes(xmlString); | 558 | return encoding.GetBytes(xmlString); |
524 | } | 559 | } |
@@ -535,7 +570,31 @@ namespace OpenSim.Server.Handlers.Asset | |||
535 | 570 | ||
536 | result["RESULT"] = perms.ToString(); | 571 | result["RESULT"] = perms.ToString(); |
537 | string xmlString = ServerUtils.BuildXmlResponse(result); | 572 | string xmlString = ServerUtils.BuildXmlResponse(result); |
538 | m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); | 573 | //m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); |
574 | UTF8Encoding encoding = new UTF8Encoding(); | ||
575 | return encoding.GetBytes(xmlString); | ||
576 | } | ||
577 | |||
578 | byte[] HandleGetSystemFolders(Dictionary<string, object> request) | ||
579 | { | ||
580 | Dictionary<string, object> result = new Dictionary<string, object>(); | ||
581 | UUID principal = UUID.Zero; | ||
582 | UUID.TryParse(request["PRINCIPAL"].ToString(), out principal); | ||
583 | |||
584 | Dictionary<AssetType, InventoryFolderBase> sfolders = GetSystemFolders(principal); | ||
585 | //m_log.DebugFormat("[XXX]: SystemFolders got {0} folders", sfolders.Count); | ||
586 | |||
587 | Dictionary<string, object> folders = new Dictionary<string, object>(); | ||
588 | int i = 0; | ||
589 | foreach (KeyValuePair<AssetType, InventoryFolderBase> kvp in sfolders) | ||
590 | { | ||
591 | folders["folder_" + i.ToString()] = EncodeFolder(kvp.Value); | ||
592 | i++; | ||
593 | } | ||
594 | result["FOLDERS"] = folders; | ||
595 | |||
596 | string xmlString = ServerUtils.BuildXmlResponse(result); | ||
597 | //m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); | ||
539 | UTF8Encoding encoding = new UTF8Encoding(); | 598 | UTF8Encoding encoding = new UTF8Encoding(); |
540 | return encoding.GetBytes(xmlString); | 599 | return encoding.GetBytes(xmlString); |
541 | } | 600 | } |
@@ -569,7 +628,7 @@ namespace OpenSim.Server.Handlers.Asset | |||
569 | ret["Flags"] = item.Flags.ToString(); | 628 | ret["Flags"] = item.Flags.ToString(); |
570 | ret["Folder"] = item.Folder.ToString(); | 629 | ret["Folder"] = item.Folder.ToString(); |
571 | ret["GroupID"] = item.GroupID.ToString(); | 630 | ret["GroupID"] = item.GroupID.ToString(); |
572 | ret["GroupedOwned"] = item.GroupOwned.ToString(); | 631 | ret["GroupOwned"] = item.GroupOwned.ToString(); |
573 | ret["GroupPermissions"] = item.GroupPermissions.ToString(); | 632 | ret["GroupPermissions"] = item.GroupPermissions.ToString(); |
574 | ret["ID"] = item.ID.ToString(); | 633 | ret["ID"] = item.ID.ToString(); |
575 | ret["InvType"] = item.InvType.ToString(); | 634 | ret["InvType"] = item.InvType.ToString(); |
@@ -623,5 +682,31 @@ namespace OpenSim.Server.Handlers.Asset | |||
623 | 682 | ||
624 | return item; | 683 | return item; |
625 | } | 684 | } |
685 | |||
686 | #region Extra | ||
687 | private Dictionary<AssetType, InventoryFolderBase> GetSystemFolders(UUID userID) | ||
688 | { | ||
689 | InventoryFolderBase root = m_InventoryService.GetRootFolder(userID); | ||
690 | if (root != null) | ||
691 | { | ||
692 | InventoryCollection content = m_InventoryService.GetFolderContent(userID, root.ID); | ||
693 | if (content != null) | ||
694 | { | ||
695 | Dictionary<AssetType, InventoryFolderBase> folders = new Dictionary<AssetType, InventoryFolderBase>(); | ||
696 | foreach (InventoryFolderBase folder in content.Folders) | ||
697 | { | ||
698 | if ((folder.Type != (short)AssetType.Folder) && (folder.Type != (short)AssetType.Unknown)) | ||
699 | folders[(AssetType)folder.Type] = folder; | ||
700 | } | ||
701 | // Put the root folder there, as type Folder | ||
702 | folders[AssetType.Folder] = root; | ||
703 | return folders; | ||
704 | } | ||
705 | } | ||
706 | m_log.WarnFormat("[XINVENTORY SERVICE]: System folders for {0} not found", userID); | ||
707 | return new Dictionary<AssetType, InventoryFolderBase>(); | ||
708 | } | ||
709 | #endregion | ||
710 | |||
626 | } | 711 | } |
627 | } | 712 | } |
diff --git a/OpenSim/Server/Handlers/Login/LLLoginHandlers.cs b/OpenSim/Server/Handlers/Login/LLLoginHandlers.cs index aaa958b..daf2704 100644 --- a/OpenSim/Server/Handlers/Login/LLLoginHandlers.cs +++ b/OpenSim/Server/Handlers/Login/LLLoginHandlers.cs | |||
@@ -72,6 +72,9 @@ namespace OpenSim.Server.Handlers.Login | |||
72 | string last = requestData["last"].ToString(); | 72 | string last = requestData["last"].ToString(); |
73 | string passwd = requestData["passwd"].ToString(); | 73 | string passwd = requestData["passwd"].ToString(); |
74 | string startLocation = string.Empty; | 74 | string startLocation = string.Empty; |
75 | UUID scopeID = UUID.Zero; | ||
76 | if (requestData["scope_id"] != null) | ||
77 | scopeID = new UUID(requestData["scope_id"].ToString()); | ||
75 | if (requestData.ContainsKey("start")) | 78 | if (requestData.ContainsKey("start")) |
76 | startLocation = requestData["start"].ToString(); | 79 | startLocation = requestData["start"].ToString(); |
77 | 80 | ||
@@ -83,7 +86,7 @@ namespace OpenSim.Server.Handlers.Login | |||
83 | m_log.InfoFormat("[LOGIN]: XMLRPC Login Requested for {0} {1}, starting in {2}, using {3}", first, last, startLocation, clientVersion); | 86 | m_log.InfoFormat("[LOGIN]: XMLRPC Login Requested for {0} {1}, starting in {2}, using {3}", first, last, startLocation, clientVersion); |
84 | 87 | ||
85 | LoginResponse reply = null; | 88 | LoginResponse reply = null; |
86 | reply = m_LocalService.Login(first, last, passwd, startLocation, remoteClient); | 89 | reply = m_LocalService.Login(first, last, passwd, startLocation, scopeID, remoteClient); |
87 | 90 | ||
88 | XmlRpcResponse response = new XmlRpcResponse(); | 91 | XmlRpcResponse response = new XmlRpcResponse(); |
89 | response.Value = reply.ToHashtable(); | 92 | response.Value = reply.ToHashtable(); |
@@ -109,10 +112,15 @@ namespace OpenSim.Server.Handlers.Login | |||
109 | if (map.ContainsKey("start")) | 112 | if (map.ContainsKey("start")) |
110 | startLocation = map["start"].AsString(); | 113 | startLocation = map["start"].AsString(); |
111 | 114 | ||
115 | UUID scopeID = UUID.Zero; | ||
116 | |||
117 | if (map.ContainsKey("scope_id")) | ||
118 | scopeID = new UUID(map["scope_id"].AsString()); | ||
119 | |||
112 | m_log.Info("[LOGIN]: LLSD Login Requested for: '" + map["first"].AsString() + "' '" + map["last"].AsString() + "' / " + startLocation); | 120 | m_log.Info("[LOGIN]: LLSD Login Requested for: '" + map["first"].AsString() + "' '" + map["last"].AsString() + "' / " + startLocation); |
113 | 121 | ||
114 | LoginResponse reply = null; | 122 | LoginResponse reply = null; |
115 | reply = m_LocalService.Login(map["first"].AsString(), map["last"].AsString(), map["passwd"].AsString(), startLocation, remoteClient); | 123 | reply = m_LocalService.Login(map["first"].AsString(), map["last"].AsString(), map["passwd"].AsString(), startLocation, scopeID, remoteClient); |
116 | return reply.ToOSDMap(); | 124 | return reply.ToOSDMap(); |
117 | 125 | ||
118 | } | 126 | } |