aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Server/Handlers
diff options
context:
space:
mode:
authorMelanie2010-04-27 03:57:36 +0100
committerMelanie2010-04-27 03:57:36 +0100
commit89a003c6fc0302009558367d7231ffce82ebfccb (patch)
tree7fe98c068958d052061e2deef56dedec293b8453 /OpenSim/Server/Handlers
parentMerge branch 'master' into careminster-presence-refactor (diff)
parentMerge branch 'master' of melanie@opensimulator.org:/var/git/opensim (diff)
downloadopensim-SC-89a003c6fc0302009558367d7231ffce82ebfccb.zip
opensim-SC-89a003c6fc0302009558367d7231ffce82ebfccb.tar.gz
opensim-SC-89a003c6fc0302009558367d7231ffce82ebfccb.tar.bz2
opensim-SC-89a003c6fc0302009558367d7231ffce82ebfccb.tar.xz
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Server/Handlers')
-rw-r--r--OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs48
-rw-r--r--OpenSim/Server/Handlers/Login/LLLoginHandlers.cs12
2 files changed, 57 insertions, 3 deletions
diff --git a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs
index 34f7dcc..7164520 100644
--- a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs
+++ b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs
@@ -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>();
@@ -540,6 +542,24 @@ namespace OpenSim.Server.Handlers.Asset
540 return encoding.GetBytes(xmlString); 542 return encoding.GetBytes(xmlString);
541 } 543 }
542 544
545 byte[] HandleGetSystemFolders(Dictionary<string, object> request)
546 {
547 Dictionary<string, object> result = new Dictionary<string, object>();
548 UUID principal = UUID.Zero;
549 UUID.TryParse(request["PRINCIPAL"].ToString(), out principal);
550
551 Dictionary<AssetType, InventoryFolderBase> sfolders = GetSystemFolders(principal);
552
553 if (sfolders != null)
554 foreach (KeyValuePair<AssetType, InventoryFolderBase> kvp in sfolders)
555 result[kvp.Key.ToString()] = EncodeFolder(kvp.Value);
556
557 string xmlString = ServerUtils.BuildXmlResponse(result);
558 m_log.DebugFormat("[XXX]: resp string: {0}", xmlString);
559 UTF8Encoding encoding = new UTF8Encoding();
560 return encoding.GetBytes(xmlString);
561 }
562
543 private Dictionary<string, object> EncodeFolder(InventoryFolderBase f) 563 private Dictionary<string, object> EncodeFolder(InventoryFolderBase f)
544 { 564 {
545 Dictionary<string, object> ret = new Dictionary<string, object>(); 565 Dictionary<string, object> ret = new Dictionary<string, object>();
@@ -623,5 +643,31 @@ namespace OpenSim.Server.Handlers.Asset
623 643
624 return item; 644 return item;
625 } 645 }
646
647 #region Extra
648 private Dictionary<AssetType, InventoryFolderBase> GetSystemFolders(UUID userID)
649 {
650 InventoryFolderBase root = m_InventoryService.GetRootFolder(userID);
651 if (root != null)
652 {
653 InventoryCollection content = m_InventoryService.GetFolderContent(userID, root.ID);
654 if (content != null)
655 {
656 Dictionary<AssetType, InventoryFolderBase> folders = new Dictionary<AssetType, InventoryFolderBase>();
657 foreach (InventoryFolderBase folder in content.Folders)
658 {
659 if ((folder.Type != (short)AssetType.Folder) && (folder.Type != (short)AssetType.Unknown))
660 folders[(AssetType)folder.Type] = folder;
661 }
662 // Put the root folder there, as type Folder
663 folders[AssetType.Folder] = root;
664 return folders;
665 }
666 }
667 m_log.WarnFormat("[INVENTORY SERVICE]: System folders for {0} not found", userID);
668 return new Dictionary<AssetType, InventoryFolderBase>();
669 }
670 #endregion
671
626 } 672 }
627} 673}
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 }