diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.Inventory.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index d2e41f8..4337b5a 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -139,7 +139,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
139 | { | 139 | { |
140 | userlevel = 1; | 140 | userlevel = 1; |
141 | } | 141 | } |
142 | EventManager.TriggerOnNewInventoryItemUploadComplete(item.Owner, item.AssetID, item.Name, userlevel); | 142 | EventManager.TriggerOnNewInventoryItemUploadComplete(item.Owner, (AssetType)item.AssetType, item.AssetID, item.Name, userlevel); |
143 | 143 | ||
144 | return true; | 144 | return true; |
145 | } | 145 | } |
@@ -178,7 +178,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
178 | { | 178 | { |
179 | userlevel = 1; | 179 | userlevel = 1; |
180 | } | 180 | } |
181 | EventManager.TriggerOnNewInventoryItemUploadComplete(item.Owner, item.AssetID, item.Name, userlevel); | 181 | EventManager.TriggerOnNewInventoryItemUploadComplete(item.Owner, (AssetType)item.AssetType, item.AssetID, item.Name, userlevel); |
182 | 182 | ||
183 | if (originalFolder != UUID.Zero) | 183 | if (originalFolder != UUID.Zero) |
184 | { | 184 | { |
@@ -411,19 +411,21 @@ namespace OpenSim.Region.Framework.Scenes | |||
411 | // itemUpd.NextPermissions, itemUpd.GroupPermissions, itemUpd.EveryOnePermissions, item.Flags, | 411 | // itemUpd.NextPermissions, itemUpd.GroupPermissions, itemUpd.EveryOnePermissions, item.Flags, |
412 | // item.NextPermissions, item.GroupPermissions, item.EveryOnePermissions, item.CurrentPermissions); | 412 | // item.NextPermissions, item.GroupPermissions, item.EveryOnePermissions, item.CurrentPermissions); |
413 | 413 | ||
414 | bool sendUpdate = false; | ||
415 | |||
414 | if (itemUpd.NextPermissions != 0) // Use this to determine validity. Can never be 0 if valid | 416 | if (itemUpd.NextPermissions != 0) // Use this to determine validity. Can never be 0 if valid |
415 | { | 417 | { |
416 | // Create a set of base permissions that will not include export if the user | 418 | // Create a set of base permissions that will not include export if the user |
417 | // is not allowed to change the export flag. | 419 | // is not allowed to change the export flag. |
418 | bool denyExportChange = false; | 420 | bool denyExportChange = false; |
419 | 421 | ||
420 | m_log.InfoFormat("[XXX]: B: {0} O: {1} E: {2}", itemUpd.BasePermissions, itemUpd.CurrentPermissions, itemUpd.EveryOnePermissions); | 422 | // m_log.DebugFormat("[XXX]: B: {0} O: {1} E: {2}", itemUpd.BasePermissions, itemUpd.CurrentPermissions, itemUpd.EveryOnePermissions); |
421 | 423 | ||
422 | // If the user is not the creator or doesn't have "E" in both "B" and "O", deny setting export | 424 | // If the user is not the creator or doesn't have "E" in both "B" and "O", deny setting export |
423 | if ((item.BasePermissions & (uint)(PermissionMask.All | PermissionMask.Export)) != (uint)(PermissionMask.All | PermissionMask.Export) || (item.CurrentPermissions & (uint)PermissionMask.Export) == 0 || item.CreatorIdAsUuid != item.Owner) | 425 | if ((item.BasePermissions & (uint)(PermissionMask.All | PermissionMask.Export)) != (uint)(PermissionMask.All | PermissionMask.Export) || (item.CurrentPermissions & (uint)PermissionMask.Export) == 0 || item.CreatorIdAsUuid != item.Owner) |
424 | denyExportChange = true; | 426 | denyExportChange = true; |
425 | 427 | ||
426 | m_log.InfoFormat("[XXX]: Deny Export Update {0}", denyExportChange); | 428 | // m_log.DebugFormat("[XXX]: Deny Export Update {0}", denyExportChange); |
427 | 429 | ||
428 | // If it is already set, force it set and also force full perm | 430 | // If it is already set, force it set and also force full perm |
429 | // else prevent setting it. It can and should never be set unless | 431 | // else prevent setting it. It can and should never be set unless |
@@ -447,7 +449,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
447 | // If the new state is exportable, force full perm | 449 | // If the new state is exportable, force full perm |
448 | if ((itemUpd.EveryOnePermissions & (uint)PermissionMask.Export) != 0) | 450 | if ((itemUpd.EveryOnePermissions & (uint)PermissionMask.Export) != 0) |
449 | { | 451 | { |
450 | m_log.InfoFormat("[XXX]: Force full perm"); | 452 | // m_log.DebugFormat("[XXX]: Force full perm"); |
451 | itemUpd.NextPermissions = (uint)(PermissionMask.All); | 453 | itemUpd.NextPermissions = (uint)(PermissionMask.All); |
452 | } | 454 | } |
453 | } | 455 | } |
@@ -484,8 +486,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
484 | item.SalePrice = itemUpd.SalePrice; | 486 | item.SalePrice = itemUpd.SalePrice; |
485 | item.SaleType = itemUpd.SaleType; | 487 | item.SaleType = itemUpd.SaleType; |
486 | 488 | ||
489 | if (item.InvType == (int)InventoryType.Wearable && (item.Flags & 0xf) == 0 && (itemUpd.Flags & 0xf) != 0) | ||
490 | { | ||
491 | item.Flags = (uint)(item.Flags & 0xfffffff0) | (itemUpd.Flags & 0xf); | ||
492 | sendUpdate = true; | ||
493 | } | ||
494 | |||
487 | InventoryService.UpdateItem(item); | 495 | InventoryService.UpdateItem(item); |
488 | remoteClient.SendBulkUpdateInventory(item); | ||
489 | } | 496 | } |
490 | 497 | ||
491 | if (UUID.Zero != transactionID) | 498 | if (UUID.Zero != transactionID) |
@@ -495,6 +502,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
495 | AgentTransactionsModule.HandleItemUpdateFromTransaction(remoteClient, transactionID, item); | 502 | AgentTransactionsModule.HandleItemUpdateFromTransaction(remoteClient, transactionID, item); |
496 | } | 503 | } |
497 | } | 504 | } |
505 | else | ||
506 | { | ||
507 | // This MAY be problematic, if it is, another solution | ||
508 | // needs to be found. If inventory item flags are updated | ||
509 | // the viewer's notion of the item needs to be refreshed. | ||
510 | if (sendUpdate) | ||
511 | remoteClient.SendBulkUpdateInventory(item); | ||
512 | } | ||
498 | } | 513 | } |
499 | else | 514 | else |
500 | { | 515 | { |
@@ -548,6 +563,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
548 | { | 563 | { |
549 | //Console.WriteLine("Scene.Inventory.cs: GiveInventoryItem"); | 564 | //Console.WriteLine("Scene.Inventory.cs: GiveInventoryItem"); |
550 | 565 | ||
566 | if (!Permissions.CanTransferUserInventory(itemId, senderId, recipient)) | ||
567 | return null; | ||
568 | |||
551 | InventoryItemBase item = new InventoryItemBase(itemId, senderId); | 569 | InventoryItemBase item = new InventoryItemBase(itemId, senderId); |
552 | item = InventoryService.GetItem(item); | 570 | item = InventoryService.GetItem(item); |
553 | 571 | ||
@@ -2124,7 +2142,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
2124 | { | 2142 | { |
2125 | // If we don't have permission, stop right here | 2143 | // If we don't have permission, stop right here |
2126 | if (!permissionToTakeCopy) | 2144 | if (!permissionToTakeCopy) |
2145 | { | ||
2146 | remoteClient.SendAlertMessage("You don't have permission to take the object"); | ||
2127 | return; | 2147 | return; |
2148 | } | ||
2128 | 2149 | ||
2129 | permissionToTake = true; | 2150 | permissionToTake = true; |
2130 | // Don't delete | 2151 | // Don't delete |