aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs
diff options
context:
space:
mode:
authorTeravus Ovares2008-09-06 07:52:41 +0000
committerTeravus Ovares2008-09-06 07:52:41 +0000
commit7d89e122930be39e84a6d174548fa2d12ac0484a (patch)
treee5aa5752f988a9aba2a969f49e5e208985eda80c /OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs
parent* minor: speculatively try a change to bamboo.build to see if this generates ... (diff)
downloadopensim-SC-7d89e122930be39e84a6d174548fa2d12ac0484a.zip
opensim-SC-7d89e122930be39e84a6d174548fa2d12ac0484a.tar.gz
opensim-SC-7d89e122930be39e84a6d174548fa2d12ac0484a.tar.bz2
opensim-SC-7d89e122930be39e84a6d174548fa2d12ac0484a.tar.xz
* This is the fabled LibOMV update with all of the libOMV types from JHurliman
* This is a HUGE OMG update and will definitely have unknown side effects.. so this is really only for the strong hearted at this point. Regular people should let the dust settle. * This has been tested to work with most basic functions. However.. make sure you back up 'everything' before using this. It's that big! * Essentially we're back at square 1 in the testing phase.. so lets identify things that broke.
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs48
1 files changed, 24 insertions, 24 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs
index 3bfe7e9..2beb9bb 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs
@@ -28,7 +28,7 @@
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Reflection; 30using System.Reflection;
31using libsecondlife; 31using OpenMetaverse;
32using log4net; 32using log4net;
33using OpenSim.Framework; 33using OpenSim.Framework;
34using OpenSim.Framework.Communications.Cache; 34using OpenSim.Framework.Communications.Cache;
@@ -69,7 +69,7 @@ namespace OpenSim.Region.Environment.Scenes
69 } 69 }
70 70
71 /// <summary> 71 /// <summary>
72 /// Reset LLUUIDs for all the items in the prim's inventory. This involves either generating 72 /// Reset UUIDs for all the items in the prim's inventory. This involves either generating
73 /// new ones or setting existing UUIDs to the correct parent UUIDs. 73 /// new ones or setting existing UUIDs to the correct parent UUIDs.
74 /// 74 ///
75 /// If this method is called and there are inventory items, then we regard the inventory as having changed. 75 /// If this method is called and there are inventory items, then we regard the inventory as having changed.
@@ -99,7 +99,7 @@ namespace OpenSim.Region.Environment.Scenes
99 /// Change every item in this prim's inventory to a new owner. 99 /// Change every item in this prim's inventory to a new owner.
100 /// </summary> 100 /// </summary>
101 /// <param name="ownerId"></param> 101 /// <param name="ownerId"></param>
102 public void ChangeInventoryOwner(LLUUID ownerId) 102 public void ChangeInventoryOwner(UUID ownerId)
103 { 103 {
104 lock (TaskInventory) 104 lock (TaskInventory)
105 { 105 {
@@ -172,13 +172,13 @@ namespace OpenSim.Region.Environment.Scenes
172 if (!m_parentGroup.Scene.ExternalChecks.ExternalChecksCanRunScript(item.ItemID, UUID, item.OwnerID)) 172 if (!m_parentGroup.Scene.ExternalChecks.ExternalChecksCanRunScript(item.ItemID, UUID, item.OwnerID))
173 return; 173 return;
174 174
175 AddFlag(LLObject.ObjectFlags.Scripted); 175 AddFlag(PrimFlags.Scripted);
176 176
177 if (!m_parentGroup.Scene.RegionInfo.RegionSettings.DisableScripts) 177 if (!m_parentGroup.Scene.RegionInfo.RegionSettings.DisableScripts)
178 { 178 {
179 AssetCache cache = m_parentGroup.Scene.AssetCache; 179 AssetCache cache = m_parentGroup.Scene.AssetCache;
180 180
181 cache.GetAsset(item.AssetID, delegate(LLUUID assetID, AssetBase asset) 181 cache.GetAsset(item.AssetID, delegate(UUID assetID, AssetBase asset)
182 { 182 {
183 if (null == asset) 183 if (null == asset)
184 { 184 {
@@ -190,8 +190,8 @@ namespace OpenSim.Region.Environment.Scenes
190 else 190 else
191 { 191 {
192 m_taskInventory[item.ItemID].PermsMask = 0; 192 m_taskInventory[item.ItemID].PermsMask = 0;
193 m_taskInventory[item.ItemID].PermsGranter = LLUUID.Zero; 193 m_taskInventory[item.ItemID].PermsGranter = UUID.Zero;
194 string script = Helpers.FieldToUTF8String(asset.Data); 194 string script = Utils.BytesToString(asset.Data);
195 m_parentGroup.Scene.EventManager.TriggerRezScript(LocalId, item.ItemID, script, 195 m_parentGroup.Scene.EventManager.TriggerRezScript(LocalId, item.ItemID, script,
196 startParam, postOnRez); 196 startParam, postOnRez);
197 m_parentGroup.AddActiveScriptCount(1); 197 m_parentGroup.AddActiveScriptCount(1);
@@ -205,9 +205,9 @@ namespace OpenSim.Region.Environment.Scenes
205 /// Start a script which is in this prim's inventory. 205 /// Start a script which is in this prim's inventory.
206 /// </summary> 206 /// </summary>
207 /// <param name="itemId"> 207 /// <param name="itemId">
208 /// A <see cref="LLUUID"/> 208 /// A <see cref="UUID"/>
209 /// </param> 209 /// </param>
210 public void CreateScriptInstance(LLUUID itemId, int startParam, bool postOnRez) 210 public void CreateScriptInstance(UUID itemId, int startParam, bool postOnRez)
211 { 211 {
212 lock (m_taskInventory) 212 lock (m_taskInventory)
213 { 213 {
@@ -229,7 +229,7 @@ namespace OpenSim.Region.Environment.Scenes
229 /// Stop a script which is in this prim's inventory. 229 /// Stop a script which is in this prim's inventory.
230 /// </summary> 230 /// </summary>
231 /// <param name="itemId"></param> 231 /// <param name="itemId"></param>
232 public void RemoveScriptInstance(LLUUID itemId) 232 public void RemoveScriptInstance(UUID itemId)
233 { 233 {
234 if (m_taskInventory.ContainsKey(itemId)) 234 if (m_taskInventory.ContainsKey(itemId))
235 { 235 {
@@ -370,7 +370,7 @@ namespace OpenSim.Region.Environment.Scenes
370 /// </summary> 370 /// </summary>
371 /// <param name="itemID"></param> 371 /// <param name="itemID"></param>
372 /// <returns>null if the item does not exist</returns> 372 /// <returns>null if the item does not exist</returns>
373 public TaskInventoryItem GetInventoryItem(LLUUID itemId) 373 public TaskInventoryItem GetInventoryItem(UUID itemId)
374 { 374 {
375 TaskInventoryItem item; 375 TaskInventoryItem item;
376 m_taskInventory.TryGetValue(itemId, out item); 376 m_taskInventory.TryGetValue(itemId, out item);
@@ -426,7 +426,7 @@ namespace OpenSim.Region.Environment.Scenes
426 /// <param name="itemID"></param> 426 /// <param name="itemID"></param>
427 /// <returns>Numeric asset type of the item removed. Returns -1 if the item did not exist 427 /// <returns>Numeric asset type of the item removed. Returns -1 if the item did not exist
428 /// in this prim's inventory.</returns> 428 /// in this prim's inventory.</returns>
429 public int RemoveInventoryItem(LLUUID itemID) 429 public int RemoveInventoryItem(UUID itemID)
430 { 430 {
431 lock (m_taskInventory) 431 lock (m_taskInventory)
432 { 432 {
@@ -455,7 +455,7 @@ namespace OpenSim.Region.Environment.Scenes
455 455
456 if (scriptcount <= 0) 456 if (scriptcount <= 0)
457 { 457 {
458 RemFlag(LLObject.ObjectFlags.Scripted); 458 RemFlag(PrimFlags.Scripted);
459 } 459 }
460 460
461 ScheduleFullUpdate(); 461 ScheduleFullUpdate();
@@ -477,10 +477,10 @@ namespace OpenSim.Region.Environment.Scenes
477 public string GetInventoryFileName() 477 public string GetInventoryFileName()
478 { 478 {
479 if (m_inventoryFileName == String.Empty) 479 if (m_inventoryFileName == String.Empty)
480 m_inventoryFileName = "inventory_" + LLUUID.Random().ToString() + ".tmp"; 480 m_inventoryFileName = "inventory_" + UUID.Random().ToString() + ".tmp";
481 if (m_inventoryFileNameSerial < m_inventorySerial) 481 if (m_inventoryFileNameSerial < m_inventorySerial)
482 { 482 {
483 m_inventoryFileName = "inventory_" + LLUUID.Random().ToString() + ".tmp"; 483 m_inventoryFileName = "inventory_" + UUID.Random().ToString() + ".tmp";
484 } 484 }
485 return m_inventoryFileName; 485 return m_inventoryFileName;
486 } 486 }
@@ -499,7 +499,7 @@ namespace OpenSim.Region.Environment.Scenes
499 if (m_inventorySerial > 0) 499 if (m_inventorySerial > 0)
500 { 500 {
501 client.SendTaskInventory(m_uuid, (short)m_inventorySerial, 501 client.SendTaskInventory(m_uuid, (short)m_inventorySerial,
502 Helpers.StringToField(GetInventoryFileName())); 502 Utils.StringToBytes(GetInventoryFileName()));
503 return true; 503 return true;
504 } 504 }
505 else 505 else
@@ -520,13 +520,13 @@ namespace OpenSim.Region.Environment.Scenes
520 // Confusingly, the folder item has to be the object id, while the 'parent id' has to be zero. This matches 520 // Confusingly, the folder item has to be the object id, while the 'parent id' has to be zero. This matches
521 // what appears to happen in the Second Life protocol. If this isn't the case. then various functionality 521 // what appears to happen in the Second Life protocol. If this isn't the case. then various functionality
522 // isn't available (such as drag from prim inventory to agent inventory) 522 // isn't available (such as drag from prim inventory to agent inventory)
523 InventoryStringBuilder invString = new InventoryStringBuilder(UUID, LLUUID.Zero); 523 InventoryStringBuilder invString = new InventoryStringBuilder(UUID, UUID.Zero);
524 524
525 lock (m_taskInventory) 525 lock (m_taskInventory)
526 { 526 {
527 foreach (TaskInventoryItem item in m_taskInventory.Values) 527 foreach (TaskInventoryItem item in m_taskInventory.Values)
528 { 528 {
529 LLUUID ownerID = item.OwnerID; 529 UUID ownerID = item.OwnerID;
530 uint everyoneMask = 0; 530 uint everyoneMask = 0;
531 uint baseMask = item.BasePermissions; 531 uint baseMask = item.BasePermissions;
532 uint ownerMask = item.CurrentPermissions; 532 uint ownerMask = item.CurrentPermissions;
@@ -587,10 +587,10 @@ namespace OpenSim.Region.Environment.Scenes
587 } 587 }
588 } 588 }
589 589
590 fileData = Helpers.StringToField(invString.BuildString); 590 fileData = Utils.StringToBytes(invString.BuildString);
591 591
592 //Console.WriteLine(Helpers.FieldToUTF8String(fileData)); 592 //Console.WriteLine(Utils.BytesToString(fileData));
593 //m_log.Debug("[PRIM INVENTORY]: RequestInventoryFile fileData: " + Helpers.FieldToUTF8String(fileData)); 593 //m_log.Debug("[PRIM INVENTORY]: RequestInventoryFile fileData: " + Utils.BytesToString(fileData));
594 594
595 if (fileData.Length > 2) 595 if (fileData.Length > 2)
596 { 596 {
@@ -619,7 +619,7 @@ namespace OpenSim.Region.Environment.Scenes
619 { 619 {
620 public string BuildString = String.Empty; 620 public string BuildString = String.Empty;
621 621
622 public InventoryStringBuilder(LLUUID folderID, LLUUID parentID) 622 public InventoryStringBuilder(UUID folderID, UUID parentID)
623 { 623 {
624 BuildString += "\tinv_object\t0\n\t{\n"; 624 BuildString += "\tinv_object\t0\n\t{\n";
625 AddNameValueLine("obj_id", folderID.ToString()); 625 AddNameValueLine("obj_id", folderID.ToString());
@@ -746,9 +746,9 @@ namespace OpenSim.Region.Environment.Scenes
746 return false; 746 return false;
747 } 747 }
748 748
749 public List<LLUUID> GetInventoryList() 749 public List<UUID> GetInventoryList()
750 { 750 {
751 List<LLUUID> ret = new List<LLUUID>(); 751 List<UUID> ret = new List<UUID>();
752 752
753 foreach (TaskInventoryItem item in m_taskInventory.Values) 753 foreach (TaskInventoryItem item in m_taskInventory.Values)
754 ret.Add(item.ItemID); 754 ret.Add(item.ItemID);