From 0325e6ee6af55b5e52185e4ad5249067ec1bbab7 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Wed, 23 Jan 2008 17:52:13 +0000 Subject: [PATCH] * Library scripts can now be dragged into prims * Unfortunately, they show us as non modify, though they will run * We're probably hitting unimplement permissions stuff --- .../Environment/Scenes/Scene.Inventory.cs | 37 ++++++++++++++----- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs index 58a6a4c4e5..81783f8489 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 //group.AddInventoryItem(remoteClient, primLocalID, null); MainLog.Instance.Verbose( "PRIMINVENTORY", - "UpdateTaskInventory called with item {0}, folder {1}, primLocalID {2}, user {3}", + "Non script prim inventory not yet implemented!" + + "\nUpdateTaskInventory called with item {0}, folder {1}, primLocalID {2}, user {3}", itemID, folderID, primLocalID, remoteClient.Name); } else @@ -569,13 +570,23 @@ namespace OpenSim.Region.Environment.Scenes /// public void RezScript(IClientAPI remoteClient, LLUUID itemID, uint localID) { - CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); LLUUID copyID = LLUUID.Random(); - if (userInfo != null) + + if (itemID != LLUUID.Zero) { - if (userInfo.RootFolder != null) + CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); + + if (userInfo != null && userInfo.RootFolder != null) { InventoryItemBase item = userInfo.RootFolder.HasItem(itemID); + + // Try library + // XXX clumsy, possibly should be one call + if (null == item) + { + item = CommsManager.UserProfileCacheService.libraryRoot.HasItem(itemID); + } + if (item != null) { SceneObjectGroup group = GetGroupByPrim(localID); @@ -584,11 +595,11 @@ namespace OpenSim.Region.Environment.Scenes group.AddInventoryItem(remoteClient, localID, item, copyID); group.StartScript(localID, copyID); group.GetProperites(remoteClient); - - MainLog.Instance.Verbose( - "PRIMINVENTORY", - "Rezzed script {0} into prim local ID {1} for user {2}", - item.inventoryName, localID, remoteClient.Name); + + // MainLog.Instance.Verbose( + // "PRIMINVENTORY", + // "Rezzed script {0} into prim local ID {1} for user {2}", + // item.inventoryName, localID, remoteClient.Name); } else { @@ -607,6 +618,14 @@ namespace OpenSim.Region.Environment.Scenes } } } + else // If the itemID is zero then the script has been rezzed directly in an object's inventory + { + // not yet implemented + // TODO Need to get more details from original RezScript packet + // XXX jc tmp +// AssetBase asset = CreateAsset("chimney sweep", "sailor.lsl", 10, 10, null); +// AssetCache.AddAsset(asset); + } } ///