aboutsummaryrefslogtreecommitdiffstatshomepage
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
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 '')
-rw-r--r--OpenSim/Framework/Communications/InventoryServiceBase.cs7
-rw-r--r--OpenSim/Grid/UserServer/UserLoginService.cs2
-rw-r--r--OpenSim/Region/Communications/Local/LocalLoginService.cs55
-rw-r--r--OpenSim/Region/Environment/Scenes/InnerScene.cs2
4 files changed, 27 insertions, 39 deletions
diff --git a/OpenSim/Framework/Communications/InventoryServiceBase.cs b/OpenSim/Framework/Communications/InventoryServiceBase.cs
index f38abd3..feb0cca 100644
--- a/OpenSim/Framework/Communications/InventoryServiceBase.cs
+++ b/OpenSim/Framework/Communications/InventoryServiceBase.cs
@@ -79,7 +79,7 @@ namespace OpenSim.Framework.Communications
79 // See IInventoryServices 79 // See IInventoryServices
80 public List<InventoryFolderBase> GetInventorySkeleton(LLUUID userId) 80 public List<InventoryFolderBase> GetInventorySkeleton(LLUUID userId)
81 { 81 {
82 m_log.DebugFormat("[AGENT INVENTORY]: Getting inventory skeleton for {0}", userId); 82// m_log.DebugFormat("[AGENT INVENTORY]: Getting inventory skeleton for {0}", userId);
83 83
84 InventoryFolderBase rootFolder = RequestRootFolder(userId); 84 InventoryFolderBase rootFolder = RequestRootFolder(userId);
85 85
@@ -87,9 +87,10 @@ namespace OpenSim.Framework.Communications
87 if (null == rootFolder) 87 if (null == rootFolder)
88 { 88 {
89 return null; 89 return null;
90 } 90 }
91
92 List<InventoryFolderBase> userFolders = new List<InventoryFolderBase>();
91 93
92 List<InventoryFolderBase> userFolders = new List<InventoryFolderBase>();
93 userFolders.Add(rootFolder); 94 userFolders.Add(rootFolder);
94 95
95 foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins) 96 foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins)
diff --git a/OpenSim/Grid/UserServer/UserLoginService.cs b/OpenSim/Grid/UserServer/UserLoginService.cs
index 6d3a081..7917118 100644
--- a/OpenSim/Grid/UserServer/UserLoginService.cs
+++ b/OpenSim/Grid/UserServer/UserLoginService.cs
@@ -299,7 +299,7 @@ namespace OpenSim.Grid.UserServer
299 // In theory, the user will only ever be missing a root folder in situations where a grid 299 // In theory, the user will only ever be missing a root folder in situations where a grid
300 // which didn't previously run a grid wide inventory server is being transitioned to one 300 // which didn't previously run a grid wide inventory server is being transitioned to one
301 // which does. 301 // which does.
302 if (null == folders | folders.Count == 0) 302 if (null == folders || folders.Count == 0)
303 { 303 {
304 m_log.Warn( 304 m_log.Warn(
305 "[LOGIN]: " + 305 "[LOGIN]: " +
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}
diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs
index fb4f02c..c009593 100644
--- a/OpenSim/Region/Environment/Scenes/InnerScene.cs
+++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs
@@ -1208,6 +1208,8 @@ namespace OpenSim.Region.Environment.Scenes
1208 /// <param name="flags"></param> 1208 /// <param name="flags"></param>
1209 public void DuplicateObject(uint originalPrim, LLVector3 offset, uint flags, LLUUID AgentID, LLUUID GroupID) 1209 public void DuplicateObject(uint originalPrim, LLVector3 offset, uint flags, LLUUID AgentID, LLUUID GroupID)
1210 { 1210 {
1211 m_log.DebugFormat("[SCENE]: Duplication of object {0} at offset {1} requested by agent {2}", originalPrim, offset, AgentID);
1212
1211 List<EntityBase> EntityList = GetEntities(); 1213 List<EntityBase> EntityList = GetEntities();
1212 1214
1213 SceneObjectGroup originPrim = null; 1215 SceneObjectGroup originPrim = null;