aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Communications/Local
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-03-31 18:29:08 +0000
committerJustin Clarke Casey2008-03-31 18:29:08 +0000
commit93303072dd4edbb7d41ed629787bd22494b30cc1 (patch)
treed4a9865accd96c68747bf889db46e5793533834b /OpenSim/Region/Communications/Local
parent* Log exceptions which make it up to the top of the http request frame, rathe... (diff)
downloadopensim-SC_OLD-93303072dd4edbb7d41ed629787bd22494b30cc1.zip
opensim-SC_OLD-93303072dd4edbb7d41ed629787bd22494b30cc1.tar.gz
opensim-SC_OLD-93303072dd4edbb7d41ed629787bd22494b30cc1.tar.bz2
opensim-SC_OLD-93303072dd4edbb7d41ed629787bd22494b30cc1.tar.xz
* Minor: If a user exists but has no inventory in standalone, automatically create new inventory folders
* This mirrors the grid behaviour
Diffstat (limited to 'OpenSim/Region/Communications/Local')
-rw-r--r--OpenSim/Region/Communications/Local/LocalLoginService.cs55
1 files changed, 20 insertions, 35 deletions
diff --git a/OpenSim/Region/Communications/Local/LocalLoginService.cs b/OpenSim/Region/Communications/Local/LocalLoginService.cs
index 3cea82d..8583e61 100644
--- a/OpenSim/Region/Communications/Local/LocalLoginService.cs
+++ b/OpenSim/Region/Communications/Local/LocalLoginService.cs
@@ -217,47 +217,32 @@ namespace OpenSim.Region.Communications.Local
217 { 217 {
218 List<InventoryFolderBase> folders = m_Parent.InventoryService.GetInventorySkeleton(userID); 218 List<InventoryFolderBase> folders = m_Parent.InventoryService.GetInventorySkeleton(userID);
219 219
220 if (folders.Count > 0) 220 // If we have user auth but no inventory folders for some reason, create a new set of folders.
221 if (null == folders || 0 == folders.Count)
221 { 222 {
222 LLUUID rootID = LLUUID.Zero; 223 m_Parent.InventoryService.CreateNewUserInventory(userID);
223 ArrayList AgentInventoryArray = new ArrayList(); 224 folders = m_Parent.InventoryService.GetInventorySkeleton(userID);
224 Hashtable TempHash;
225 foreach (InventoryFolderBase InvFolder in folders)
226 {
227 if (InvFolder.parentID == LLUUID.Zero)
228 {
229 rootID = InvFolder.folderID;
230 }
231 TempHash = new Hashtable();
232 TempHash["name"] = InvFolder.name;
233 TempHash["parent_id"] = InvFolder.parentID.ToString();
234 TempHash["version"] = (Int32) InvFolder.version;
235 TempHash["type_default"] = (Int32) InvFolder.type;
236 TempHash["folder_id"] = InvFolder.folderID.ToString();
237 AgentInventoryArray.Add(TempHash);
238 }
239 return new InventoryData(AgentInventoryArray, rootID);
240 } 225 }
241 else 226
227 LLUUID rootID = LLUUID.Zero;
228 ArrayList AgentInventoryArray = new ArrayList();
229 Hashtable TempHash;
230 foreach (InventoryFolderBase InvFolder in folders)
242 { 231 {
243 AgentInventory userInventory = new AgentInventory(); 232 if (InvFolder.parentID == LLUUID.Zero)
244 userInventory.CreateRootFolder(userID);
245
246 ArrayList AgentInventoryArray = new ArrayList();
247 Hashtable TempHash;
248 foreach (InventoryFolder InvFolder in userInventory.InventoryFolders.Values)
249 { 233 {
250 TempHash = new Hashtable(); 234 rootID = InvFolder.folderID;
251 TempHash["name"] = InvFolder.FolderName;
252 TempHash["parent_id"] = InvFolder.ParentID.ToString();
253 TempHash["version"] = (Int32) InvFolder.Version;
254 TempHash["type_default"] = (Int32) InvFolder.DefaultType;
255 TempHash["folder_id"] = InvFolder.FolderID.ToString();
256 AgentInventoryArray.Add(TempHash);
257 } 235 }
258 236 TempHash = new Hashtable();
259 return new InventoryData(AgentInventoryArray, userInventory.InventoryRoot.FolderID); 237 TempHash["name"] = InvFolder.name;
238 TempHash["parent_id"] = InvFolder.parentID.ToString();
239 TempHash["version"] = (Int32) InvFolder.version;
240 TempHash["type_default"] = (Int32) InvFolder.type;
241 TempHash["folder_id"] = InvFolder.folderID.ToString();
242 AgentInventoryArray.Add(TempHash);
260 } 243 }
244
245 return new InventoryData(AgentInventoryArray, rootID);
261 } 246 }
262 } 247 }
263} 248}