aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Scene.Inventory.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.Inventory.cs37
1 files changed, 28 insertions, 9 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
index 58a6a4c..81783f8 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
@@ -549,7 +549,8 @@ namespace OpenSim.Region.Environment.Scenes
549 //group.AddInventoryItem(remoteClient, primLocalID, null); 549 //group.AddInventoryItem(remoteClient, primLocalID, null);
550 MainLog.Instance.Verbose( 550 MainLog.Instance.Verbose(
551 "PRIMINVENTORY", 551 "PRIMINVENTORY",
552 "UpdateTaskInventory called with item {0}, folder {1}, primLocalID {2}, user {3}", 552 "Non script prim inventory not yet implemented!"
553 + "\nUpdateTaskInventory called with item {0}, folder {1}, primLocalID {2}, user {3}",
553 itemID, folderID, primLocalID, remoteClient.Name); 554 itemID, folderID, primLocalID, remoteClient.Name);
554 } 555 }
555 else 556 else
@@ -569,13 +570,23 @@ namespace OpenSim.Region.Environment.Scenes
569 /// <param name="localID"></param> 570 /// <param name="localID"></param>
570 public void RezScript(IClientAPI remoteClient, LLUUID itemID, uint localID) 571 public void RezScript(IClientAPI remoteClient, LLUUID itemID, uint localID)
571 { 572 {
572 CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
573 LLUUID copyID = LLUUID.Random(); 573 LLUUID copyID = LLUUID.Random();
574 if (userInfo != null) 574
575 if (itemID != LLUUID.Zero)
575 { 576 {
576 if (userInfo.RootFolder != null) 577 CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
578
579 if (userInfo != null && userInfo.RootFolder != null)
577 { 580 {
578 InventoryItemBase item = userInfo.RootFolder.HasItem(itemID); 581 InventoryItemBase item = userInfo.RootFolder.HasItem(itemID);
582
583 // Try library
584 // XXX clumsy, possibly should be one call
585 if (null == item)
586 {
587 item = CommsManager.UserProfileCacheService.libraryRoot.HasItem(itemID);
588 }
589
579 if (item != null) 590 if (item != null)
580 { 591 {
581 SceneObjectGroup group = GetGroupByPrim(localID); 592 SceneObjectGroup group = GetGroupByPrim(localID);
@@ -584,11 +595,11 @@ namespace OpenSim.Region.Environment.Scenes
584 group.AddInventoryItem(remoteClient, localID, item, copyID); 595 group.AddInventoryItem(remoteClient, localID, item, copyID);
585 group.StartScript(localID, copyID); 596 group.StartScript(localID, copyID);
586 group.GetProperites(remoteClient); 597 group.GetProperites(remoteClient);
587 598
588 MainLog.Instance.Verbose( 599 // MainLog.Instance.Verbose(
589 "PRIMINVENTORY", 600 // "PRIMINVENTORY",
590 "Rezzed script {0} into prim local ID {1} for user {2}", 601 // "Rezzed script {0} into prim local ID {1} for user {2}",
591 item.inventoryName, localID, remoteClient.Name); 602 // item.inventoryName, localID, remoteClient.Name);
592 } 603 }
593 else 604 else
594 { 605 {
@@ -607,6 +618,14 @@ namespace OpenSim.Region.Environment.Scenes
607 } 618 }
608 } 619 }
609 } 620 }
621 else // If the itemID is zero then the script has been rezzed directly in an object's inventory
622 {
623 // not yet implemented
624 // TODO Need to get more details from original RezScript packet
625 // XXX jc tmp
626// AssetBase asset = CreateAsset("chimney sweep", "sailor.lsl", 10, 10, null);
627// AssetCache.AddAsset(asset);
628 }
610 } 629 }
611 630
612 /// <summary> 631 /// <summary>