diff options
author | Diva Canto | 2015-08-08 12:12:50 -0700 |
---|---|---|
committer | Diva Canto | 2015-08-08 12:12:50 -0700 |
commit | 959872315f67a1a33a2bae7330749f7dd74a4774 (patch) | |
tree | e31f6900453e77815859767cb2331d0412ec5b57 /OpenSim/Services/HypergridService | |
parent | Have osAvatarName2Key check the cache first, even for foreign users (diff) | |
download | opensim-SC_OLD-959872315f67a1a33a2bae7330749f7dd74a4774.zip opensim-SC_OLD-959872315f67a1a33a2bae7330749f7dd74a4774.tar.gz opensim-SC_OLD-959872315f67a1a33a2bae7330749f7dd74a4774.tar.bz2 opensim-SC_OLD-959872315f67a1a33a2bae7330749f7dd74a4774.tar.xz |
WARNING: massive refactor to follow libomv's latest changes regarding inventory folders. The newest version of libomv itself is committed here. Basically, everything that was using the AssetType enum has been combed through; many of those uses were changed to the new FolderType enum.
This means that from now on, [new] root folders have code 8 (FolderType.Root), as the viewers expect, as opposed to 9, which was what we had been doing. Normal folders are as they were, -1. Also now sending folder code 100 for Suitcase folders to viewers, with no filter.
All tests pass, but fingers crossed!
Diffstat (limited to 'OpenSim/Services/HypergridService')
-rw-r--r-- | OpenSim/Services/HypergridService/HGInventoryService.cs | 4 | ||||
-rw-r--r-- | OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs | 82 |
2 files changed, 43 insertions, 43 deletions
diff --git a/OpenSim/Services/HypergridService/HGInventoryService.cs b/OpenSim/Services/HypergridService/HGInventoryService.cs index 5f245e4..9158b41 100644 --- a/OpenSim/Services/HypergridService/HGInventoryService.cs +++ b/OpenSim/Services/HypergridService/HGInventoryService.cs | |||
@@ -115,7 +115,7 @@ namespace OpenSim.Services.HypergridService | |||
115 | return ConvertToOpenSim(folders[0]); | 115 | return ConvertToOpenSim(folders[0]); |
116 | 116 | ||
117 | // make one | 117 | // make one |
118 | XInventoryFolder suitcase = CreateFolder(principalID, UUID.Zero, (int)AssetType.Folder, "My Suitcase"); | 118 | XInventoryFolder suitcase = CreateFolder(principalID, UUID.Zero, (int)FolderType.Suitcase, "My Suitcase"); |
119 | return ConvertToOpenSim(suitcase); | 119 | return ConvertToOpenSim(suitcase); |
120 | } | 120 | } |
121 | 121 | ||
@@ -141,7 +141,7 @@ namespace OpenSim.Services.HypergridService | |||
141 | //} | 141 | //} |
142 | 142 | ||
143 | 143 | ||
144 | public override InventoryFolderBase GetFolderForType(UUID principalID, AssetType type) | 144 | public override InventoryFolderBase GetFolderForType(UUID principalID, FolderType type) |
145 | { | 145 | { |
146 | //m_log.DebugFormat("[HG INVENTORY SERVICE]: GetFolderForType for {0} {0}", principalID, type); | 146 | //m_log.DebugFormat("[HG INVENTORY SERVICE]: GetFolderForType for {0} {0}", principalID, type); |
147 | return GetRootFolder(principalID); | 147 | return GetRootFolder(principalID); |
diff --git a/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs b/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs index d158537..319c2db 100644 --- a/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs +++ b/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs | |||
@@ -158,7 +158,7 @@ namespace OpenSim.Services.HypergridService | |||
158 | m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: User {0} does not have a Suitcase folder. Creating it...", principalID); | 158 | m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: User {0} does not have a Suitcase folder. Creating it...", principalID); |
159 | // Create the My Suitcase folder under the user's root folder. | 159 | // Create the My Suitcase folder under the user's root folder. |
160 | // In the DB we tag it as type 100, but we use type 8 (Folder) outside, as this affects the sort order. | 160 | // In the DB we tag it as type 100, but we use type 8 (Folder) outside, as this affects the sort order. |
161 | suitcase = CreateFolder(principalID, root.folderID, InventoryItemBase.SUITCASE_FOLDER_TYPE, InventoryItemBase.SUITCASE_FOLDER_NAME); | 161 | suitcase = CreateFolder(principalID, root.folderID, (int)FolderType.Suitcase, InventoryFolderBase.SUITCASE_FOLDER_NAME); |
162 | if (suitcase == null) | 162 | if (suitcase == null) |
163 | { | 163 | { |
164 | m_log.ErrorFormat("[HG SUITCASE INVENTORY SERVICE]: Unable to create suitcase folder"); | 164 | m_log.ErrorFormat("[HG SUITCASE INVENTORY SERVICE]: Unable to create suitcase folder"); |
@@ -178,41 +178,41 @@ namespace OpenSim.Services.HypergridService | |||
178 | m_log.Debug("[HG SUITCASE INVENTORY SERVICE]: Creating System folders under Suitcase..."); | 178 | m_log.Debug("[HG SUITCASE INVENTORY SERVICE]: Creating System folders under Suitcase..."); |
179 | XInventoryFolder[] sysFolders = GetSystemFolders(principalID, rootID); | 179 | XInventoryFolder[] sysFolders = GetSystemFolders(principalID, rootID); |
180 | 180 | ||
181 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)AssetType.Animation) return true; return false; })) | 181 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.Animation) return true; return false; })) |
182 | CreateFolder(principalID, rootID, (int)AssetType.Animation, "Animations"); | 182 | CreateFolder(principalID, rootID, (int)FolderType.Animation, "Animations"); |
183 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)AssetType.Bodypart) return true; return false; })) | 183 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.BodyPart) return true; return false; })) |
184 | CreateFolder(principalID, rootID, (int)AssetType.Bodypart, "Body Parts"); | 184 | CreateFolder(principalID, rootID, (int)FolderType.BodyPart, "Body Parts"); |
185 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)AssetType.CallingCard) return true; return false; })) | 185 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.CallingCard) return true; return false; })) |
186 | CreateFolder(principalID, rootID, (int)AssetType.CallingCard, "Calling Cards"); | 186 | CreateFolder(principalID, rootID, (int)FolderType.CallingCard, "Calling Cards"); |
187 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)AssetType.Clothing) return true; return false; })) | 187 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.Clothing) return true; return false; })) |
188 | CreateFolder(principalID, rootID, (int)AssetType.Clothing, "Clothing"); | 188 | CreateFolder(principalID, rootID, (int)FolderType.Clothing, "Clothing"); |
189 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)AssetType.CurrentOutfitFolder) return true; return false; })) | 189 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.CurrentOutfit) return true; return false; })) |
190 | CreateFolder(principalID, rootID, (int)AssetType.CurrentOutfitFolder, "Current Outfit"); | 190 | CreateFolder(principalID, rootID, (int)FolderType.CurrentOutfit, "Current Outfit"); |
191 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)AssetType.FavoriteFolder) return true; return false; })) | 191 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.Favorites) return true; return false; })) |
192 | CreateFolder(principalID, rootID, (int)AssetType.FavoriteFolder, "Favorites"); | 192 | CreateFolder(principalID, rootID, (int)FolderType.Favorites, "Favorites"); |
193 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)AssetType.Gesture) return true; return false; })) | 193 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.Gesture) return true; return false; })) |
194 | CreateFolder(principalID, rootID, (int)AssetType.Gesture, "Gestures"); | 194 | CreateFolder(principalID, rootID, (int)FolderType.Gesture, "Gestures"); |
195 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)AssetType.Landmark) return true; return false; })) | 195 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.Landmark) return true; return false; })) |
196 | CreateFolder(principalID, rootID, (int)AssetType.Landmark, "Landmarks"); | 196 | CreateFolder(principalID, rootID, (int)FolderType.Landmark, "Landmarks"); |
197 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)AssetType.LostAndFoundFolder) return true; return false; })) | 197 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.LostAndFound) return true; return false; })) |
198 | CreateFolder(principalID, rootID, (int)AssetType.LostAndFoundFolder, "Lost And Found"); | 198 | CreateFolder(principalID, rootID, (int)FolderType.LostAndFound, "Lost And Found"); |
199 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)AssetType.Notecard) return true; return false; })) | 199 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.Notecard) return true; return false; })) |
200 | CreateFolder(principalID, rootID, (int)AssetType.Notecard, "Notecards"); | 200 | CreateFolder(principalID, rootID, (int)FolderType.Notecard, "Notecards"); |
201 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)AssetType.Object) return true; return false; })) | 201 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.Object) return true; return false; })) |
202 | CreateFolder(principalID, rootID, (int)AssetType.Object, "Objects"); | 202 | CreateFolder(principalID, rootID, (int)FolderType.Object, "Objects"); |
203 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)AssetType.SnapshotFolder) return true; return false; })) | 203 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.Snapshot) return true; return false; })) |
204 | CreateFolder(principalID, rootID, (int)AssetType.SnapshotFolder, "Photo Album"); | 204 | CreateFolder(principalID, rootID, (int)FolderType.Snapshot, "Photo Album"); |
205 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)AssetType.LSLText) return true; return false; })) | 205 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.LSLText) return true; return false; })) |
206 | CreateFolder(principalID, rootID, (int)AssetType.LSLText, "Scripts"); | 206 | CreateFolder(principalID, rootID, (int)FolderType.LSLText, "Scripts"); |
207 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)AssetType.Sound) return true; return false; })) | 207 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.Sound) return true; return false; })) |
208 | CreateFolder(principalID, rootID, (int)AssetType.Sound, "Sounds"); | 208 | CreateFolder(principalID, rootID, (int)FolderType.Sound, "Sounds"); |
209 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)AssetType.Texture) return true; return false; })) | 209 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.Texture) return true; return false; })) |
210 | CreateFolder(principalID, rootID, (int)AssetType.Texture, "Textures"); | 210 | CreateFolder(principalID, rootID, (int)FolderType.Texture, "Textures"); |
211 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)AssetType.TrashFolder) return true; return false; })) | 211 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.Trash) return true; return false; })) |
212 | CreateFolder(principalID, rootID, (int)AssetType.TrashFolder, "Trash"); | 212 | CreateFolder(principalID, rootID, (int)FolderType.Trash, "Trash"); |
213 | } | 213 | } |
214 | 214 | ||
215 | public override InventoryFolderBase GetFolderForType(UUID principalID, AssetType type) | 215 | public override InventoryFolderBase GetFolderForType(UUID principalID, FolderType type) |
216 | { | 216 | { |
217 | //m_log.DebugFormat("[HG INVENTORY SERVICE]: GetFolderForType for {0} {0}", principalID, type); | 217 | //m_log.DebugFormat("[HG INVENTORY SERVICE]: GetFolderForType for {0} {0}", principalID, type); |
218 | XInventoryFolder suitcase = GetSuitcaseXFolder(principalID); | 218 | XInventoryFolder suitcase = GetSuitcaseXFolder(principalID); |
@@ -468,7 +468,7 @@ namespace OpenSim.Services.HypergridService | |||
468 | { | 468 | { |
469 | XInventoryFolder[] folders = m_Database.GetFolders( | 469 | XInventoryFolder[] folders = m_Database.GetFolders( |
470 | new string[] { "agentID", "folderName", "type" }, | 470 | new string[] { "agentID", "folderName", "type" }, |
471 | new string[] { principalID.ToString(), "My Inventory", ((int)AssetType.RootFolder).ToString() }); | 471 | new string[] { principalID.ToString(), InventoryFolderBase.ROOT_FOLDER_NAME, ((int)FolderType.Root).ToString() }); |
472 | 472 | ||
473 | if (folders != null && folders.Length > 0) | 473 | if (folders != null && folders.Length > 0) |
474 | return folders[0]; | 474 | return folders[0]; |
@@ -476,7 +476,7 @@ namespace OpenSim.Services.HypergridService | |||
476 | // OK, so the RootFolder type didn't work. Let's look for any type with parent UUID.Zero. | 476 | // OK, so the RootFolder type didn't work. Let's look for any type with parent UUID.Zero. |
477 | folders = m_Database.GetFolders( | 477 | folders = m_Database.GetFolders( |
478 | new string[] { "agentID", "folderName", "parentFolderID" }, | 478 | new string[] { "agentID", "folderName", "parentFolderID" }, |
479 | new string[] { principalID.ToString(), "My Inventory", UUID.Zero.ToString() }); | 479 | new string[] { principalID.ToString(), InventoryFolderBase.ROOT_FOLDER_NAME, UUID.Zero.ToString() }); |
480 | 480 | ||
481 | if (folders != null && folders.Length > 0) | 481 | if (folders != null && folders.Length > 0) |
482 | return folders[0]; | 482 | return folders[0]; |
@@ -492,7 +492,7 @@ namespace OpenSim.Services.HypergridService | |||
492 | 492 | ||
493 | XInventoryFolder[] folders = m_Database.GetFolders( | 493 | XInventoryFolder[] folders = m_Database.GetFolders( |
494 | new string[] { "agentID", "type", "parentFolderID" }, | 494 | new string[] { "agentID", "type", "parentFolderID" }, |
495 | new string[] { userID.ToString(), ((int)AssetType.CurrentOutfitFolder).ToString(), root.folderID.ToString() }); | 495 | new string[] { userID.ToString(), ((int)FolderType.CurrentOutfit).ToString(), root.folderID.ToString() }); |
496 | 496 | ||
497 | if (folders.Length == 0) | 497 | if (folders.Length == 0) |
498 | return null; | 498 | return null; |
@@ -505,7 +505,7 @@ namespace OpenSim.Services.HypergridService | |||
505 | // Warp! Root folder for travelers | 505 | // Warp! Root folder for travelers |
506 | XInventoryFolder[] folders = m_Database.GetFolders( | 506 | XInventoryFolder[] folders = m_Database.GetFolders( |
507 | new string[] { "agentID", "type" }, | 507 | new string[] { "agentID", "type" }, |
508 | new string[] { principalID.ToString(), InventoryItemBase.SUITCASE_FOLDER_TYPE.ToString() }); // This is a special folder type... | 508 | new string[] { principalID.ToString(), FolderType.Suitcase.ToString() }); |
509 | 509 | ||
510 | if (folders != null && folders.Length > 0) | 510 | if (folders != null && folders.Length > 0) |
511 | return folders[0]; | 511 | return folders[0]; |
@@ -513,13 +513,13 @@ namespace OpenSim.Services.HypergridService | |||
513 | // check to see if we have the old Suitcase folder | 513 | // check to see if we have the old Suitcase folder |
514 | folders = m_Database.GetFolders( | 514 | folders = m_Database.GetFolders( |
515 | new string[] { "agentID", "folderName", "parentFolderID" }, | 515 | new string[] { "agentID", "folderName", "parentFolderID" }, |
516 | new string[] { principalID.ToString(), InventoryItemBase.SUITCASE_FOLDER_NAME, UUID.Zero.ToString() }); | 516 | new string[] { principalID.ToString(), InventoryFolderBase.SUITCASE_FOLDER_NAME, UUID.Zero.ToString() }); |
517 | if (folders != null && folders.Length > 0) | 517 | if (folders != null && folders.Length > 0) |
518 | { | 518 | { |
519 | // Move it to under the root folder | 519 | // Move it to under the root folder |
520 | XInventoryFolder root = GetRootXFolder(principalID); | 520 | XInventoryFolder root = GetRootXFolder(principalID); |
521 | folders[0].parentFolderID = root.folderID; | 521 | folders[0].parentFolderID = root.folderID; |
522 | folders[0].type = InventoryItemBase.SUITCASE_FOLDER_TYPE; | 522 | folders[0].type = (int)FolderType.Suitcase; |
523 | m_Database.StoreFolder(folders[0]); | 523 | m_Database.StoreFolder(folders[0]); |
524 | return folders[0]; | 524 | return folders[0]; |
525 | } | 525 | } |
@@ -529,7 +529,7 @@ namespace OpenSim.Services.HypergridService | |||
529 | 529 | ||
530 | private void SetAsNormalFolder(XInventoryFolder suitcase) | 530 | private void SetAsNormalFolder(XInventoryFolder suitcase) |
531 | { | 531 | { |
532 | suitcase.type = InventoryItemBase.SUITCASE_FOLDER_FAKE_TYPE; | 532 | //suitcase.type = InventoryItemBase.SUITCASE_FOLDER_FAKE_TYPE; |
533 | } | 533 | } |
534 | 534 | ||
535 | private List<XInventoryFolder> GetFolderTree(UUID principalID, UUID folder) | 535 | private List<XInventoryFolder> GetFolderTree(UUID principalID, UUID folder) |