aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-05-03 22:39:33 +0000
committerJustin Clarke Casey2008-05-03 22:39:33 +0000
commit688940e8103f2b1f55bb48ebe2566d32f872b8f5 (patch)
tree979a633643581349471e3f91bf11bfa545191549 /OpenSim/Region
parent* Cleaned up code in Terrain, Tree and Map modules. (diff)
downloadopensim-SC_OLD-688940e8103f2b1f55bb48ebe2566d32f872b8f5.zip
opensim-SC_OLD-688940e8103f2b1f55bb48ebe2566d32f872b8f5.tar.gz
opensim-SC_OLD-688940e8103f2b1f55bb48ebe2566d32f872b8f5.tar.bz2
opensim-SC_OLD-688940e8103f2b1f55bb48ebe2566d32f872b8f5.tar.xz
* Refactor: Renaming item and folder tree search methods to have Find*() prefixes
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Environment/Modules/Avatar/AvatarFactory/AvatarFactoryModule.cs2
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.Inventory.cs48
-rw-r--r--OpenSim/Region/Modules/AvatarFactory/AvatarFactoryModule.cs3
3 files changed, 31 insertions, 22 deletions
diff --git a/OpenSim/Region/Environment/Modules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/Environment/Modules/Avatar/AvatarFactory/AvatarFactoryModule.cs
index cb94021..5df3f52 100644
--- a/OpenSim/Region/Environment/Modules/Avatar/AvatarFactory/AvatarFactoryModule.cs
+++ b/OpenSim/Region/Environment/Modules/Avatar/AvatarFactory/AvatarFactoryModule.cs
@@ -293,7 +293,7 @@ namespace OpenSim.Region.Environment.Modules
293 { 293 {
294 LLUUID assetId; 294 LLUUID assetId;
295 295
296 InventoryItemBase baseItem = profile.RootFolder.HasItem(wear.ItemID); 296 InventoryItemBase baseItem = profile.RootFolder.FindItem(wear.ItemID);
297 if (baseItem != null) 297 if (baseItem != null)
298 { 298 {
299 assetId = baseItem.assetID; 299 assetId = baseItem.assetID;
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
index 0715b64..7cce216 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
@@ -127,7 +127,8 @@ namespace OpenSim.Region.Environment.Scenes
127 { 127 {
128 if (userInfo.RootFolder != null) 128 if (userInfo.RootFolder != null)
129 { 129 {
130 InventoryItemBase item = userInfo.RootFolder.HasItem(itemID); 130 InventoryItemBase item = userInfo.RootFolder.FindItem(itemID);
131
131 if (item != null) 132 if (item != null)
132 { 133 {
133 AssetBase asset = 134 AssetBase asset =
@@ -271,7 +272,7 @@ namespace OpenSim.Region.Environment.Scenes
271 272
272 if (userInfo != null && userInfo.RootFolder != null) 273 if (userInfo != null && userInfo.RootFolder != null)
273 { 274 {
274 InventoryItemBase item = userInfo.RootFolder.HasItem(itemID); 275 InventoryItemBase item = userInfo.RootFolder.FindItem(itemID);
275 276
276 if (item != null) 277 if (item != null)
277 { 278 {
@@ -340,7 +341,8 @@ namespace OpenSim.Region.Environment.Scenes
340 341
341 if (senderUserInfo.RootFolder != null) 342 if (senderUserInfo.RootFolder != null)
342 { 343 {
343 InventoryItemBase item = senderUserInfo.RootFolder.HasItem(itemId); 344 InventoryItemBase item = senderUserInfo.RootFolder.FindItem(itemId);
345
344 if (item != null) 346 if (item != null)
345 { 347 {
346 // TODO get recipient's root folder 348 // TODO get recipient's root folder
@@ -407,7 +409,8 @@ namespace OpenSim.Region.Environment.Scenes
407 "[AGENT INVENTORY]: CopyInventoryItem received by {0} with oldAgentID {1}, oldItemID {2}, new FolderID {3}, newName {4}", 409 "[AGENT INVENTORY]: CopyInventoryItem received by {0} with oldAgentID {1}, oldItemID {2}, new FolderID {3}, newName {4}",
408 remoteClient.AgentId, oldAgentID, oldItemID, newFolderID, newName); 410 remoteClient.AgentId, oldAgentID, oldItemID, newFolderID, newName);
409 411
410 InventoryItemBase item = CommsManager.UserProfileCacheService.libraryRoot.HasItem(oldItemID); 412 InventoryItemBase item = CommsManager.UserProfileCacheService.libraryRoot.FindItem(oldItemID);
413
411 if (item == null) 414 if (item == null)
412 { 415 {
413 CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(oldAgentID); 416 CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(oldAgentID);
@@ -419,7 +422,8 @@ namespace OpenSim.Region.Environment.Scenes
419 422
420 if (userInfo.RootFolder != null) 423 if (userInfo.RootFolder != null)
421 { 424 {
422 item = userInfo.RootFolder.HasItem(oldItemID); 425 item = userInfo.RootFolder.FindItem(oldItemID);
426
423 if (item == null) 427 if (item == null)
424 { 428 {
425 m_log.Error("[AGENT INVENTORY]: Failed to find item " + oldItemID.ToString()); 429 m_log.Error("[AGENT INVENTORY]: Failed to find item " + oldItemID.ToString());
@@ -478,7 +482,8 @@ namespace OpenSim.Region.Environment.Scenes
478 482
479 if (userInfo.RootFolder != null) 483 if (userInfo.RootFolder != null)
480 { 484 {
481 InventoryItemBase item = userInfo.RootFolder.HasItem(itemID); 485 InventoryItemBase item = userInfo.RootFolder.FindItem(itemID);
486
482 if (item != null) 487 if (item != null)
483 { 488 {
484 if (newName != String.Empty) 489 if (newName != String.Empty)
@@ -615,9 +620,13 @@ namespace OpenSim.Region.Environment.Scenes
615 { 620 {
616 CachedUserInfo userInfo 621 CachedUserInfo userInfo
617 = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); 622 = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
623
618 if (userInfo == null) 624 if (userInfo == null)
619 { 625 {
620 m_log.Error("[AGENT INVENTORY]: Failed to find user " + remoteClient.AgentId.ToString()); 626 m_log.ErrorFormat(
627 "[AGENT INVENTORY]: Failed to find user {0} {1} to remove inventory item {2}",
628 remoteClient.Name, remoteClient.AgentId, itemID);
629
621 return; 630 return;
622 } 631 }
623 632
@@ -627,7 +636,8 @@ namespace OpenSim.Region.Environment.Scenes
627 // the trash folder directly instead of RootFolder? 636 // the trash folder directly instead of RootFolder?
628 if (userInfo.RootFolder != null) 637 if (userInfo.RootFolder != null)
629 { 638 {
630 InventoryItemBase item = userInfo.RootFolder.HasItem(itemID); 639 InventoryItemBase item = userInfo.RootFolder.FindItem(itemID);
640
631 if (item != null) 641 if (item != null)
632 { 642 {
633 userInfo.DeleteItem(item); 643 userInfo.DeleteItem(item);
@@ -654,7 +664,7 @@ namespace OpenSim.Region.Environment.Scenes
654 664
655 if (userInfo.RootFolder != null) 665 if (userInfo.RootFolder != null)
656 { 666 {
657 InventoryItemBase folder = userInfo.RootFolder.HasItem(folderID); 667 InventoryItemBase folder = userInfo.RootFolder.FindItem(folderID);
658 668
659 if (folder != null) 669 if (folder != null)
660 { 670 {
@@ -833,13 +843,13 @@ namespace OpenSim.Region.Environment.Scenes
833 843
834 if (userInfo != null && userInfo.RootFolder != null) 844 if (userInfo != null && userInfo.RootFolder != null)
835 { 845 {
836 InventoryItemBase item = userInfo.RootFolder.HasItem(itemID); 846 InventoryItemBase item = userInfo.RootFolder.FindItem(itemID);
837 847
838 // Try library 848 // Try library
839 // XXX clumsy, possibly should be one call 849 // XXX clumsy, possibly should be one call
840 if (null == item) 850 if (null == item)
841 { 851 {
842 item = CommsManager.UserProfileCacheService.libraryRoot.HasItem(itemID); 852 item = CommsManager.UserProfileCacheService.libraryRoot.FindItem(itemID);
843 } 853 }
844 854
845 if (item != null) 855 if (item != null)
@@ -884,13 +894,13 @@ namespace OpenSim.Region.Environment.Scenes
884 894
885 if (userInfo != null && userInfo.RootFolder != null) 895 if (userInfo != null && userInfo.RootFolder != null)
886 { 896 {
887 InventoryItemBase item = userInfo.RootFolder.HasItem(itemID); 897 InventoryItemBase item = userInfo.RootFolder.FindItem(itemID);
888 898
889 // Try library 899 // Try library
890 // XXX clumsy, possibly should be one call 900 // XXX clumsy, possibly should be one call
891 if (null == item) 901 if (null == item)
892 { 902 {
893 item = CommsManager.UserProfileCacheService.libraryRoot.HasItem(itemID); 903 item = CommsManager.UserProfileCacheService.libraryRoot.FindItem(itemID);
894 } 904 }
895 905
896 if (item != null) 906 if (item != null)
@@ -1203,14 +1213,11 @@ namespace OpenSim.Region.Environment.Scenes
1203 uint EveryoneMask, uint GroupMask, uint NextOwnerMask, uint ItemFlags, 1213 uint EveryoneMask, uint GroupMask, uint NextOwnerMask, uint ItemFlags,
1204 bool RezSelected, bool RemoveItem, LLUUID fromTaskID) 1214 bool RezSelected, bool RemoveItem, LLUUID fromTaskID)
1205 { 1215 {
1206 SceneObjectGroup sog = RezObject(remoteClient, itemID, RayEnd, RayStart, 1216 RezObject(
1207 RayTargetID, BypassRayCast, RayEndIsIntersection, 1217 remoteClient, itemID, RayEnd, RayStart, RayTargetID, BypassRayCast, RayEndIsIntersection,
1208 EveryoneMask, GroupMask, NextOwnerMask, ItemFlags, 1218 EveryoneMask, GroupMask, NextOwnerMask, ItemFlags, RezSelected, RemoveItem, fromTaskID, false);
1209 RezSelected, RemoveItem, fromTaskID, false);
1210 } 1219 }
1211 1220
1212
1213
1214 /// <summary> 1221 /// <summary>
1215 /// Returns SceneObjectGroup or null from asset request. 1222 /// Returns SceneObjectGroup or null from asset request.
1216 /// </summary> 1223 /// </summary>
@@ -1265,7 +1272,8 @@ namespace OpenSim.Region.Environment.Scenes
1265 { 1272 {
1266 if (userInfo.RootFolder != null) 1273 if (userInfo.RootFolder != null)
1267 { 1274 {
1268 InventoryItemBase item = userInfo.RootFolder.HasItem(itemID); 1275 InventoryItemBase item = userInfo.RootFolder.FindItem(itemID);
1276
1269 if (item != null) 1277 if (item != null)
1270 { 1278 {
1271 AssetBase rezAsset = AssetCache.GetAsset(item.AssetID, false); 1279 AssetBase rezAsset = AssetCache.GetAsset(item.AssetID, false);
diff --git a/OpenSim/Region/Modules/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/Modules/AvatarFactory/AvatarFactoryModule.cs
index 0ee8848..7b1211f 100644
--- a/OpenSim/Region/Modules/AvatarFactory/AvatarFactoryModule.cs
+++ b/OpenSim/Region/Modules/AvatarFactory/AvatarFactoryModule.cs
@@ -300,7 +300,8 @@ namespace OpenSim.Region.Modules.AvatarFactory
300 { 300 {
301 LLUUID assetId; 301 LLUUID assetId;
302 302
303 InventoryItemBase baseItem = profile.RootFolder.HasItem(wear.ItemID); 303 InventoryItemBase baseItem = profile.RootFolder.FindItem(wear.ItemID);
304
304 if (baseItem != null) 305 if (baseItem != null)
305 { 306 {
306 assetId = baseItem.AssetID; 307 assetId = baseItem.AssetID;