diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/Framework/InventoryAccess')
5 files changed, 86 insertions, 86 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs index f54298c..51ae217 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs | |||
@@ -178,7 +178,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
178 | { | 178 | { |
179 | UUID uuid = UUID.Zero; | 179 | UUID uuid = UUID.Zero; |
180 | UUID.TryParse(meta.CreatorID, out uuid); | 180 | UUID.TryParse(meta.CreatorID, out uuid); |
181 | UserAccount creator = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, uuid); | 181 | UserAccount creator = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, uuid); |
182 | if (creator != null) | 182 | if (creator != null) |
183 | meta.CreatorID = m_HomeURI + ";" + creator.FirstName + " " + creator.LastName; | 183 | meta.CreatorID = m_HomeURI + ";" + creator.FirstName + " " + creator.LastName; |
184 | } | 184 | } |
@@ -300,8 +300,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
300 | { | 300 | { |
301 | m_log.Error( | 301 | m_log.Error( |
302 | string.Format( | 302 | string.Format( |
303 | "[HG ASSET MAPPER]: Failed to post asset {0} (type {1}, length {2}) referenced from {3} to {4} with exception ", | 303 | "[HG ASSET MAPPER]: Failed to post asset {0} (type {1}, length {2}) referenced from {3} to {4} with exception ", |
304 | asset.ID, asset.Type, asset.Data.Length, assetID, userAssetURL), | 304 | asset.ID, asset.Type, asset.Data.Length, assetID, userAssetURL), |
305 | e); | 305 | e); |
306 | 306 | ||
307 | // For debugging purposes for now we will continue to throw the exception up the stack as was already happening. However, after | 307 | // For debugging purposes for now we will continue to throw the exception up the stack as was already happening. However, after |
@@ -315,7 +315,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
315 | else | 315 | else |
316 | { | 316 | { |
317 | m_log.DebugFormat( | 317 | m_log.DebugFormat( |
318 | "[HG ASSET MAPPER]: Didn't post asset {0} referenced from {1} because it already exists in asset server {2}", | 318 | "[HG ASSET MAPPER]: Didn't post asset {0} referenced from {1} because it already exists in asset server {2}", |
319 | uuid, assetID, userAssetURL); | 319 | uuid, assetID, userAssetURL); |
320 | } | 320 | } |
321 | } | 321 | } |
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs index 4d7c25b..f89e446 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs | |||
@@ -91,9 +91,9 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
91 | if (name == Name) | 91 | if (name == Name) |
92 | { | 92 | { |
93 | m_Enabled = true; | 93 | m_Enabled = true; |
94 | 94 | ||
95 | InitialiseCommon(source); | 95 | InitialiseCommon(source); |
96 | 96 | ||
97 | m_log.InfoFormat("[HG INVENTORY ACCESS MODULE]: {0} enabled.", Name); | 97 | m_log.InfoFormat("[HG INVENTORY ACCESS MODULE]: {0} enabled.", Name); |
98 | 98 | ||
99 | IConfig thisModuleConfig = source.Configs["HGInventoryAccessModule"]; | 99 | IConfig thisModuleConfig = source.Configs["HGInventoryAccessModule"]; |
@@ -117,7 +117,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
117 | m_log.Warn("[HG INVENTORY ACCESS MODULE]: HGInventoryAccessModule configs not found. ProfileServerURI not set!"); | 117 | m_log.Warn("[HG INVENTORY ACCESS MODULE]: HGInventoryAccessModule configs not found. ProfileServerURI not set!"); |
118 | 118 | ||
119 | m_bypassPermissions = !Util.GetConfigVarFromSections<bool>(source, "serverside_object_permissions", | 119 | m_bypassPermissions = !Util.GetConfigVarFromSections<bool>(source, "serverside_object_permissions", |
120 | new string[] { "Startup", "Permissions" }, true); | 120 | new string[] { "Startup", "Permissions" }, true); |
121 | 121 | ||
122 | } | 122 | } |
123 | } | 123 | } |
@@ -248,7 +248,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
248 | } | 248 | } |
249 | 249 | ||
250 | 250 | ||
251 | /// | 251 | /// |
252 | /// CapsUpdateInventoryItemAsset | 252 | /// CapsUpdateInventoryItemAsset |
253 | /// | 253 | /// |
254 | public override UUID CapsUpdateInventoryItemAsset(IClientAPI remoteClient, UUID itemID, byte[] data) | 254 | public override UUID CapsUpdateInventoryItemAsset(IClientAPI remoteClient, UUID itemID, byte[] data) |
@@ -268,7 +268,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
268 | return newAssetID; | 268 | return newAssetID; |
269 | } | 269 | } |
270 | 270 | ||
271 | /// | 271 | /// |
272 | /// UpdateInventoryItemAsset | 272 | /// UpdateInventoryItemAsset |
273 | /// | 273 | /// |
274 | public override bool UpdateInventoryItemAsset(UUID ownerID, InventoryItemBase item, AssetBase asset) | 274 | public override bool UpdateInventoryItemAsset(UUID ownerID, InventoryItemBase item, AssetBase asset) |
@@ -317,7 +317,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
317 | RezSelected, RemoveItem, fromTaskID, attachment); | 317 | RezSelected, RemoveItem, fromTaskID, attachment); |
318 | } | 318 | } |
319 | 319 | ||
320 | public override SceneObjectGroup RezObject(IClientAPI remoteClient, UUID itemID, | 320 | public override SceneObjectGroup RezObject(IClientAPI remoteClient, UUID itemID, |
321 | UUID groupID, Vector3 RayEnd, Vector3 RayStart, | 321 | UUID groupID, Vector3 RayEnd, Vector3 RayStart, |
322 | UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection, | 322 | UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection, |
323 | bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment) | 323 | bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment) |
@@ -386,7 +386,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
386 | if (!m_CheckSeparateAssets) | 386 | if (!m_CheckSeparateAssets) |
387 | { | 387 | { |
388 | if (!UserManagementModule.IsLocalGridUser(userID)) | 388 | if (!UserManagementModule.IsLocalGridUser(userID)) |
389 | { // foreign | 389 | { // foreign |
390 | ScenePresence sp = null; | 390 | ScenePresence sp = null; |
391 | if (m_Scene.TryGetScenePresence(userID, out sp)) | 391 | if (m_Scene.TryGetScenePresence(userID, out sp)) |
392 | { | 392 | { |
@@ -524,7 +524,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
524 | foreach (InventoryItemBase it in content.Items) | 524 | foreach (InventoryItemBase it in content.Items) |
525 | it.Name = it.Name + " (Unavailable)"; ; | 525 | it.Name = it.Name + " (Unavailable)"; ; |
526 | 526 | ||
527 | // Send the new names | 527 | // Send the new names |
528 | inv.SendBulkUpdateInventory(keep.ToArray(), content.Items.ToArray()); | 528 | inv.SendBulkUpdateInventory(keep.ToArray(), content.Items.ToArray()); |
529 | 529 | ||
530 | } | 530 | } |
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index 771e5fe..fcf373b 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs | |||
@@ -68,7 +68,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
68 | return m_UserManagement; | 68 | return m_UserManagement; |
69 | } | 69 | } |
70 | } | 70 | } |
71 | 71 | ||
72 | public bool CoalesceMultipleObjectsToInventory { get; set; } | 72 | public bool CoalesceMultipleObjectsToInventory { get; set; } |
73 | 73 | ||
74 | #region INonSharedRegionModule | 74 | #region INonSharedRegionModule |
@@ -92,14 +92,14 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
92 | if (name == Name) | 92 | if (name == Name) |
93 | { | 93 | { |
94 | m_Enabled = true; | 94 | m_Enabled = true; |
95 | 95 | ||
96 | InitialiseCommon(source); | 96 | InitialiseCommon(source); |
97 | 97 | ||
98 | m_log.InfoFormat("[INVENTORY ACCESS MODULE]: {0} enabled.", Name); | 98 | m_log.InfoFormat("[INVENTORY ACCESS MODULE]: {0} enabled.", Name); |
99 | } | 99 | } |
100 | } | 100 | } |
101 | } | 101 | } |
102 | 102 | ||
103 | /// <summary> | 103 | /// <summary> |
104 | /// Common module config for both this and descendant classes. | 104 | /// Common module config for both this and descendant classes. |
105 | /// </summary> | 105 | /// </summary> |
@@ -107,9 +107,9 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
107 | protected virtual void InitialiseCommon(IConfigSource source) | 107 | protected virtual void InitialiseCommon(IConfigSource source) |
108 | { | 108 | { |
109 | IConfig inventoryConfig = source.Configs["Inventory"]; | 109 | IConfig inventoryConfig = source.Configs["Inventory"]; |
110 | 110 | ||
111 | if (inventoryConfig != null) | 111 | if (inventoryConfig != null) |
112 | CoalesceMultipleObjectsToInventory | 112 | CoalesceMultipleObjectsToInventory |
113 | = inventoryConfig.GetBoolean("CoalesceMultipleObjectsToInventory", true); | 113 | = inventoryConfig.GetBoolean("CoalesceMultipleObjectsToInventory", true); |
114 | else | 114 | else |
115 | CoalesceMultipleObjectsToInventory = true; | 115 | CoalesceMultipleObjectsToInventory = true; |
@@ -322,7 +322,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
322 | if (item != null && item.Owner == ownerID && asset != null) | 322 | if (item != null && item.Owner == ownerID && asset != null) |
323 | { | 323 | { |
324 | // m_log.DebugFormat( | 324 | // m_log.DebugFormat( |
325 | // "[INVENTORY ACCESS MODULE]: Updating item {0} {1} with new asset {2}", | 325 | // "[INVENTORY ACCESS MODULE]: Updating item {0} {1} with new asset {2}", |
326 | // item.Name, item.ID, asset.ID); | 326 | // item.Name, item.ID, asset.ID); |
327 | 327 | ||
328 | item.AssetID = asset.FullID; | 328 | item.AssetID = asset.FullID; |
@@ -351,7 +351,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
351 | List<InventoryItemBase> copiedItems = new List<InventoryItemBase>(); | 351 | List<InventoryItemBase> copiedItems = new List<InventoryItemBase>(); |
352 | 352 | ||
353 | Dictionary<UUID, List<SceneObjectGroup>> bundlesToCopy = new Dictionary<UUID, List<SceneObjectGroup>>(); | 353 | Dictionary<UUID, List<SceneObjectGroup>> bundlesToCopy = new Dictionary<UUID, List<SceneObjectGroup>>(); |
354 | 354 | ||
355 | if (CoalesceMultipleObjectsToInventory) | 355 | if (CoalesceMultipleObjectsToInventory) |
356 | { | 356 | { |
357 | // The following code groups the SOG's by owner. No objects | 357 | // The following code groups the SOG's by owner. No objects |
@@ -361,7 +361,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
361 | { | 361 | { |
362 | if (!bundlesToCopy.ContainsKey(g.OwnerID)) | 362 | if (!bundlesToCopy.ContainsKey(g.OwnerID)) |
363 | bundlesToCopy[g.OwnerID] = new List<SceneObjectGroup>(); | 363 | bundlesToCopy[g.OwnerID] = new List<SceneObjectGroup>(); |
364 | 364 | ||
365 | bundlesToCopy[g.OwnerID].Add(g); | 365 | bundlesToCopy[g.OwnerID].Add(g); |
366 | } | 366 | } |
367 | } | 367 | } |
@@ -372,7 +372,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
372 | { | 372 | { |
373 | List<SceneObjectGroup> bundle = new List<SceneObjectGroup>(); | 373 | List<SceneObjectGroup> bundle = new List<SceneObjectGroup>(); |
374 | bundle.Add(g); | 374 | bundle.Add(g); |
375 | bundlesToCopy[g.UUID] = bundle; | 375 | bundlesToCopy[g.UUID] = bundle; |
376 | } | 376 | } |
377 | } | 377 | } |
378 | 378 | ||
@@ -384,10 +384,10 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
384 | // with distinct destinations as well. | 384 | // with distinct destinations as well. |
385 | foreach (List<SceneObjectGroup> bundle in bundlesToCopy.Values) | 385 | foreach (List<SceneObjectGroup> bundle in bundlesToCopy.Values) |
386 | copiedItems.Add(CopyBundleToInventory(action, folderID, bundle, remoteClient, asAttachment)); | 386 | copiedItems.Add(CopyBundleToInventory(action, folderID, bundle, remoteClient, asAttachment)); |
387 | 387 | ||
388 | return copiedItems; | 388 | return copiedItems; |
389 | } | 389 | } |
390 | 390 | ||
391 | /// <summary> | 391 | /// <summary> |
392 | /// Copy a bundle of objects to inventory. If there is only one object, then this will create an object | 392 | /// Copy a bundle of objects to inventory. If there is only one object, then this will create an object |
393 | /// item. If there are multiple objects then these will be saved as a single coalesced item. | 393 | /// item. If there are multiple objects then these will be saved as a single coalesced item. |
@@ -408,7 +408,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
408 | Dictionary<UUID, Quaternion> originalRotations = new Dictionary<UUID, Quaternion>(); | 408 | Dictionary<UUID, Quaternion> originalRotations = new Dictionary<UUID, Quaternion>(); |
409 | // this possible is not needed if keyframes are saved | 409 | // this possible is not needed if keyframes are saved |
410 | Dictionary<UUID, KeyframeMotion> originalKeyframes = new Dictionary<UUID, KeyframeMotion>(); | 410 | Dictionary<UUID, KeyframeMotion> originalKeyframes = new Dictionary<UUID, KeyframeMotion>(); |
411 | 411 | ||
412 | foreach (SceneObjectGroup objectGroup in objlist) | 412 | foreach (SceneObjectGroup objectGroup in objlist) |
413 | { | 413 | { |
414 | if (objectGroup.RootPart.KeyframeMotion != null) | 414 | if (objectGroup.RootPart.KeyframeMotion != null) |
@@ -457,7 +457,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
457 | (uint)PermissionMask.Export); | 457 | (uint)PermissionMask.Export); |
458 | objectGroup.RootPart.NextOwnerMask |= | 458 | objectGroup.RootPart.NextOwnerMask |= |
459 | (uint)PermissionMask.Move; | 459 | (uint)PermissionMask.Move; |
460 | 460 | ||
461 | coa.Add(objectGroup); | 461 | coa.Add(objectGroup); |
462 | } | 462 | } |
463 | 463 | ||
@@ -471,7 +471,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
471 | itemXml = CoalescedSceneObjectsSerializer.ToXml(coa, !asAttachment); | 471 | itemXml = CoalescedSceneObjectsSerializer.ToXml(coa, !asAttachment); |
472 | else | 472 | else |
473 | itemXml = SceneObjectSerializer.ToOriginalXmlFormat(objlist[0], !asAttachment); | 473 | itemXml = SceneObjectSerializer.ToOriginalXmlFormat(objlist[0], !asAttachment); |
474 | 474 | ||
475 | // Restore the position of each group now that it has been stored to inventory. | 475 | // Restore the position of each group now that it has been stored to inventory. |
476 | foreach (SceneObjectGroup objectGroup in objlist) | 476 | foreach (SceneObjectGroup objectGroup in objlist) |
477 | { | 477 | { |
@@ -493,11 +493,11 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
493 | 493 | ||
494 | item.CreatorId = objlist[0].RootPart.CreatorID.ToString(); | 494 | item.CreatorId = objlist[0].RootPart.CreatorID.ToString(); |
495 | item.CreatorData = objlist[0].RootPart.CreatorData; | 495 | item.CreatorData = objlist[0].RootPart.CreatorData; |
496 | 496 | ||
497 | if (objlist.Count > 1) | 497 | if (objlist.Count > 1) |
498 | { | 498 | { |
499 | item.Flags = (uint)InventoryItemFlags.ObjectHasMultipleItems; | 499 | item.Flags = (uint)InventoryItemFlags.ObjectHasMultipleItems; |
500 | 500 | ||
501 | // If the objects have different creators then don't specify a creator at all | 501 | // If the objects have different creators then don't specify a creator at all |
502 | foreach (SceneObjectGroup objectGroup in objlist) | 502 | foreach (SceneObjectGroup objectGroup in objlist) |
503 | { | 503 | { |
@@ -513,8 +513,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
513 | else | 513 | else |
514 | { | 514 | { |
515 | item.SaleType = objlist[0].RootPart.ObjectSaleType; | 515 | item.SaleType = objlist[0].RootPart.ObjectSaleType; |
516 | item.SalePrice = objlist[0].RootPart.SalePrice; | 516 | item.SalePrice = objlist[0].RootPart.SalePrice; |
517 | } | 517 | } |
518 | 518 | ||
519 | AssetBase asset = CreateAsset( | 519 | AssetBase asset = CreateAsset( |
520 | objlist[0].GetPartName(objlist[0].RootPart.LocalId), | 520 | objlist[0].GetPartName(objlist[0].RootPart.LocalId), |
@@ -523,7 +523,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
523 | Utils.StringToBytes(itemXml), | 523 | Utils.StringToBytes(itemXml), |
524 | objlist[0].OwnerID.ToString()); | 524 | objlist[0].OwnerID.ToString()); |
525 | m_Scene.AssetService.Store(asset); | 525 | m_Scene.AssetService.Store(asset); |
526 | 526 | ||
527 | item.AssetID = asset.FullID; | 527 | item.AssetID = asset.FullID; |
528 | 528 | ||
529 | if (DeRezAction.SaveToExistingUserInventoryItem == action) | 529 | if (DeRezAction.SaveToExistingUserInventoryItem == action) |
@@ -562,7 +562,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
562 | // This is a hook to do some per-asset post-processing for subclasses that need that | 562 | // This is a hook to do some per-asset post-processing for subclasses that need that |
563 | if (remoteClient != null && action != DeRezAction.Delete) | 563 | if (remoteClient != null && action != DeRezAction.Delete) |
564 | ExportAsset(remoteClient.AgentId, asset.FullID); | 564 | ExportAsset(remoteClient.AgentId, asset.FullID); |
565 | 565 | ||
566 | return item; | 566 | return item; |
567 | } | 567 | } |
568 | 568 | ||
@@ -580,7 +580,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
580 | /// <param name="remoteClient"></param> | 580 | /// <param name="remoteClient"></param> |
581 | /// <returns></returns> | 581 | /// <returns></returns> |
582 | protected InventoryItemBase AddPermissions( | 582 | protected InventoryItemBase AddPermissions( |
583 | InventoryItemBase item, SceneObjectGroup so, List<SceneObjectGroup> objsForEffectivePermissions, | 583 | InventoryItemBase item, SceneObjectGroup so, List<SceneObjectGroup> objsForEffectivePermissions, |
584 | IClientAPI remoteClient) | 584 | IClientAPI remoteClient) |
585 | { | 585 | { |
586 | uint effectivePerms = (uint)(PermissionMask.Copy | PermissionMask.Transfer | PermissionMask.Modify | PermissionMask.Move | PermissionMask.Export) | 7; | 586 | uint effectivePerms = (uint)(PermissionMask.Copy | PermissionMask.Transfer | PermissionMask.Modify | PermissionMask.Move | PermissionMask.Export) | 7; |
@@ -614,7 +614,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
614 | item.NextPermissions = perms & so.RootPart.NextOwnerMask; | 614 | item.NextPermissions = perms & so.RootPart.NextOwnerMask; |
615 | item.EveryOnePermissions = so.RootPart.EveryoneMask & so.RootPart.NextOwnerMask; | 615 | item.EveryOnePermissions = so.RootPart.EveryoneMask & so.RootPart.NextOwnerMask; |
616 | item.GroupPermissions = so.RootPart.GroupMask & so.RootPart.NextOwnerMask; | 616 | item.GroupPermissions = so.RootPart.GroupMask & so.RootPart.NextOwnerMask; |
617 | 617 | ||
618 | // apply next owner perms on rez | 618 | // apply next owner perms on rez |
619 | item.CurrentPermissions |= SceneObjectGroup.SLAM; | 619 | item.CurrentPermissions |= SceneObjectGroup.SLAM; |
620 | } | 620 | } |
@@ -642,11 +642,11 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
642 | 7); // Preserve folded permissions | 642 | 7); // Preserve folded permissions |
643 | } | 643 | } |
644 | 644 | ||
645 | //PermissionsUtil.LogPermissions(item.Name, "After AddPermissions", item.BasePermissions, item.CurrentPermissions, item.NextPermissions); | 645 | //PermissionsUtil.LogPermissions(item.Name, "After AddPermissions", item.BasePermissions, item.CurrentPermissions, item.NextPermissions); |
646 | 646 | ||
647 | return item; | 647 | return item; |
648 | } | 648 | } |
649 | 649 | ||
650 | /// <summary> | 650 | /// <summary> |
651 | /// Create an item using details for the given scene object. | 651 | /// Create an item using details for the given scene object. |
652 | /// </summary> | 652 | /// </summary> |
@@ -659,7 +659,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
659 | DeRezAction action, IClientAPI remoteClient, SceneObjectGroup so, UUID folderID) | 659 | DeRezAction action, IClientAPI remoteClient, SceneObjectGroup so, UUID folderID) |
660 | { | 660 | { |
661 | // m_log.DebugFormat( | 661 | // m_log.DebugFormat( |
662 | // "[BASIC INVENTORY ACCESS MODULE]: Creating item for object {0} {1} for folder {2}, action {3}", | 662 | // "[BASIC INVENTORY ACCESS MODULE]: Creating item for object {0} {1} for folder {2}, action {3}", |
663 | // so.Name, so.UUID, folderID, action); | 663 | // so.Name, so.UUID, folderID, action); |
664 | // | 664 | // |
665 | // Get the user info of the item destination | 665 | // Get the user info of the item destination |
@@ -707,7 +707,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
707 | // Delete is treated like return in this case | 707 | // Delete is treated like return in this case |
708 | // Deleting your own items makes them go to trash | 708 | // Deleting your own items makes them go to trash |
709 | // | 709 | // |
710 | 710 | ||
711 | InventoryFolderBase folder = null; | 711 | InventoryFolderBase folder = null; |
712 | InventoryItemBase item = null; | 712 | InventoryItemBase item = null; |
713 | 713 | ||
@@ -723,7 +723,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
723 | m_log.DebugFormat( | 723 | m_log.DebugFormat( |
724 | "[INVENTORY ACCESS MODULE]: Object {0} {1} scheduled for save to inventory has already been deleted.", | 724 | "[INVENTORY ACCESS MODULE]: Object {0} {1} scheduled for save to inventory has already been deleted.", |
725 | so.Name, so.UUID); | 725 | so.Name, so.UUID); |
726 | 726 | ||
727 | return null; | 727 | return null; |
728 | } | 728 | } |
729 | } | 729 | } |
@@ -805,13 +805,13 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
805 | } | 805 | } |
806 | } | 806 | } |
807 | 807 | ||
808 | item = new InventoryItemBase(); | 808 | item = new InventoryItemBase(); |
809 | item.ID = UUID.Random(); | 809 | item.ID = UUID.Random(); |
810 | item.InvType = (int)InventoryType.Object; | 810 | item.InvType = (int)InventoryType.Object; |
811 | item.Folder = folder.ID; | 811 | item.Folder = folder.ID; |
812 | item.Owner = userID; | 812 | item.Owner = userID; |
813 | } | 813 | } |
814 | 814 | ||
815 | return item; | 815 | return item; |
816 | } | 816 | } |
817 | // compatibility do not use | 817 | // compatibility do not use |
@@ -863,7 +863,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
863 | byte BypassRayCast, bool RayEndIsIntersection, | 863 | byte BypassRayCast, bool RayEndIsIntersection, |
864 | bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment) | 864 | bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment) |
865 | { | 865 | { |
866 | AssetBase rezAsset = m_Scene.AssetService.Get(assetID.ToString()); | 866 | AssetBase rezAsset = m_Scene.AssetService.Get(assetID.ToString()); |
867 | 867 | ||
868 | if (rezAsset == null) | 868 | if (rezAsset == null) |
869 | { | 869 | { |
@@ -891,7 +891,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
891 | "[INVENTORY ACCESS MODULE]: missing data in asset {0} to RezObject()", | 891 | "[INVENTORY ACCESS MODULE]: missing data in asset {0} to RezObject()", |
892 | assetID, remoteClient.Name); | 892 | assetID, remoteClient.Name); |
893 | remoteClient.SendAgentAlertMessage(string.Format("Unable to rez: missing data in asset {0} ", assetID), false); | 893 | remoteClient.SendAgentAlertMessage(string.Format("Unable to rez: missing data in asset {0} ", assetID), false); |
894 | return null; | 894 | return null; |
895 | } | 895 | } |
896 | 896 | ||
897 | SceneObjectGroup group = null; | 897 | SceneObjectGroup group = null; |
@@ -903,7 +903,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
903 | byte bRayEndIsIntersection = (byte)(RayEndIsIntersection ? 1 : 0); | 903 | byte bRayEndIsIntersection = (byte)(RayEndIsIntersection ? 1 : 0); |
904 | Vector3 pos; | 904 | Vector3 pos; |
905 | 905 | ||
906 | bool single | 906 | bool single |
907 | = m_Scene.GetObjectsToRez( | 907 | = m_Scene.GetObjectsToRez( |
908 | rezAsset.Data, attachment, out objlist, out veclist, out bbox, out offsetHeight); | 908 | rezAsset.Data, attachment, out objlist, out veclist, out bbox, out offsetHeight); |
909 | 909 | ||
@@ -1055,7 +1055,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
1055 | /// <param name="isAttachment"></param> | 1055 | /// <param name="isAttachment"></param> |
1056 | /// <returns>true if we can processed with rezzing, false if we need to abort</returns> | 1056 | /// <returns>true if we can processed with rezzing, false if we need to abort</returns> |
1057 | private bool DoPreRezWhenFromItem( | 1057 | private bool DoPreRezWhenFromItem( |
1058 | IClientAPI remoteClient, InventoryItemBase item, List<SceneObjectGroup> objlist, | 1058 | IClientAPI remoteClient, InventoryItemBase item, List<SceneObjectGroup> objlist, |
1059 | Vector3 pos, List<Vector3> veclist, bool isAttachment) | 1059 | Vector3 pos, List<Vector3> veclist, bool isAttachment) |
1060 | { | 1060 | { |
1061 | UUID fromUserInventoryItemId = UUID.Zero; | 1061 | UUID fromUserInventoryItemId = UUID.Zero; |
@@ -1142,7 +1142,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
1142 | //Need to kill the for sale here | 1142 | //Need to kill the for sale here |
1143 | rootPart.ObjectSaleType = 0; | 1143 | rootPart.ObjectSaleType = 0; |
1144 | rootPart.SalePrice = 10; | 1144 | rootPart.SalePrice = 10; |
1145 | 1145 | ||
1146 | if (m_Scene.Permissions.PropagatePermissions()) | 1146 | if (m_Scene.Permissions.PropagatePermissions()) |
1147 | { | 1147 | { |
1148 | foreach (SceneObjectPart part in so.Parts) | 1148 | foreach (SceneObjectPart part in so.Parts) |
@@ -1154,7 +1154,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
1154 | part.RezzerID = item.Owner; | 1154 | part.RezzerID = item.Owner; |
1155 | part.Inventory.ChangeInventoryOwner(item.Owner); | 1155 | part.Inventory.ChangeInventoryOwner(item.Owner); |
1156 | } | 1156 | } |
1157 | 1157 | ||
1158 | so.ApplyNextOwnerPermissions(); | 1158 | so.ApplyNextOwnerPermissions(); |
1159 | 1159 | ||
1160 | // In case the user has changed flags on a received item | 1160 | // In case the user has changed flags on a received item |
@@ -1312,7 +1312,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
1312 | { | 1312 | { |
1313 | IInventoryService invService = m_Scene.RequestModuleInterface<IInventoryService>(); | 1313 | IInventoryService invService = m_Scene.RequestModuleInterface<IInventoryService>(); |
1314 | InventoryItemBase item = invService.GetItem(agentID, itemID); | 1314 | InventoryItemBase item = invService.GetItem(agentID, itemID); |
1315 | 1315 | ||
1316 | if (item != null && item.CreatorData != null && item.CreatorData != string.Empty) | 1316 | if (item != null && item.CreatorData != null && item.CreatorData != string.Empty) |
1317 | UserManagementModule.AddUser(item.CreatorIdAsUuid, item.CreatorData); | 1317 | UserManagementModule.AddUser(item.CreatorIdAsUuid, item.CreatorData); |
1318 | 1318 | ||
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/HGAssetMapperTests.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/HGAssetMapperTests.cs index 007ff63..8f12331 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/HGAssetMapperTests.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/HGAssetMapperTests.cs | |||
@@ -77,7 +77,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess.Tests | |||
77 | scene.StartScripts(); | 77 | scene.StartScripts(); |
78 | 78 | ||
79 | HGAssetMapper hgam = new HGAssetMapper(scene, homeUrl); | 79 | HGAssetMapper hgam = new HGAssetMapper(scene, homeUrl); |
80 | UserAccount ua | 80 | UserAccount ua |
81 | = UserAccountHelpers.CreateUserWithInventory(scene, userFirstName, userLastName, userId, "password"); | 81 | = UserAccountHelpers.CreateUserWithInventory(scene, userFirstName, userLastName, userId, "password"); |
82 | 82 | ||
83 | SceneObjectGroup so = SceneHelpers.AddSceneObject(scene, soPartsCount, ua.PrincipalID, "part", soIdTail); | 83 | SceneObjectGroup so = SceneHelpers.AddSceneObject(scene, soPartsCount, ua.PrincipalID, "part", soIdTail); |
@@ -116,7 +116,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess.Tests | |||
116 | XmlNode uuidAttribute = savedScriptStateNodes[0].Attributes.GetNamedItem("UUID"); | 116 | XmlNode uuidAttribute = savedScriptStateNodes[0].Attributes.GetNamedItem("UUID"); |
117 | Assert.NotNull(uuidAttribute); | 117 | Assert.NotNull(uuidAttribute); |
118 | // XXX: To check the actual UUID attribute we would have to do some work to retreive the UUID of the task | 118 | // XXX: To check the actual UUID attribute we would have to do some work to retreive the UUID of the task |
119 | // item created earlier. | 119 | // item created earlier. |
120 | } | 120 | } |
121 | 121 | ||
122 | private void RezScript(Scene scene, UUID soId, string script, string itemName, UUID userId) | 122 | private void RezScript(Scene scene, UUID soId, string script, string itemName, UUID userId) |
@@ -131,9 +131,9 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess.Tests | |||
131 | // immediately for tests rather than chunter through it's threaded mechanisms. | 131 | // immediately for tests rather than chunter through it's threaded mechanisms. |
132 | AutoResetEvent chatEvent = new AutoResetEvent(false); | 132 | AutoResetEvent chatEvent = new AutoResetEvent(false); |
133 | 133 | ||
134 | scene.EventManager.OnChatFromWorld += (s, c) => | 134 | scene.EventManager.OnChatFromWorld += (s, c) => |
135 | { | 135 | { |
136 | // Console.WriteLine("Got chat [{0}]", c.Message); | 136 | // Console.WriteLine("Got chat [{0}]", c.Message); |
137 | chatEvent.Set(); | 137 | chatEvent.Set(); |
138 | }; | 138 | }; |
139 | 139 | ||
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs index b31d4df..de29ae9 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs | |||
@@ -48,12 +48,12 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess.Tests | |||
48 | { | 48 | { |
49 | [TestFixture] | 49 | [TestFixture] |
50 | public class InventoryAccessModuleTests : OpenSimTestCase | 50 | public class InventoryAccessModuleTests : OpenSimTestCase |
51 | { | 51 | { |
52 | protected TestScene m_scene; | 52 | protected TestScene m_scene; |
53 | protected BasicInventoryAccessModule m_iam; | 53 | protected BasicInventoryAccessModule m_iam; |
54 | protected UUID m_userId = UUID.Parse("00000000-0000-0000-0000-000000000020"); | 54 | protected UUID m_userId = UUID.Parse("00000000-0000-0000-0000-000000000020"); |
55 | protected TestClient m_tc; | 55 | protected TestClient m_tc; |
56 | 56 | ||
57 | [SetUp] | 57 | [SetUp] |
58 | public override void SetUp() | 58 | public override void SetUp() |
59 | { | 59 | { |
@@ -68,32 +68,32 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess.Tests | |||
68 | SceneHelpers sceneHelpers = new SceneHelpers(); | 68 | SceneHelpers sceneHelpers = new SceneHelpers(); |
69 | m_scene = sceneHelpers.SetupScene(); | 69 | m_scene = sceneHelpers.SetupScene(); |
70 | SceneHelpers.SetupSceneModules(m_scene, config, m_iam); | 70 | SceneHelpers.SetupSceneModules(m_scene, config, m_iam); |
71 | 71 | ||
72 | // Create user | 72 | // Create user |
73 | string userFirstName = "Jock"; | 73 | string userFirstName = "Jock"; |
74 | string userLastName = "Stirrup"; | 74 | string userLastName = "Stirrup"; |
75 | string userPassword = "troll"; | 75 | string userPassword = "troll"; |
76 | UserAccountHelpers.CreateUserWithInventory(m_scene, userFirstName, userLastName, m_userId, userPassword); | 76 | UserAccountHelpers.CreateUserWithInventory(m_scene, userFirstName, userLastName, m_userId, userPassword); |
77 | 77 | ||
78 | AgentCircuitData acd = new AgentCircuitData(); | 78 | AgentCircuitData acd = new AgentCircuitData(); |
79 | acd.AgentID = m_userId; | 79 | acd.AgentID = m_userId; |
80 | m_tc = new TestClient(acd, m_scene); | 80 | m_tc = new TestClient(acd, m_scene); |
81 | } | 81 | } |
82 | 82 | ||
83 | [Test] | 83 | [Test] |
84 | public void TestRezCoalescedObject() | 84 | public void TestRezCoalescedObject() |
85 | { | 85 | { |
86 | /* | 86 | /* |
87 | TestHelpers.InMethod(); | 87 | TestHelpers.InMethod(); |
88 | // log4net.Config.XmlConfigurator.Configure(); | 88 | // log4net.Config.XmlConfigurator.Configure(); |
89 | 89 | ||
90 | // Create asset | 90 | // Create asset |
91 | SceneObjectGroup object1 = SceneHelpers.CreateSceneObject(1, m_userId, "Object1", 0x20); | 91 | SceneObjectGroup object1 = SceneHelpers.CreateSceneObject(1, m_userId, "Object1", 0x20); |
92 | object1.AbsolutePosition = new Vector3(15, 30, 45); | 92 | object1.AbsolutePosition = new Vector3(15, 30, 45); |
93 | 93 | ||
94 | SceneObjectGroup object2 = SceneHelpers.CreateSceneObject(1, m_userId, "Object2", 0x40); | 94 | SceneObjectGroup object2 = SceneHelpers.CreateSceneObject(1, m_userId, "Object2", 0x40); |
95 | object2.AbsolutePosition = new Vector3(25, 50, 75); | 95 | object2.AbsolutePosition = new Vector3(25, 50, 75); |
96 | 96 | ||
97 | CoalescedSceneObjects coa = new CoalescedSceneObjects(m_userId, object1, object2); | 97 | CoalescedSceneObjects coa = new CoalescedSceneObjects(m_userId, object1, object2); |
98 | 98 | ||
99 | UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060"); | 99 | UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060"); |
@@ -107,46 +107,46 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess.Tests | |||
107 | item1.Name = item1Name; | 107 | item1.Name = item1Name; |
108 | item1.AssetID = asset1.FullID; | 108 | item1.AssetID = asset1.FullID; |
109 | item1.ID = item1Id; | 109 | item1.ID = item1Id; |
110 | InventoryFolderBase objsFolder | 110 | InventoryFolderBase objsFolder |
111 | = InventoryArchiveUtils.FindFoldersByPath(m_scene.InventoryService, m_userId, "Objects")[0]; | 111 | = InventoryArchiveUtils.FindFoldersByPath(m_scene.InventoryService, m_userId, "Objects")[0]; |
112 | item1.Folder = objsFolder.ID; | 112 | item1.Folder = objsFolder.ID; |
113 | item1.Flags |= (uint)InventoryItemFlags.ObjectHasMultipleItems; | 113 | item1.Flags |= (uint)InventoryItemFlags.ObjectHasMultipleItems; |
114 | m_scene.AddInventoryItem(item1); | 114 | m_scene.AddInventoryItem(item1); |
115 | 115 | ||
116 | SceneObjectGroup so | 116 | SceneObjectGroup so |
117 | = m_iam.RezObject( | 117 | = m_iam.RezObject( |
118 | m_tc, item1Id, new Vector3(100, 100, 100), Vector3.Zero, UUID.Zero, 1, false, false, false, UUID.Zero, false); | 118 | m_tc, item1Id, new Vector3(100, 100, 100), Vector3.Zero, UUID.Zero, 1, false, false, false, UUID.Zero, false); |
119 | 119 | ||
120 | Assert.That(so, Is.Not.Null); | 120 | Assert.That(so, Is.Not.Null); |
121 | 121 | ||
122 | Assert.That(m_scene.SceneGraph.GetTotalObjectsCount(), Is.EqualTo(2)); | 122 | Assert.That(m_scene.SceneGraph.GetTotalObjectsCount(), Is.EqualTo(2)); |
123 | 123 | ||
124 | SceneObjectPart retrievedObj1Part = m_scene.GetSceneObjectPart(object1.Name); | 124 | SceneObjectPart retrievedObj1Part = m_scene.GetSceneObjectPart(object1.Name); |
125 | Assert.That(retrievedObj1Part, Is.Null); | 125 | Assert.That(retrievedObj1Part, Is.Null); |
126 | 126 | ||
127 | retrievedObj1Part = m_scene.GetSceneObjectPart(item1.Name); | 127 | retrievedObj1Part = m_scene.GetSceneObjectPart(item1.Name); |
128 | Assert.That(retrievedObj1Part, Is.Not.Null); | 128 | Assert.That(retrievedObj1Part, Is.Not.Null); |
129 | Assert.That(retrievedObj1Part.Name, Is.EqualTo(item1.Name)); | 129 | Assert.That(retrievedObj1Part.Name, Is.EqualTo(item1.Name)); |
130 | 130 | ||
131 | // Bottom of coalescence is placed on ground, hence we end up with 100.5 rather than 85 since the bottom | 131 | // Bottom of coalescence is placed on ground, hence we end up with 100.5 rather than 85 since the bottom |
132 | // object is unit square. | 132 | // object is unit square. |
133 | Assert.That(retrievedObj1Part.AbsolutePosition, Is.EqualTo(new Vector3(95, 90, 100.5f))); | 133 | Assert.That(retrievedObj1Part.AbsolutePosition, Is.EqualTo(new Vector3(95, 90, 100.5f))); |
134 | 134 | ||
135 | SceneObjectPart retrievedObj2Part = m_scene.GetSceneObjectPart(object2.Name); | 135 | SceneObjectPart retrievedObj2Part = m_scene.GetSceneObjectPart(object2.Name); |
136 | Assert.That(retrievedObj2Part, Is.Not.Null); | 136 | Assert.That(retrievedObj2Part, Is.Not.Null); |
137 | Assert.That(retrievedObj2Part.Name, Is.EqualTo(object2.Name)); | 137 | Assert.That(retrievedObj2Part.Name, Is.EqualTo(object2.Name)); |
138 | Assert.That(retrievedObj2Part.AbsolutePosition, Is.EqualTo(new Vector3(105, 110, 130.5f))); | 138 | Assert.That(retrievedObj2Part.AbsolutePosition, Is.EqualTo(new Vector3(105, 110, 130.5f))); |
139 | */ | 139 | */ |
140 | } | 140 | } |
141 | 141 | ||
142 | [Test] | 142 | [Test] |
143 | public void TestRezObject() | 143 | public void TestRezObject() |
144 | { | 144 | { |
145 | TestHelpers.InMethod(); | 145 | TestHelpers.InMethod(); |
146 | // log4net.Config.XmlConfigurator.Configure(); | 146 | // log4net.Config.XmlConfigurator.Configure(); |
147 | 147 | ||
148 | // Create asset | 148 | // Create asset |
149 | SceneObjectGroup object1 = SceneHelpers.CreateSceneObject(1, m_userId, "My Little Dog Object", 0x40); | 149 | SceneObjectGroup object1 = SceneHelpers.CreateSceneObject(1, m_userId, "My Little Dog Object", 0x40); |
150 | 150 | ||
151 | UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060"); | 151 | UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060"); |
152 | AssetBase asset1 = AssetHelpers.CreateAsset(asset1Id, object1); | 152 | AssetBase asset1 = AssetHelpers.CreateAsset(asset1Id, object1); |
@@ -159,17 +159,17 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess.Tests | |||
159 | item1.Name = item1Name; | 159 | item1.Name = item1Name; |
160 | item1.AssetID = asset1.FullID; | 160 | item1.AssetID = asset1.FullID; |
161 | item1.ID = item1Id; | 161 | item1.ID = item1Id; |
162 | InventoryFolderBase objsFolder | 162 | InventoryFolderBase objsFolder |
163 | = InventoryArchiveUtils.FindFoldersByPath(m_scene.InventoryService, m_userId, "Objects")[0]; | 163 | = InventoryArchiveUtils.FindFoldersByPath(m_scene.InventoryService, m_userId, "Objects")[0]; |
164 | item1.Folder = objsFolder.ID; | 164 | item1.Folder = objsFolder.ID; |
165 | m_scene.AddInventoryItem(item1); | 165 | m_scene.AddInventoryItem(item1); |
166 | 166 | ||
167 | SceneObjectGroup so | 167 | SceneObjectGroup so |
168 | = m_iam.RezObject( | 168 | = m_iam.RezObject( |
169 | m_tc, item1Id, UUID.Zero, Vector3.Zero, Vector3.Zero, UUID.Zero, 1, false, false, false, UUID.Zero, false); | 169 | m_tc, item1Id, UUID.Zero, Vector3.Zero, Vector3.Zero, UUID.Zero, 1, false, false, false, UUID.Zero, false); |
170 | 170 | ||
171 | Assert.That(so, Is.Not.Null); | 171 | Assert.That(so, Is.Not.Null); |
172 | 172 | ||
173 | SceneObjectPart retrievedPart = m_scene.GetSceneObjectPart(so.UUID); | 173 | SceneObjectPart retrievedPart = m_scene.GetSceneObjectPart(so.UUID); |
174 | Assert.That(retrievedPart, Is.Not.Null); | 174 | Assert.That(retrievedPart, Is.Not.Null); |
175 | } | 175 | } |