aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.Inventory.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs146
1 files changed, 34 insertions, 112 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index e289666..edb881f 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -881,14 +881,22 @@ namespace OpenSim.Region.Framework.Scenes
881 return; 881 return;
882 } 882 }
883 883
884<<<<<<< HEAD
885 if (newName == String.Empty) 884 if (newName == String.Empty)
886 newName = item.Name; 885 newName = item.Name;
887=======
888 if (newName == null) newName = item.Name;
889 886
890 AssetBase asset = AssetService.Get(item.AssetID.ToString()); 887 AssetBase asset = AssetService.Get(item.AssetID.ToString());
891>>>>>>> avn/ubitvar 888
889 if (asset != null)
890 {
891 if (newName != String.Empty)
892 {
893 asset.Name = newName;
894 }
895 else
896 {
897 newName = item.Name;
898 }
899
892 900
893 if (remoteClient.AgentId == oldAgentID 901 if (remoteClient.AgentId == oldAgentID
894 || (LibraryService != null 902 || (LibraryService != null
@@ -916,6 +924,13 @@ namespace OpenSim.Region.Framework.Scenes
916 } 924 }
917 } 925 }
918 } 926 }
927 else
928 {
929 m_log.ErrorFormat(
930 "[AGENT INVENTORY]: Could not copy item {0} since asset {1} could not be found",
931 item.Name, item.AssetID);
932 }
933 }
919 934
920 /// <summary> 935 /// <summary>
921 /// Create a new asset data structure. 936 /// Create a new asset data structure.
@@ -982,31 +997,12 @@ namespace OpenSim.Region.Framework.Scenes
982 public void CreateNewInventoryItem( 997 public void CreateNewInventoryItem(
983 IClientAPI remoteClient, string creatorID, string creatorData, UUID folderID, 998 IClientAPI remoteClient, string creatorID, string creatorData, UUID folderID,
984 string name, string description, uint flags, uint callbackID, 999 string name, string description, uint flags, uint callbackID,
985<<<<<<< HEAD
986 UUID assetID, sbyte assetType, sbyte invType, uint nextOwnerMask, int creationDate) 1000 UUID assetID, sbyte assetType, sbyte invType, uint nextOwnerMask, int creationDate)
987 { 1001 {
988 CreateNewInventoryItem( 1002 CreateNewInventoryItem(
989 remoteClient, creatorID, creatorData, folderID, name, description, flags, callbackID, assetID, assetType, invType, 1003 remoteClient, creatorID, creatorData, folderID, name, description, flags, callbackID, assetID, assetType, invType,
990 (uint)PermissionMask.All | (uint)PermissionMask.Export, (uint)PermissionMask.All | (uint)PermissionMask.Export, 0, nextOwnerMask, 0, 1004 (uint)PermissionMask.All | (uint)PermissionMask.Export, (uint)PermissionMask.All | (uint)PermissionMask.Export, 0, nextOwnerMask, 0,
991 creationDate, true); 1005 creationDate, true);
992=======
993 AssetBase asset, sbyte invType, uint nextOwnerMask, int creationDate, UUID transationID)
994 {
995 CreateNewInventoryItem(
996 remoteClient, creatorID, creatorData, folderID, name, description, flags, callbackID, asset, invType,
997 (uint)PermissionMask.All | (uint)PermissionMask.Export, (uint)PermissionMask.All | (uint)PermissionMask.Export, 0, nextOwnerMask, 0, creationDate, transationID);
998 }
999
1000
1001 private void CreateNewInventoryItem(
1002 IClientAPI remoteClient, string creatorID, string creatorData, UUID folderID,
1003 string name, string description, uint flags, uint callbackID, AssetBase asset, sbyte invType,
1004 uint baseMask, uint currentMask, uint everyoneMask, uint nextOwnerMask, uint groupMask, int creationDate)
1005 {
1006 CreateNewInventoryItem(remoteClient, creatorID, creatorData, folderID,
1007 name, description, flags, callbackID, asset, invType,
1008 baseMask, currentMask, everyoneMask, nextOwnerMask, groupMask, creationDate, UUID.Zero);
1009>>>>>>> avn/ubitvar
1010 } 1006 }
1011 1007
1012 /// <summary> 1008 /// <summary>
@@ -1030,14 +1026,9 @@ namespace OpenSim.Region.Framework.Scenes
1030 /// <param name="creationDate">Unix timestamp at which this item was created.</param> 1026 /// <param name="creationDate">Unix timestamp at which this item was created.</param>
1031 private void CreateNewInventoryItem( 1027 private void CreateNewInventoryItem(
1032 IClientAPI remoteClient, string creatorID, string creatorData, UUID folderID, 1028 IClientAPI remoteClient, string creatorID, string creatorData, UUID folderID,
1033<<<<<<< HEAD
1034 string name, string description, uint flags, uint callbackID, UUID assetID, sbyte assetType, sbyte invType, 1029 string name, string description, uint flags, uint callbackID, UUID assetID, sbyte assetType, sbyte invType,
1035 uint baseMask, uint currentMask, uint everyoneMask, uint nextOwnerMask, uint groupMask, int creationDate, 1030 uint baseMask, uint currentMask, uint everyoneMask, uint nextOwnerMask, uint groupMask, int creationDate,
1036 bool assetUpload) 1031 bool assetUpload)
1037=======
1038 string name, string description, uint flags, uint callbackID, AssetBase asset, sbyte invType,
1039 uint baseMask, uint currentMask, uint everyoneMask, uint nextOwnerMask, uint groupMask, int creationDate,UUID transationID)
1040>>>>>>> avn/ubitvar
1041 { 1032 {
1042 InventoryItemBase item = new InventoryItemBase(); 1033 InventoryItemBase item = new InventoryItemBase();
1043 item.Owner = remoteClient.AgentId; 1034 item.Owner = remoteClient.AgentId;
@@ -1058,17 +1049,13 @@ namespace OpenSim.Region.Framework.Scenes
1058 item.BasePermissions = baseMask; 1049 item.BasePermissions = baseMask;
1059 item.CreationDate = creationDate; 1050 item.CreationDate = creationDate;
1060 1051
1061<<<<<<< HEAD
1062 if (AddInventoryItem(item, assetUpload))
1063=======
1064 // special AnimationSet case 1052 // special AnimationSet case
1065 if (item.InvType == (int)CustomInventoryType.AnimationSet) 1053 if (item.InvType == (int)CustomInventoryType.AnimationSet)
1066 AnimationSet.enforceItemPermitions(item,true); 1054 AnimationSet.enforceItemPermitions(item,true);
1067 1055
1068 if (AddInventoryItem(item)) 1056 if (AddInventoryItem(item))
1069>>>>>>> avn/ubitvar
1070 { 1057 {
1071 remoteClient.SendInventoryItemCreateUpdate(item, transationID, callbackID); 1058 remoteClient.SendInventoryItemCreateUpdate(item, callbackID);
1072 } 1059 }
1073 else 1060 else
1074 { 1061 {
@@ -1284,7 +1271,6 @@ namespace OpenSim.Region.Framework.Scenes
1284 agentItem.BasePermissions = taskItem.BasePermissions & (taskItem.NextPermissions | (uint)PermissionMask.Move); 1271 agentItem.BasePermissions = taskItem.BasePermissions & (taskItem.NextPermissions | (uint)PermissionMask.Move);
1285 if (taskItem.InvType == (int)InventoryType.Object) 1272 if (taskItem.InvType == (int)InventoryType.Object)
1286 { 1273 {
1287<<<<<<< HEAD
1288 // Bake the new base permissions from folded permissions 1274 // Bake the new base permissions from folded permissions
1289 // The folded perms are in the lowest 3 bits of the current perms 1275 // The folded perms are in the lowest 3 bits of the current perms
1290 // We use base permissions here to avoid baking the "Locked" status 1276 // We use base permissions here to avoid baking the "Locked" status
@@ -1296,13 +1282,6 @@ namespace OpenSim.Region.Framework.Scenes
1296 agentItem.BasePermissions = perms | (uint)PermissionMask.Move; 1282 agentItem.BasePermissions = perms | (uint)PermissionMask.Move;
1297 // Newly given items cannot be "locked" on rez. Make sure by 1283 // Newly given items cannot be "locked" on rez. Make sure by
1298 // setting current equal to base. 1284 // setting current equal to base.
1299=======
1300 uint perms = taskItem.BasePermissions & taskItem.NextPermissions;
1301 PermissionsUtil.ApplyFoldedPermissions(taskItem.CurrentPermissions, ref perms);
1302// agentItem.BasePermissions = perms | (uint)PermissionMask.Move;
1303// agentItem.CurrentPermissions = agentItem.BasePermissions;
1304 agentItem.BasePermissions = perms | (uint)PermissionMask.Move;
1305>>>>>>> avn/ubitvar
1306 } 1285 }
1307 1286
1308 agentItem.CurrentPermissions = agentItem.BasePermissions; 1287 agentItem.CurrentPermissions = agentItem.BasePermissions;
@@ -1577,12 +1556,12 @@ namespace OpenSim.Region.Framework.Scenes
1577 1556
1578 public UUID MoveTaskInventoryItems(UUID destID, string category, SceneObjectPart host, List<UUID> items) 1557 public UUID MoveTaskInventoryItems(UUID destID, string category, SceneObjectPart host, List<UUID> items)
1579 { 1558 {
1580<<<<<<< HEAD 1559
1581 ScenePresence avatar; 1560 ScenePresence avatar;
1582 IClientAPI remoteClient = null; 1561 IClientAPI remoteClient = null;
1583 if (TryGetScenePresence(destID, out avatar)) 1562 if (TryGetScenePresence(destID, out avatar))
1584 remoteClient = avatar.ControllingClient; 1563 remoteClient = avatar.ControllingClient;
1585======= 1564// ????
1586 SceneObjectPart destPart = GetSceneObjectPart(destID); 1565 SceneObjectPart destPart = GetSceneObjectPart(destID);
1587 if (destPart != null) // Move into a prim 1566 if (destPart != null) // Move into a prim
1588 { 1567 {
@@ -1590,7 +1569,7 @@ namespace OpenSim.Region.Framework.Scenes
1590 MoveTaskInventoryItem(destID, host, itemID); 1569 MoveTaskInventoryItem(destID, host, itemID);
1591 return destID; // Prim folder ID == prim ID 1570 return destID; // Prim folder ID == prim ID
1592 } 1571 }
1593>>>>>>> avn/ubitvar 1572// /????
1594 1573
1595 InventoryFolderBase rootFolder = InventoryService.GetRootFolder(destID); 1574 InventoryFolderBase rootFolder = InventoryService.GetRootFolder(destID);
1596 1575
@@ -2156,14 +2135,16 @@ namespace OpenSim.Region.Framework.Scenes
2156 List<uint> deleteIDs = new List<uint>(); 2135 List<uint> deleteIDs = new List<uint>();
2157 List<SceneObjectGroup> deleteGroups = new List<SceneObjectGroup>(); 2136 List<SceneObjectGroup> deleteGroups = new List<SceneObjectGroup>();
2158 List<SceneObjectGroup> takeGroups = new List<SceneObjectGroup>(); 2137 List<SceneObjectGroup> takeGroups = new List<SceneObjectGroup>();
2138
2139 // Start with true for both, then remove the flags if objects
2140 // that we can't derez are part of the selection
2141 bool permissionToTake = true;
2142 bool permissionToTakeCopy = true;
2143 bool permissionToDelete = true;
2159 2144
2160 foreach (uint localID in localIDs) 2145 foreach (uint localID in localIDs)
2161 { 2146 {
2162 // Start with true for both, then remove the flags if objects 2147
2163 // that we can't derez are part of the selection
2164 bool permissionToTake = true;
2165 bool permissionToTakeCopy = true;
2166 bool permissionToDelete = true;
2167 2148
2168 // Invalid id 2149 // Invalid id
2169 SceneObjectPart part = GetSceneObjectPart(localID); 2150 SceneObjectPart part = GetSceneObjectPart(localID);
@@ -2287,27 +2268,15 @@ namespace OpenSim.Region.Framework.Scenes
2287 } 2268 }
2288 } 2269 }
2289 2270
2290<<<<<<< HEAD 2271 SendKillObject(deleteIDs);
2291 // OK, we're done with permissions. Let's check if any part of the code prevents the objects from being deleted
2292 bool canDelete = EventManager.TriggerDeRezRequested(remoteClient, deleteGroups, action);
2293
2294 if (permissionToTake && (action != DeRezAction.Delete || this.m_useTrashOnDelete))
2295=======
2296 SendKillObject(deleteIDs);
2297 2272
2298 if (deleteGroups.Count > 0) 2273 if (deleteGroups.Count > 0)
2299>>>>>>> avn/ubitvar
2300 { 2274 {
2301 foreach (SceneObjectGroup g in deleteGroups) 2275 foreach (SceneObjectGroup g in deleteGroups)
2302 deleteIDs.Remove(g.LocalId); 2276 deleteIDs.Remove(g.LocalId);
2303 2277
2304 m_asyncSceneObjectDeleter.DeleteToInventory( 2278 m_asyncSceneObjectDeleter.DeleteToInventory(
2305 action, destinationID, deleteGroups, remoteClient, 2279 action, destinationID, deleteGroups, remoteClient,
2306<<<<<<< HEAD
2307 permissionToDelete && canDelete);
2308 }
2309 else if (permissionToDelete && canDelete)
2310=======
2311 true); 2280 true);
2312 } 2281 }
2313 if (takeGroups.Count > 0) 2282 if (takeGroups.Count > 0)
@@ -2317,7 +2286,6 @@ namespace OpenSim.Region.Framework.Scenes
2317 false); 2286 false);
2318 } 2287 }
2319 if (deleteIDs.Count > 0) 2288 if (deleteIDs.Count > 0)
2320>>>>>>> avn/ubitvar
2321 { 2289 {
2322 foreach (SceneObjectGroup g in deleteGroups) 2290 foreach (SceneObjectGroup g in deleteGroups)
2323 DeleteSceneObject(g, true); 2291 DeleteSceneObject(g, true);
@@ -2361,7 +2329,7 @@ namespace OpenSim.Region.Framework.Scenes
2361 item.AssetType = asset.Type; 2329 item.AssetType = asset.Type;
2362 item.InvType = (int)InventoryType.Object; 2330 item.InvType = (int)InventoryType.Object;
2363 2331
2364 InventoryFolderBase folder = InventoryService.GetFolderForType(remoteClient.AgentId, AssetType.Object); 2332 InventoryFolderBase folder = InventoryService.GetFolderForType(remoteClient.AgentId, FolderType.Object);
2365 if (folder != null) 2333 if (folder != null)
2366 item.Folder = folder.ID; 2334 item.Folder = folder.ID;
2367 else // oopsies 2335 else // oopsies
@@ -2435,34 +2403,10 @@ namespace OpenSim.Region.Framework.Scenes
2435 2403
2436 string xmlData = ExternalRepresentationUtils.SanitizeXml(Utils.BytesToString(assetData)); 2404 string xmlData = ExternalRepresentationUtils.SanitizeXml(Utils.BytesToString(assetData));
2437 2405
2438<<<<<<< HEAD
2439 try 2406 try
2440=======
2441 if (e == null || attachment) // Single
2442 {
2443 SceneObjectGroup g = SceneObjectSerializer.FromOriginalXmlFormat(xmlData);
2444/*
2445 if (!attachment)
2446 {
2447 g.RootPart.AttachPoint = g.RootPart.Shape.State;
2448 g.RootPart.AttachedPos = g.AbsolutePosition;
2449 g.RootPart.AttachRotation = g.GroupRotation;
2450 if (g.RootPart.Shape.PCode != (byte)PCode.NewTree &&
2451 g.RootPart.Shape.PCode != (byte)PCode.Tree)
2452 g.RootPart.Shape.State = 0;
2453 }
2454*/
2455 objlist.Add(g);
2456 veclist.Add(new Vector3(0, 0, 0));
2457 bbox = g.GetAxisAlignedBoundingBox(out offsetHeight);
2458 return true;
2459 }
2460 else
2461>>>>>>> avn/ubitvar
2462 { 2407 {
2463 using (XmlTextReader wrappedReader = new XmlTextReader(xmlData, XmlNodeType.Element, null)) 2408 using (XmlTextReader wrappedReader = new XmlTextReader(xmlData, XmlNodeType.Element, null))
2464 { 2409 {
2465<<<<<<< HEAD
2466 using (XmlReader reader = XmlReader.Create(wrappedReader, new XmlReaderSettings() { IgnoreWhitespace = true, ConformanceLevel = ConformanceLevel.Fragment })) 2410 using (XmlReader reader = XmlReader.Create(wrappedReader, new XmlReaderSettings() { IgnoreWhitespace = true, ConformanceLevel = ConformanceLevel.Fragment }))
2467 { 2411 {
2468 reader.Read(); 2412 reader.Read();
@@ -2481,7 +2425,7 @@ namespace OpenSim.Region.Framework.Scenes
2481 Util.LogFailedXML("[AGENT INVENTORY]:", xmlData); 2425 Util.LogFailedXML("[AGENT INVENTORY]:", xmlData);
2482 g = null; 2426 g = null;
2483 } 2427 }
2484 2428
2485 if (g != null) 2429 if (g != null)
2486 { 2430 {
2487 objlist.Add(g); 2431 objlist.Add(g);
@@ -2492,7 +2436,7 @@ namespace OpenSim.Region.Framework.Scenes
2492 return true; 2436 return true;
2493 } 2437 }
2494 else 2438 else
2495 { 2439 {
2496 XmlDocument doc = new XmlDocument(); 2440 XmlDocument doc = new XmlDocument();
2497 doc.LoadXml(xmlData); 2441 doc.LoadXml(xmlData);
2498 XmlElement e = (XmlElement)doc.SelectSingleNode("/CoalescedObject"); 2442 XmlElement e = (XmlElement)doc.SelectSingleNode("/CoalescedObject");
@@ -2526,28 +2470,6 @@ namespace OpenSim.Region.Framework.Scenes
2526 return false; 2470 return false;
2527 } 2471 }
2528 } 2472 }
2529=======
2530 SceneObjectGroup g = SceneObjectSerializer.FromOriginalXmlFormat(n.OuterXml);
2531/*
2532 g.RootPart.AttachPoint = g.RootPart.Shape.State;
2533 g.RootPart.AttachedPos = g.AbsolutePosition;
2534 g.RootPart.AttachRotation = g.GroupRotation;
2535 if (g.RootPart.Shape.PCode != (byte)PCode.NewTree &&
2536 g.RootPart.Shape.PCode != (byte)PCode.Tree)
2537 g.RootPart.Shape.State = 0;
2538*/
2539 objlist.Add(g);
2540
2541 XmlElement el = (XmlElement)n;
2542 string rawX = el.GetAttribute("offsetx");
2543 string rawY = el.GetAttribute("offsety");
2544 string rawZ = el.GetAttribute("offsetz");
2545
2546 float x = Convert.ToSingle(rawX);
2547 float y = Convert.ToSingle(rawY);
2548 float z = Convert.ToSingle(rawZ);
2549 veclist.Add(new Vector3(x, y, z));
2550>>>>>>> avn/ubitvar
2551 } 2473 }
2552 } 2474 }
2553 catch (Exception e) 2475 catch (Exception e)