aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
diff options
context:
space:
mode:
authorSean Dague2008-04-07 23:15:35 +0000
committerSean Dague2008-04-07 23:15:35 +0000
commitf43681510725f5b95fcb864a1f3e4b744fcaf992 (patch)
tree2d34caa75488d1c608d1a21b4888cb0f264a6cba /OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
parentneeded to add 4 characters to support the dashes (diff)
downloadopensim-SC_OLD-f43681510725f5b95fcb864a1f3e4b744fcaf992.zip
opensim-SC_OLD-f43681510725f5b95fcb864a1f3e4b744fcaf992.tar.gz
opensim-SC_OLD-f43681510725f5b95fcb864a1f3e4b744fcaf992.tar.bz2
opensim-SC_OLD-f43681510725f5b95fcb864a1f3e4b744fcaf992.tar.xz
Refactor InventoryItemBase to do the following:
* wrap fields as Properties * rename some fields/properties to more sensible names * set style to PropName to match more standard C# approach
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Scene.Inventory.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.Inventory.cs122
1 files changed, 61 insertions, 61 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
index 7ef3285..052cb02 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
@@ -114,19 +114,19 @@ namespace OpenSim.Region.Environment.Scenes
114 if (item != null) 114 if (item != null)
115 { 115 {
116 AssetBase asset = 116 AssetBase asset =
117 CreateAsset(item.inventoryName, item.inventoryDescription, (sbyte) item.invType, 117 CreateAsset(item.Name, item.Description, (sbyte) item.InvType,
118 (sbyte) item.assetType, data); 118 (sbyte) item.AssetType, data);
119 AssetCache.AddAsset(asset); 119 AssetCache.AddAsset(asset);
120 120
121 item.assetID = asset.FullID; 121 item.AssetID = asset.FullID;
122 userInfo.UpdateItem(remoteClient.AgentId, item); 122 userInfo.UpdateItem(remoteClient.AgentId, item);
123 123
124 // remoteClient.SendInventoryItemCreateUpdate(item); 124 // remoteClient.SendInventoryItemCreateUpdate(item);
125 if ((InventoryType) item.invType == InventoryType.Notecard) 125 if ((InventoryType) item.InvType == InventoryType.Notecard)
126 { 126 {
127 //do we want to know about updated note cards? 127 //do we want to know about updated note cards?
128 } 128 }
129 else if ((InventoryType) item.invType == InventoryType.LSL) 129 else if ((InventoryType) item.InvType == InventoryType.LSL)
130 { 130 {
131 // do we want to know about updated scripts 131 // do we want to know about updated scripts
132 } 132 }
@@ -258,9 +258,9 @@ namespace OpenSim.Region.Environment.Scenes
258 { 258 {
259 if (LLUUID.Zero == transactionID) 259 if (LLUUID.Zero == transactionID)
260 { 260 {
261 item.inventoryName = name; 261 item.Name = name;
262 item.inventoryDescription = description; 262 item.Description = description;
263 item.inventoryNextPermissions = nextOwnerMask; 263 item.NextPermissions = nextOwnerMask;
264 264
265 userInfo.UpdateItem(remoteClient.AgentId, item); 265 userInfo.UpdateItem(remoteClient.AgentId, item);
266 } 266 }
@@ -319,20 +319,20 @@ namespace OpenSim.Region.Environment.Scenes
319 { 319 {
320 // Insert a copy of the item into the recipient 320 // Insert a copy of the item into the recipient
321 InventoryItemBase itemCopy = new InventoryItemBase(); 321 InventoryItemBase itemCopy = new InventoryItemBase();
322 itemCopy.avatarID = recipientClient.AgentId; 322 itemCopy.Owner = recipientClient.AgentId;
323 itemCopy.creatorsID = senderId; 323 itemCopy.Creator = senderId;
324 itemCopy.inventoryID = LLUUID.Random(); 324 itemCopy.ID = LLUUID.Random();
325 itemCopy.assetID = item.assetID; 325 itemCopy.AssetID = item.AssetID;
326 itemCopy.inventoryDescription = item.inventoryDescription; 326 itemCopy.Description = item.Description;
327 itemCopy.inventoryName = item.inventoryName; 327 itemCopy.Name = item.Name;
328 itemCopy.assetType = item.assetType; 328 itemCopy.AssetType = item.AssetType;
329 itemCopy.invType = item.invType; 329 itemCopy.InvType = item.InvType;
330 itemCopy.parentFolderID = recipientUserInfo.RootFolder.folderID; 330 itemCopy.Folder = recipientUserInfo.RootFolder.folderID;
331 itemCopy.inventoryCurrentPermissions = 2147483647; 331 itemCopy.CurrentPermissions = 2147483647;
332 itemCopy.inventoryNextPermissions = 2147483647; 332 itemCopy.NextPermissions = 2147483647;
333 itemCopy.inventoryEveryOnePermissions = item.inventoryEveryOnePermissions; 333 itemCopy.EveryOnePermissions = item.EveryOnePermissions;
334 itemCopy.inventoryBasePermissions = item.inventoryBasePermissions; 334 itemCopy.BasePermissions = item.BasePermissions;
335 itemCopy.inventoryCurrentPermissions = item.inventoryCurrentPermissions; 335 itemCopy.CurrentPermissions = item.CurrentPermissions;
336 336
337 recipientUserInfo.AddItem(recipientClient.AgentId, itemCopy); 337 recipientUserInfo.AddItem(recipientClient.AgentId, itemCopy);
338 338
@@ -343,8 +343,8 @@ namespace OpenSim.Region.Environment.Scenes
343 { 343 {
344 m_log.ErrorFormat( 344 m_log.ErrorFormat(
345 "[AGENT INVENTORY]: Could not find userinfo for recipient user {0}, {1} of item {2}, {3} from {4}", 345 "[AGENT INVENTORY]: Could not find userinfo for recipient user {0}, {1} of item {2}, {3} from {4}",
346 recipientClient.Name, recipientClient.AgentId, item.inventoryName, 346 recipientClient.Name, recipientClient.AgentId, item.Name,
347 item.inventoryID, senderId); 347 item.ID, senderId);
348 } 348 }
349 } 349 }
350 else 350 else
@@ -397,19 +397,19 @@ namespace OpenSim.Region.Environment.Scenes
397 397
398 AssetBase asset 398 AssetBase asset
399 = AssetCache.GetAsset( 399 = AssetCache.GetAsset(
400 item.assetID, (item.assetType == (int)AssetType.Texture ? true : false)); 400 item.AssetID, (item.AssetType == (int)AssetType.Texture ? true : false));
401 401
402 if (asset != null) 402 if (asset != null)
403 { 403 {
404 // TODO: preserve current permissions? 404 // TODO: preserve current permissions?
405 CreateNewInventoryItem( 405 CreateNewInventoryItem(
406 remoteClient, newFolderID, callbackID, asset, item.inventoryNextPermissions); 406 remoteClient, newFolderID, callbackID, asset, item.NextPermissions);
407 } 407 }
408 else 408 else
409 { 409 {
410 m_log.ErrorFormat( 410 m_log.ErrorFormat(
411 "[AGENT INVENTORY]: Could not copy item {0} since asset {1} could not be found", 411 "[AGENT INVENTORY]: Could not copy item {0} since asset {1} could not be found",
412 item.inventoryName, item.assetID); 412 item.Name, item.AssetID);
413 } 413 }
414 } 414 }
415 415
@@ -445,9 +445,9 @@ namespace OpenSim.Region.Environment.Scenes
445 { 445 {
446 if (newName != System.String.Empty) 446 if (newName != System.String.Empty)
447 { 447 {
448 item.inventoryName = newName; 448 item.Name = newName;
449 } 449 }
450 item.parentFolderID = folderID; 450 item.Folder = folderID;
451 userInfo.DeleteItem(remoteClient.AgentId, item); 451 userInfo.DeleteItem(remoteClient.AgentId, item);
452 452
453 // TODO: preserve current permissions? 453 // TODO: preserve current permissions?
@@ -483,17 +483,17 @@ namespace OpenSim.Region.Environment.Scenes
483 if (userInfo != null) 483 if (userInfo != null)
484 { 484 {
485 InventoryItemBase item = new InventoryItemBase(); 485 InventoryItemBase item = new InventoryItemBase();
486 item.avatarID = remoteClient.AgentId; 486 item.Owner = remoteClient.AgentId;
487 item.creatorsID = remoteClient.AgentId; 487 item.Creator = remoteClient.AgentId;
488 item.inventoryID = LLUUID.Random(); 488 item.ID = LLUUID.Random();
489 item.assetID = asset.FullID; 489 item.AssetID = asset.FullID;
490 item.inventoryDescription = asset.Description; 490 item.Description = asset.Description;
491 item.inventoryName = asset.Name; 491 item.Name = asset.Name;
492 item.assetType = asset.Type; 492 item.AssetType = asset.Type;
493 item.invType = asset.InvType; 493 item.InvType = asset.InvType;
494 item.parentFolderID = folderID; 494 item.Folder = folderID;
495 item.inventoryCurrentPermissions = 2147483647; 495 item.CurrentPermissions = 2147483647;
496 item.inventoryNextPermissions = nextOwnerMask; 496 item.NextPermissions = nextOwnerMask;
497 497
498 userInfo.AddItem(remoteClient.AgentId, item); 498 userInfo.AddItem(remoteClient.AgentId, item);
499 remoteClient.SendInventoryItemCreateUpdate(item); 499 remoteClient.SendInventoryItemCreateUpdate(item);
@@ -708,12 +708,12 @@ namespace OpenSim.Region.Environment.Scenes
708 708
709 if (item != null) 709 if (item != null)
710 { 710 {
711 if (item.assetType == 0 || item.assetType == 1 || item.assetType == 10) 711 if (item.AssetType == 0 || item.AssetType == 1 || item.AssetType == 10)
712 { 712 {
713 group.AddInventoryItem(remoteClient, primLocalID, item, copyID); 713 group.AddInventoryItem(remoteClient, primLocalID, item, copyID);
714 m_log.InfoFormat( 714 m_log.InfoFormat(
715 "[PRIM INVENTORY]: Update with item {0} requested of prim {1} for {2}", 715 "[PRIM INVENTORY]: Update with item {0} requested of prim {1} for {2}",
716 item.inventoryName, primLocalID, remoteClient.Name); 716 item.Name, primLocalID, remoteClient.Name);
717 group.GetProperties(remoteClient); 717 group.GetProperties(remoteClient);
718 } 718 }
719 else 719 else
@@ -725,7 +725,7 @@ namespace OpenSim.Region.Environment.Scenes
725 // nasty way it is done to be changed). 725 // nasty way it is done to be changed).
726 m_log.WarnFormat( 726 m_log.WarnFormat(
727 "[PRIM INVENTORY]: Sorry, prim inventory storage of asset type {0} is not yet supported", 727 "[PRIM INVENTORY]: Sorry, prim inventory storage of asset type {0} is not yet supported",
728 item.assetType); 728 item.AssetType);
729 } 729 }
730 } 730 }
731 else 731 else
@@ -790,7 +790,7 @@ namespace OpenSim.Region.Environment.Scenes
790 "[PRIM INVENTORY]: " + 790 "[PRIM INVENTORY]: " +
791 "Could not rez script {0} into prim local ID {1} for user {2}" 791 "Could not rez script {0} into prim local ID {1} for user {2}"
792 + " because the prim could not be found in the region!", 792 + " because the prim could not be found in the region!",
793 item.inventoryName, localID, remoteClient.Name); 793 item.Name, localID, remoteClient.Name);
794 } 794 }
795 } 795 }
796 else 796 else
@@ -863,21 +863,21 @@ namespace OpenSim.Region.Environment.Scenes
863 AssetCache.AddAsset(asset); 863 AssetCache.AddAsset(asset);
864 864
865 InventoryItemBase item = new InventoryItemBase(); 865 InventoryItemBase item = new InventoryItemBase();
866 item.avatarID = remoteClient.AgentId; 866 item.Owner = remoteClient.AgentId;
867 item.creatorsID = remoteClient.AgentId; 867 item.Creator = remoteClient.AgentId;
868 item.inventoryID = LLUUID.Random(); 868 item.ID = LLUUID.Random();
869 item.assetID = asset.FullID; 869 item.AssetID = asset.FullID;
870 item.inventoryDescription = asset.Description; 870 item.Description = asset.Description;
871 item.inventoryName = asset.Name; 871 item.Name = asset.Name;
872 item.assetType = asset.Type; 872 item.AssetType = asset.Type;
873 item.invType = asset.InvType; 873 item.InvType = asset.InvType;
874 item.parentFolderID = DeRezPacket.AgentBlock.DestinationID; 874 item.Folder = DeRezPacket.AgentBlock.DestinationID;
875 item.inventoryCurrentPermissions = 2147483647; 875 item.CurrentPermissions = 2147483647;
876 item.inventoryNextPermissions = 2147483647; 876 item.NextPermissions = 2147483647;
877 item.inventoryEveryOnePermissions = 877 item.EveryOnePermissions =
878 ((SceneObjectGroup) selectedEnt).RootPart.EveryoneMask; 878 ((SceneObjectGroup) selectedEnt).RootPart.EveryoneMask;
879 item.inventoryBasePermissions = ((SceneObjectGroup) selectedEnt).RootPart.BaseMask; 879 item.BasePermissions = ((SceneObjectGroup) selectedEnt).RootPart.BaseMask;
880 item.inventoryCurrentPermissions = ((SceneObjectGroup) selectedEnt).RootPart.OwnerMask; 880 item.CurrentPermissions = ((SceneObjectGroup) selectedEnt).RootPart.OwnerMask;
881 881
882 userInfo.AddItem(remoteClient.AgentId, item); 882 userInfo.AddItem(remoteClient.AgentId, item);
883 remoteClient.SendInventoryItemCreateUpdate(item); 883 remoteClient.SendInventoryItemCreateUpdate(item);
@@ -942,7 +942,7 @@ namespace OpenSim.Region.Environment.Scenes
942 InventoryItemBase item = userInfo.RootFolder.HasItem(itemID); 942 InventoryItemBase item = userInfo.RootFolder.HasItem(itemID);
943 if (item != null) 943 if (item != null)
944 { 944 {
945 AssetBase rezAsset = AssetCache.GetAsset(item.assetID, false); 945 AssetBase rezAsset = AssetCache.GetAsset(item.AssetID, false);
946 946
947 if (rezAsset != null) 947 if (rezAsset != null)
948 { 948 {
@@ -956,8 +956,8 @@ namespace OpenSim.Region.Environment.Scenes
956 // Since renaming the item in the inventory does not affect the name stored 956 // Since renaming the item in the inventory does not affect the name stored
957 // in the serialization, transfer the correct name from the inventory to the 957 // in the serialization, transfer the correct name from the inventory to the
958 // object itself before we rez. 958 // object itself before we rez.
959 rootPart.Name = item.inventoryName; 959 rootPart.Name = item.Name;
960 rootPart.Description = item.inventoryDescription; 960 rootPart.Description = item.Description;
961 961
962 rootPart.TrimPermissions(); 962 rootPart.TrimPermissions();
963 group.ApplyPhysics(m_physicalPrim); 963 group.ApplyPhysics(m_physicalPrim);