OpenSim
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
InventoryAccessModule.cs
Go to the documentation of this file.
1 /*
2  * Copyright (c) Contributors, http://opensimulator.org/
3  * See CONTRIBUTORS.TXT for a full list of copyright holders.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  * * Redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer.
9  * * Redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution.
12  * * Neither the name of the OpenSimulator Project nor the
13  * names of its contributors may be used to endorse or promote products
14  * derived from this software without specific prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19  * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26  */
27 
28 using System;
29 using System.Collections.Generic;
30 using System.Net;
31 using System.Xml;
32 using System.Reflection;
33 using System.Text;
34 using System.Threading;
35 
36 using OpenSim.Framework;
37 using OpenSim.Framework.Capabilities;
38 using OpenSim.Framework.Client;
39 using OpenSim.Region.Framework.Interfaces;
40 using OpenSim.Region.Framework.Scenes;
41 using OpenSim.Region.Framework.Scenes.Serialization;
42 using OpenSim.Services.Interfaces;
43 
45 
46 using OpenMetaverse;
47 using log4net;
48 using Nini.Config;
49 using Mono.Addins;
51 
52 namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
53 {
54  [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "BasicInventoryAccessModule")]
56  {
57  private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
58 
59  protected bool m_Enabled = false;
60  protected Scene m_Scene;
62  protected IUserManagement UserManagementModule
63  {
64  get
65  {
66  if (m_UserManagement == null)
67  m_UserManagement = m_Scene.RequestModuleInterface<IUserManagement>();
68  return m_UserManagement;
69  }
70  }
71 
72  public bool CoalesceMultipleObjectsToInventory { get; set; }
73 
74  #region INonSharedRegionModule
75 
76  public Type ReplaceableInterface
77  {
78  get { return null; }
79  }
80 
81  public virtual string Name
82  {
83  get { return "BasicInventoryAccessModule"; }
84  }
85 
86  public virtual void Initialise(IConfigSource source)
87  {
88  IConfig moduleConfig = source.Configs["Modules"];
89  if (moduleConfig != null)
90  {
91  string name = moduleConfig.GetString("InventoryAccessModule", "");
92  if (name == Name)
93  {
94  m_Enabled = true;
95 
96  InitialiseCommon(source);
97 
98  m_log.InfoFormat("[INVENTORY ACCESS MODULE]: {0} enabled.", Name);
99  }
100  }
101  }
102 
107  protected virtual void InitialiseCommon(IConfigSource source)
108  {
109  IConfig inventoryConfig = source.Configs["Inventory"];
110 
111  if (inventoryConfig != null)
112  CoalesceMultipleObjectsToInventory
113  = inventoryConfig.GetBoolean("CoalesceMultipleObjectsToInventory", true);
114  else
115  CoalesceMultipleObjectsToInventory = true;
116  }
117 
118  public virtual void PostInitialise()
119  {
120  }
121 
122  public virtual void AddRegion(Scene scene)
123  {
124  if (!m_Enabled)
125  return;
126 
127  m_Scene = scene;
128 
129  scene.RegisterModuleInterface<IInventoryAccessModule>(this);
130  scene.EventManager.OnNewClient += OnNewClient;
131  }
132 
133  protected virtual void OnNewClient(IClientAPI client)
134  {
135  client.OnCreateNewInventoryItem += CreateNewInventoryItem;
136  }
137 
138  public virtual void Close()
139  {
140  if (!m_Enabled)
141  return;
142  }
143 
144 
145  public virtual void RemoveRegion(Scene scene)
146  {
147  if (!m_Enabled)
148  return;
149  m_Scene = null;
150  }
151 
152  public virtual void RegionLoaded(Scene scene)
153  {
154  if (!m_Enabled)
155  return;
156  }
157 
158  #endregion
159 
160  #region Inventory Access
161 
176  public void CreateNewInventoryItem(IClientAPI remoteClient, UUID transactionID, UUID folderID,
177  uint callbackID, string description, string name, sbyte invType,
178  sbyte assetType,
179  byte wearableType, uint nextOwnerMask, int creationDate)
180  {
181  m_log.DebugFormat("[INVENTORY ACCESS MODULE]: Received request to create inventory item {0} in folder {1}, transactionID {2}", name,
182  folderID, transactionID);
183 
184  if (!m_Scene.Permissions.CanCreateUserInventory(invType, remoteClient.AgentId))
185  return;
186 
187  InventoryFolderBase f = new InventoryFolderBase(folderID, remoteClient.AgentId);
188  InventoryFolderBase folder = m_Scene.InventoryService.GetFolder(f);
189 
190  if (folder == null || folder.Owner != remoteClient.AgentId)
191  return;
192 
193  if (transactionID != UUID.Zero)
194  {
195  IAgentAssetTransactions agentTransactions = m_Scene.AgentTransactionsModule;
196  if (agentTransactions != null)
197  {
198  if (agentTransactions.HandleItemCreationFromTransaction(
199  remoteClient, transactionID, folderID, callbackID, description,
200  name, invType, assetType, wearableType, nextOwnerMask))
201  return;
202  }
203  }
204 
205  ScenePresence presence;
206  if (m_Scene.TryGetScenePresence(remoteClient.AgentId, out presence))
207  {
208  byte[] data = null;
209 
210  if (invType == (sbyte)InventoryType.Landmark && presence != null)
211  {
212  string suffix = string.Empty, prefix = string.Empty;
213  string strdata = GenerateLandmark(presence, out prefix, out suffix);
214  data = Encoding.ASCII.GetBytes(strdata);
215  name = prefix + name;
216  description += suffix;
217  }
218 
219  AssetBase asset = m_Scene.CreateAsset(name, description, assetType, data, remoteClient.AgentId);
220  m_Scene.AssetService.Store(asset);
221  m_Scene.CreateNewInventoryItem(
222  remoteClient, remoteClient.AgentId.ToString(), string.Empty, folderID,
223  name, description, 0, callbackID, asset.FullID, asset.Type, invType, nextOwnerMask, creationDate);
224  }
225  else
226  {
227  m_log.ErrorFormat(
228  "[INVENTORY ACCESS MODULE]: ScenePresence for agent uuid {0} unexpectedly not found in CreateNewInventoryItem",
229  remoteClient.AgentId);
230  }
231  }
232 
233  protected virtual string GenerateLandmark(ScenePresence presence, out string prefix, out string suffix)
234  {
235  prefix = string.Empty;
236  suffix = string.Empty;
237  Vector3 pos = presence.AbsolutePosition;
238  return String.Format("Landmark version 2\nregion_id {0}\nlocal_pos {1} {2} {3}\nregion_handle {4}\n",
239  presence.Scene.RegionInfo.RegionID,
240  pos.X, pos.Y, pos.Z,
241  presence.RegionHandle);
242  }
243 
251  public virtual UUID CapsUpdateInventoryItemAsset(IClientAPI remoteClient, UUID itemID, byte[] data)
252  {
253  InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId);
254  item = m_Scene.InventoryService.GetItem(item);
255 
256  if (item.Owner != remoteClient.AgentId)
257  return UUID.Zero;
258 
259  if (item != null)
260  {
261  if ((InventoryType)item.InvType == InventoryType.Notecard)
262  {
263  if (!m_Scene.Permissions.CanEditNotecard(itemID, UUID.Zero, remoteClient.AgentId))
264  {
265  remoteClient.SendAgentAlertMessage("Insufficient permissions to edit notecard", false);
266  return UUID.Zero;
267  }
268 
269  remoteClient.SendAlertMessage("Notecard saved");
270  }
271  else if ((InventoryType)item.InvType == InventoryType.LSL)
272  {
273  if (!m_Scene.Permissions.CanEditScript(itemID, UUID.Zero, remoteClient.AgentId))
274  {
275  remoteClient.SendAgentAlertMessage("Insufficient permissions to edit script", false);
276  return UUID.Zero;
277  }
278 
279  remoteClient.SendAlertMessage("Script saved");
280  }
281  else if ((CustomInventoryType)item.InvType == CustomInventoryType.AnimationSet)
282  {
283  AnimationSet animSet = new AnimationSet(data);
284  if (!animSet.Validate(x => {
285  int perms = m_Scene.InventoryService.GetAssetPermissions(remoteClient.AgentId, x);
286  int required = (int)(PermissionMask.Transfer | PermissionMask.Copy);
287  if ((perms & required) != required)
288  return false;
289  return true;
290  }))
291  {
292  data = animSet.ToBytes();
293  }
294  }
295 
296  AssetBase asset =
297  CreateAsset(item.Name, item.Description, (sbyte)item.AssetType, data, remoteClient.AgentId.ToString());
298  item.AssetID = asset.FullID;
299  m_Scene.AssetService.Store(asset);
300 
301  m_Scene.InventoryService.UpdateItem(item);
302 
303  // remoteClient.SendInventoryItemCreateUpdate(item);
304  return (asset.FullID);
305  }
306  else
307  {
308  m_log.ErrorFormat(
309  "[INVENTORY ACCESS MODULE]: Could not find item {0} for caps inventory update",
310  itemID);
311  }
312 
313  return UUID.Zero;
314  }
315 
316  public virtual bool UpdateInventoryItemAsset(UUID ownerID, InventoryItemBase item, AssetBase asset)
317  {
318  if (item != null && item.Owner == ownerID && asset != null)
319  {
320 // m_log.DebugFormat(
321 // "[INVENTORY ACCESS MODULE]: Updating item {0} {1} with new asset {2}",
322 // item.Name, item.ID, asset.ID);
323 
324  item.AssetID = asset.FullID;
325  item.Description = asset.Description;
326  item.Name = asset.Name;
327  item.AssetType = asset.Type;
328  item.InvType = (int)InventoryType.Object;
329 
330  m_Scene.AssetService.Store(asset);
331  m_Scene.InventoryService.UpdateItem(item);
332 
333  return true;
334  }
335  else
336  {
337  m_log.ErrorFormat("[INVENTORY ACCESS MODULE]: Given invalid item for inventory update: {0}",
338  (item == null || asset == null? "null item or asset" : "wrong owner"));
339  return false;
340  }
341  }
342 
343  public virtual List<InventoryItemBase> CopyToInventory(
344  DeRezAction action, UUID folderID,
345  List<SceneObjectGroup> objectGroups, IClientAPI remoteClient, bool asAttachment)
346  {
347  List<InventoryItemBase> copiedItems = new List<InventoryItemBase>();
348 
349  Dictionary<UUID, List<SceneObjectGroup>> bundlesToCopy = new Dictionary<UUID, List<SceneObjectGroup>>();
350 
351  if (CoalesceMultipleObjectsToInventory)
352  {
353  // The following code groups the SOG's by owner. No objects
354  // belonging to different people can be coalesced, for obvious
355  // reasons.
356  foreach (SceneObjectGroup g in objectGroups)
357  {
358  if (!bundlesToCopy.ContainsKey(g.OwnerID))
359  bundlesToCopy[g.OwnerID] = new List<SceneObjectGroup>();
360 
361  bundlesToCopy[g.OwnerID].Add(g);
362  }
363  }
364  else
365  {
366  // If we don't want to coalesce then put every object in its own bundle.
367  foreach (SceneObjectGroup g in objectGroups)
368  {
369  List<SceneObjectGroup> bundle = new List<SceneObjectGroup>();
370  bundle.Add(g);
371  bundlesToCopy[g.UUID] = bundle;
372  }
373  }
374 
375 // m_log.DebugFormat(
376 // "[INVENTORY ACCESS MODULE]: Copying {0} object bundles to folder {1} action {2} for {3}",
377 // bundlesToCopy.Count, folderID, action, remoteClient.Name);
378 
379  // Each iteration is really a separate asset being created,
380  // with distinct destinations as well.
381  foreach (List<SceneObjectGroup> bundle in bundlesToCopy.Values)
382  copiedItems.Add(CopyBundleToInventory(action, folderID, bundle, remoteClient, asAttachment));
383 
384  return copiedItems;
385  }
386 
399  DeRezAction action, UUID folderID, List<SceneObjectGroup> objlist, IClientAPI remoteClient,
400  bool asAttachment)
401  {
403  Dictionary<UUID, Vector3> originalPositions = new Dictionary<UUID, Vector3>();
404  Dictionary<UUID, Quaternion> originalRotations = new Dictionary<UUID, Quaternion>();
405  // this possible is not needed if keyframes are saved
406  Dictionary<UUID, KeyframeMotion> originalKeyframes = new Dictionary<UUID, KeyframeMotion>();
407 
408  foreach (SceneObjectGroup objectGroup in objlist)
409  {
410  if (objectGroup.RootPart.KeyframeMotion != null)
411  {
412  objectGroup.RootPart.KeyframeMotion.Suspend();
413  }
414  objectGroup.RootPart.SetForce(Vector3.Zero);
415  objectGroup.RootPart.SetAngularImpulse(Vector3.Zero, false);
416 
417  originalKeyframes[objectGroup.UUID] = objectGroup.RootPart.KeyframeMotion;
418  objectGroup.RootPart.KeyframeMotion = null;
419 
420  Vector3 inventoryStoredPosition = objectGroup.AbsolutePosition;
421  originalPositions[objectGroup.UUID] = inventoryStoredPosition;
422  Quaternion inventoryStoredRotation = objectGroup.GroupRotation;
423  originalRotations[objectGroup.UUID] = inventoryStoredRotation;
424 
425  // Restore attachment data after trip through the sim
426  if (objectGroup.RootPart.AttachPoint > 0)
427  {
428  inventoryStoredPosition = objectGroup.RootPart.AttachedPos;
429  inventoryStoredRotation = objectGroup.RootPart.AttachRotation;
430  }
431 
432  // Trees could be attached and it's been done, but it makes
433  // no sense. State must be preserved because it's the tree type
434  if (objectGroup.RootPart.Shape.PCode != (byte) PCode.Tree &&
435  objectGroup.RootPart.Shape.PCode != (byte) PCode.NewTree)
436  {
437  objectGroup.RootPart.Shape.State = objectGroup.RootPart.AttachPoint;
438  if (objectGroup.RootPart.AttachPoint > 0)
439  objectGroup.RootPart.Shape.LastAttachPoint = objectGroup.RootPart.AttachPoint;
440  }
441 
442  objectGroup.AbsolutePosition = inventoryStoredPosition;
443  objectGroup.RootPart.RotationOffset = inventoryStoredRotation;
444 
445  // Make sure all bits but the ones we want are clear
446  // on take.
447  // This will be applied to the current perms, so
448  // it will do what we want.
449  objectGroup.RootPart.NextOwnerMask &=
450  ((uint)PermissionMask.Copy |
451  (uint)PermissionMask.Transfer |
452  (uint)PermissionMask.Modify |
453  (uint)PermissionMask.Export);
454  objectGroup.RootPart.NextOwnerMask |=
455  (uint)PermissionMask.Move;
456 
457  coa.Add(objectGroup);
458  }
459 
460  string itemXml;
461 
462  // If we're being called from a script, then trying to serialize that same script's state will not complete
463  // in any reasonable time period. Therefore, we'll avoid it. The worst that can happen is that if
464  // the client/server crashes rather than logging out normally, the attachment's scripts will resume
465  // without state on relog. Arguably, this is what we want anyway.
466  if (objlist.Count > 1)
467  itemXml = CoalescedSceneObjectsSerializer.ToXml(coa, !asAttachment);
468  else
469  itemXml = SceneObjectSerializer.ToOriginalXmlFormat(objlist[0], !asAttachment);
470 
471  // Restore the position of each group now that it has been stored to inventory.
472  foreach (SceneObjectGroup objectGroup in objlist)
473  {
474  objectGroup.AbsolutePosition = originalPositions[objectGroup.UUID];
475  objectGroup.RootPart.RotationOffset = originalRotations[objectGroup.UUID];
476  objectGroup.RootPart.KeyframeMotion = originalKeyframes[objectGroup.UUID];
477  if (objectGroup.RootPart.KeyframeMotion != null)
478  objectGroup.RootPart.KeyframeMotion.Resume();
479  }
480 
481  InventoryItemBase item = CreateItemForObject(action, remoteClient, objlist[0], folderID);
482 
483 // m_log.DebugFormat(
484 // "[INVENTORY ACCESS MODULE]: Created item is {0}",
485 // item != null ? item.ID.ToString() : "NULL");
486 
487  if (item == null)
488  return null;
489 
490  item.CreatorId = objlist[0].RootPart.CreatorID.ToString();
491  item.CreatorData = objlist[0].RootPart.CreatorData;
492 
493  if (objlist.Count > 1)
494  {
495  item.Flags = (uint)InventoryItemFlags.ObjectHasMultipleItems;
496 
497  // If the objects have different creators then don't specify a creator at all
498  foreach (SceneObjectGroup objectGroup in objlist)
499  {
500  if ((objectGroup.RootPart.CreatorID.ToString() != item.CreatorId)
501  || (objectGroup.RootPart.CreatorData.ToString() != item.CreatorData))
502  {
503  item.CreatorId = UUID.Zero.ToString();
504  item.CreatorData = string.Empty;
505  break;
506  }
507  }
508  }
509  else
510  {
511  item.SaleType = objlist[0].RootPart.ObjectSaleType;
512  item.SalePrice = objlist[0].RootPart.SalePrice;
513  }
514 
515  AssetBase asset = CreateAsset(
516  objlist[0].GetPartName(objlist[0].RootPart.LocalId),
517  objlist[0].GetPartDescription(objlist[0].RootPart.LocalId),
518  (sbyte)AssetType.Object,
519  Utils.StringToBytes(itemXml),
520  objlist[0].OwnerID.ToString());
521  m_Scene.AssetService.Store(asset);
522 
523  item.AssetID = asset.FullID;
524 
525  if (DeRezAction.SaveToExistingUserInventoryItem == action)
526  {
527  m_Scene.InventoryService.UpdateItem(item);
528  }
529  else
530  {
531  item.CreationDate = Util.UnixTimeSinceEpoch();
532  item.Description = asset.Description;
533  item.Name = asset.Name;
534  item.AssetType = asset.Type;
535 
536  //preserve perms on return
537  if(DeRezAction.Return == action)
538  AddPermissions(item, objlist[0], objlist, null);
539  else
540  AddPermissions(item, objlist[0], objlist, remoteClient);
541 
542  m_Scene.AddInventoryItem(item);
543 
544  if (remoteClient != null && item.Owner == remoteClient.AgentId)
545  {
546  remoteClient.SendInventoryItemCreateUpdate(item, 0);
547  }
548  else
549  {
550  ScenePresence notifyUser = m_Scene.GetScenePresence(item.Owner);
551  if (notifyUser != null)
552  {
553  notifyUser.ControllingClient.SendInventoryItemCreateUpdate(item, 0);
554  }
555  }
556  }
557 
558  // This is a hook to do some per-asset post-processing for subclasses that need that
559  if (remoteClient != null)
560  ExportAsset(remoteClient.AgentId, asset.FullID);
561 
562  return item;
563  }
564 
565  protected virtual void ExportAsset(UUID agentID, UUID assetID)
566  {
567  // nothing to do here
568  }
569 
579  InventoryItemBase item, SceneObjectGroup so, List<SceneObjectGroup> objsForEffectivePermissions,
580  IClientAPI remoteClient)
581  {
582  uint effectivePerms = (uint)(PermissionMask.Copy | PermissionMask.Transfer | PermissionMask.Modify | PermissionMask.Move | PermissionMask.Export) | 7;
583  uint allObjectsNextOwnerPerms = 0x7fffffff;
584 
585  // For the porposes of inventory, an object is modify if the prims
586  // are modify. This allows renaming an object that contains no
587  // mod items.
588  foreach (SceneObjectGroup grp in objsForEffectivePermissions)
589  {
590  uint groupPerms = grp.GetEffectivePermissions(true);
591  if ((grp.RootPart.BaseMask & (uint)PermissionMask.Modify) != 0)
592  groupPerms |= (uint)PermissionMask.Modify;
593 
594  effectivePerms &= groupPerms;
595  }
596  effectivePerms |= (uint)PermissionMask.Move;
597 
598  //PermissionsUtil.LogPermissions(item.Name, "Before AddPermissions", item.BasePermissions, item.CurrentPermissions, item.NextPermissions);
599 
600  if (remoteClient != null && (remoteClient.AgentId != so.RootPart.OwnerID) && m_Scene.Permissions.PropagatePermissions())
601  {
602  // Changing ownership, so apply the "Next Owner" permissions to all of the
603  // inventory item's permissions.
604 
605  uint perms = effectivePerms;
606  PermissionsUtil.ApplyFoldedPermissions(effectivePerms, ref perms);
607 
608  item.BasePermissions = perms & so.RootPart.NextOwnerMask;
609  item.CurrentPermissions = item.BasePermissions;
610  item.NextPermissions = perms & so.RootPart.NextOwnerMask;
611  item.EveryOnePermissions = so.RootPart.EveryoneMask & so.RootPart.NextOwnerMask;
612  item.GroupPermissions = so.RootPart.GroupMask & so.RootPart.NextOwnerMask;
613 
614  // apply next owner perms on rez
615  item.CurrentPermissions |= SceneObjectGroup.SLAM;
616  }
617  else
618  {
619  // Not changing ownership.
620  // In this case we apply the permissions in the object's items ONLY to the inventory
621  // item's "Next Owner" permissions, but NOT to its "Current", "Base", etc. permissions.
622  // E.g., if the object contains a No-Transfer item then the item's "Next Owner"
623  // permissions are also No-Transfer.
624  PermissionsUtil.ApplyFoldedPermissions(effectivePerms, ref allObjectsNextOwnerPerms);
625 
626  item.BasePermissions = effectivePerms;
627  item.CurrentPermissions = effectivePerms;
628  item.NextPermissions = so.RootPart.NextOwnerMask & effectivePerms;
629  item.EveryOnePermissions = so.RootPart.EveryoneMask & effectivePerms;
630  item.GroupPermissions = so.RootPart.GroupMask & effectivePerms;
631 
632  item.CurrentPermissions &=
633  ((uint)PermissionMask.Copy |
634  (uint)PermissionMask.Transfer |
635  (uint)PermissionMask.Modify |
636  (uint)PermissionMask.Move |
637  (uint)PermissionMask.Export |
638  7); // Preserve folded permissions
639  }
640 
641  //PermissionsUtil.LogPermissions(item.Name, "After AddPermissions", item.BasePermissions, item.CurrentPermissions, item.NextPermissions);
642 
643  return item;
644  }
645 
655  DeRezAction action, IClientAPI remoteClient, SceneObjectGroup so, UUID folderID)
656  {
657 // m_log.DebugFormat(
658 // "[BASIC INVENTORY ACCESS MODULE]: Creating item for object {0} {1} for folder {2}, action {3}",
659 // so.Name, so.UUID, folderID, action);
660 //
661  // Get the user info of the item destination
662  //
663  UUID userID = UUID.Zero;
664 
665  if (action == DeRezAction.Take || action == DeRezAction.TakeCopy ||
666  action == DeRezAction.SaveToExistingUserInventoryItem)
667  {
668  // Take or take copy require a taker
669  // Saving changes requires a local user
670  //
671  if (remoteClient == null)
672  return null;
673 
674  userID = remoteClient.AgentId;
675 
676 // m_log.DebugFormat(
677 // "[INVENTORY ACCESS MODULE]: Target of {0} in CreateItemForObject() is {1} {2}",
678 // action, remoteClient.Name, userID);
679  }
680  else if (so.RootPart.OwnerID == so.RootPart.GroupID)
681  {
682  // Group owned objects go to the last owner before the object was transferred.
683  userID = so.RootPart.LastOwnerID;
684  }
685  else
686  {
687  // Other returns / deletes go to the object owner
688  //
689  userID = so.RootPart.OwnerID;
690 
691 // m_log.DebugFormat(
692 // "[INVENTORY ACCESS MODULE]: Target of {0} in CreateItemForObject() is object owner {1}",
693 // action, userID);
694  }
695 
696  if (userID == UUID.Zero) // Can't proceed
697  {
698  return null;
699  }
700 
701  // If we're returning someone's item, it goes back to the
702  // owner's Lost And Found folder.
703  // Delete is treated like return in this case
704  // Deleting your own items makes them go to trash
705  //
706 
707  InventoryFolderBase folder = null;
708  InventoryItemBase item = null;
709 
710  if (DeRezAction.SaveToExistingUserInventoryItem == action)
711  {
712  item = new InventoryItemBase(so.RootPart.FromUserInventoryItemID, userID);
713  item = m_Scene.InventoryService.GetItem(item);
714 
715  //item = userInfo.RootFolder.FindItem(
716  // objectGroup.RootPart.FromUserInventoryItemID);
717 
718  if (null == item)
719  {
720  m_log.DebugFormat(
721  "[INVENTORY ACCESS MODULE]: Object {0} {1} scheduled for save to inventory has already been deleted.",
722  so.Name, so.UUID);
723 
724  return null;
725  }
726  }
727  else
728  {
729  // Folder magic
730  //
731  if (action == DeRezAction.Delete)
732  {
733  // Deleting someone else's item
734  //
735  if (remoteClient == null ||
736  so.OwnerID != remoteClient.AgentId)
737  {
738  folder = m_Scene.InventoryService.GetFolderForType(userID, FolderType.LostAndFound);
739  }
740  else
741  {
742  folder = m_Scene.InventoryService.GetFolderForType(userID, FolderType.Trash);
743  }
744  }
745  else if (action == DeRezAction.Return)
746  {
747  // Dump to lost + found unconditionally
748  //
749  folder = m_Scene.InventoryService.GetFolderForType(userID, FolderType.LostAndFound);
750  }
751 
752  if (folderID == UUID.Zero && folder == null)
753  {
754  if (action == DeRezAction.Delete)
755  {
756  // Deletes go to trash by default
757  //
758  folder = m_Scene.InventoryService.GetFolderForType(userID, FolderType.Trash);
759  }
760  else
761  {
762  if (remoteClient == null || so.RootPart.OwnerID != remoteClient.AgentId)
763  {
764  // Taking copy of another person's item. Take to
765  // Objects folder.
766  folder = m_Scene.InventoryService.GetFolderForType(userID, FolderType.Object);
767  so.FromFolderID = UUID.Zero;
768  }
769  else
770  {
771  // Catch all. Use lost & found
772  //
773  folder = m_Scene.InventoryService.GetFolderForType(userID, FolderType.LostAndFound);
774  }
775  }
776  }
777 
778  // Override and put into where it came from, if it came
779  // from anywhere in inventory and the owner is taking it back.
780  //
781  if (action == DeRezAction.Take || action == DeRezAction.TakeCopy)
782  {
783  if (so.FromFolderID != UUID.Zero && so.RootPart.OwnerID == remoteClient.AgentId)
784  {
786  if (f != null)
787  folder = m_Scene.InventoryService.GetFolder(f);
788 
789  if(folder.Type == 14 || folder.Type == 16)
790  {
791  // folder.Type = 6;
792  folder = m_Scene.InventoryService.GetFolderForType(userID, FolderType.Object);
793  }
794  }
795  }
796 
797  if (folder == null) // None of the above
798  {
799  folder = new InventoryFolderBase(folderID);
800 
801  if (folder == null) // Nowhere to put it
802  {
803  return null;
804  }
805  }
806 
807  item = new InventoryItemBase();
808  item.ID = UUID.Random();
809  item.InvType = (int)InventoryType.Object;
810  item.Folder = folder.ID;
811  item.Owner = userID;
812  }
813 
814  return item;
815  }
816 
817  public virtual SceneObjectGroup RezObject(
818  IClientAPI remoteClient, UUID itemID, Vector3 RayEnd, Vector3 RayStart,
819  UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection,
820  bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment)
821  {
822 // m_log.DebugFormat("[INVENTORY ACCESS MODULE]: RezObject for {0}, item {1}", remoteClient.Name, itemID);
823  InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId);
824  item = m_Scene.InventoryService.GetItem(item);
825 
826  if (item == null)
827  {
828  return null;
829  }
830 
831  item.Owner = remoteClient.AgentId;
832 
833  return RezObject(
834  remoteClient, item, item.AssetID,
835  RayEnd, RayStart, RayTargetID, BypassRayCast, RayEndIsIntersection,
836  RezSelected, RemoveItem, fromTaskID, attachment);
837  }
838 
839  public virtual SceneObjectGroup RezObject(
840  IClientAPI remoteClient, InventoryItemBase item, UUID assetID, Vector3 RayEnd, Vector3 RayStart,
841  UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection,
842  bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment)
843  {
844  AssetBase rezAsset = m_Scene.AssetService.Get(assetID.ToString());
845 
846  if (rezAsset == null)
847  {
848  if (item != null)
849  {
850  m_log.WarnFormat(
851  "[InventoryAccessModule]: Could not find asset {0} for item {1} {2} for {3} in RezObject()",
852  assetID, item.Name, item.ID, remoteClient.Name);
853  remoteClient.SendAgentAlertMessage(string.Format("Unable to rez: could not find asset {0} for item {1}.", assetID, item.Name), false);
854  }
855  else
856  {
857  m_log.WarnFormat(
858  "[INVENTORY ACCESS MODULE]: Could not find asset {0} for {1} in RezObject()",
859  assetID, remoteClient.Name);
860  remoteClient.SendAgentAlertMessage(string.Format("Unable to rez: could not find asset {0}.", assetID), false);
861  }
862 
863  return null;
864  }
865 
866  SceneObjectGroup group = null;
867 
868  List<SceneObjectGroup> objlist;
869  List<Vector3> veclist;
870  Vector3 bbox;
871  float offsetHeight;
872  byte bRayEndIsIntersection = (byte)(RayEndIsIntersection ? 1 : 0);
873  Vector3 pos;
874 
875  bool single
876  = m_Scene.GetObjectsToRez(
877  rezAsset.Data, attachment, out objlist, out veclist, out bbox, out offsetHeight);
878 
879  if (single)
880  {
881  pos = m_Scene.GetNewRezLocation(
882  RayStart, RayEnd, RayTargetID, Quaternion.Identity,
883  BypassRayCast, bRayEndIsIntersection, true, bbox, false);
884  pos.Z += offsetHeight;
885  }
886  else
887  {
888  pos = m_Scene.GetNewRezLocation(RayStart, RayEnd,
889  RayTargetID, Quaternion.Identity,
890  BypassRayCast, bRayEndIsIntersection, true,
891  bbox, false);
892  pos -= bbox / 2;
893  }
894 
895  int primcount = 0;
896  foreach (SceneObjectGroup g in objlist)
897  primcount += g.PrimCount;
898 
899  if (!m_Scene.Permissions.CanRezObject(
900  primcount, remoteClient.AgentId, pos)
901  && !attachment)
902  {
903  // The client operates in no fail mode. It will
904  // have already removed the item from the folder
905  // if it's no copy.
906  // Put it back if it's not an attachment
907  //
908  if (item != null)
909  {
910  if (((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) && (!attachment))
911  remoteClient.SendBulkUpdateInventory(item);
912  }
913 
914  return null;
915  }
916 
917  if (item != null && !DoPreRezWhenFromItem(remoteClient, item, objlist, pos, veclist, attachment))
918  return null;
919 
920  for (int i = 0; i < objlist.Count; i++)
921  {
922  group = objlist[i];
923  SceneObjectPart rootPart = group.RootPart;
924 
925 // m_log.DebugFormat(
926 // "[INVENTORY ACCESS MODULE]: Preparing to rez {0} {1} {2} ownermask={3:X} nextownermask={4:X} groupmask={5:X} everyonemask={6:X} for {7}",
927 // group.Name, group.LocalId, group.UUID,
928 // group.RootPart.OwnerMask, group.RootPart.NextOwnerMask, group.RootPart.GroupMask, group.RootPart.EveryoneMask,
929 // remoteClient.Name);
930 
931 // Vector3 storedPosition = group.AbsolutePosition;
932  if (group.UUID == UUID.Zero)
933  {
934  m_log.Debug("[INVENTORY ACCESS MODULE]: Object has UUID.Zero! Position 3");
935  }
936 
937  // if this was previously an attachment and is now being rezzed,
938  // save the old attachment info.
939  if (group.IsAttachment == false && group.RootPart.Shape.State != 0)
940  {
941  group.RootPart.AttachedPos = group.AbsolutePosition;
942  group.RootPart.Shape.LastAttachPoint = (byte)group.AttachmentPoint;
943  }
944 
945  if (item == null)
946  {
947  // Change ownership. Normally this is done in DoPreRezWhenFromItem(), but in this case we must do it here.
948  foreach (SceneObjectPart part in group.Parts)
949  {
950  // Make the rezzer the owner, as this is not necessarily set correctly in the serialized asset.
951  part.LastOwnerID = part.OwnerID;
952  part.OwnerID = remoteClient.AgentId;
953  }
954  }
955 
956  group.ResetIDs();
957 
958  if (!attachment)
959  {
960  // If it's rezzed in world, select it. Much easier to
961  // find small items.
962  //
963  foreach (SceneObjectPart part in group.Parts)
964  {
965  part.CreateSelected = true;
966  }
967 
968  if (rootPart.Shape.PCode == (byte)PCode.Prim)
969  group.ClearPartAttachmentData();
970  }
971  else
972  {
973  group.IsAttachment = true;
974  }
975 
976  // If we're rezzing an attachment then don't ask
977  // AddNewSceneObject() to update the client since
978  // we'll be doing that later on. Scheduling more than
979  // one full update during the attachment
980  // process causes some clients to fail to display the
981  // attachment properly.
982  m_Scene.AddNewSceneObject(group, true, false);
983 
984  if (!attachment)
985  group.AbsolutePosition = pos + veclist[i];
986 
987  group.SetGroup(remoteClient.ActiveGroupId, remoteClient);
988 
989  if (!attachment)
990  {
991  // Fire on_rez
992  group.CreateScriptInstances(0, true, m_Scene.DefaultScriptEngine, 1);
993  rootPart.ParentGroup.ResumeScripts();
994 
995  group.ScheduleGroupForFullUpdate();
996  }
997 
998 // m_log.DebugFormat(
999 // "[INVENTORY ACCESS MODULE]: Rezzed {0} {1} {2} ownermask={3:X} nextownermask={4:X} groupmask={5:X} everyonemask={6:X} for {7}",
1000 // group.Name, group.LocalId, group.UUID,
1001 // group.RootPart.OwnerMask, group.RootPart.NextOwnerMask, group.RootPart.GroupMask, group.RootPart.EveryoneMask,
1002 // remoteClient.Name);
1003  }
1004 
1005 // group.SetGroup(remoteClient.ActiveGroupId, remoteClient);
1006 
1007  if (item != null)
1008  DoPostRezWhenFromItem(item, attachment);
1009 
1010  return group;
1011  }
1012 
1026  private bool DoPreRezWhenFromItem(
1027  IClientAPI remoteClient, InventoryItemBase item, List<SceneObjectGroup> objlist,
1028  Vector3 pos, List<Vector3> veclist, bool isAttachment)
1029  {
1030  UUID fromUserInventoryItemId = UUID.Zero;
1031 
1032  // If we have permission to copy then link the rezzed object back to the user inventory
1033  // item that it came from. This allows us to enable 'save object to inventory'
1034  if (!m_Scene.Permissions.BypassPermissions())
1035  {
1036  if ((item.CurrentPermissions & (uint)PermissionMask.Copy)
1037  == (uint)PermissionMask.Copy && (item.Flags & (uint)InventoryItemFlags.ObjectHasMultipleItems) == 0)
1038  {
1039  fromUserInventoryItemId = item.ID;
1040  }
1041  }
1042  else
1043  {
1044  if ((item.Flags & (uint)InventoryItemFlags.ObjectHasMultipleItems) == 0)
1045  {
1046  // Brave new fullperm world
1047  fromUserInventoryItemId = item.ID;
1048  }
1049  }
1050 
1051  for (int i = 0; i < objlist.Count; i++)
1052  {
1053  SceneObjectGroup g = objlist[i];
1054 
1055  if (!m_Scene.Permissions.CanRezObject(
1056  g.PrimCount, remoteClient.AgentId, pos + veclist[i])
1057  && !isAttachment)
1058  {
1059  // The client operates in no fail mode. It will
1060  // have already removed the item from the folder
1061  // if it's no copy.
1062  // Put it back if it's not an attachment
1063  //
1064  if (((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) && (!isAttachment))
1065  remoteClient.SendBulkUpdateInventory(item);
1066 
1067  ILandObject land = m_Scene.LandChannel.GetLandObject(pos.X, pos.Y);
1068  remoteClient.SendAlertMessage(string.Format(
1069  "Can't rez object '{0}' at <{1:F3}, {2:F3}, {3:F3}> on parcel '{4}' in region {5}.",
1070  item.Name, pos.X, pos.Y, pos.Z, land != null ? land.LandData.Name : "Unknown", m_Scene.Name));
1071 
1072  return false;
1073  }
1074  }
1075 
1076  for (int i = 0; i < objlist.Count; i++)
1077  {
1078  SceneObjectGroup so = objlist[i];
1079  SceneObjectPart rootPart = so.RootPart;
1080 
1081  // Since renaming the item in the inventory does not
1082  // affect the name stored in the serialization, transfer
1083  // the correct name from the inventory to the
1084  // object itself before we rez.
1085  //
1086  // Only do these for the first object if we are rezzing a coalescence.
1087  // nahh dont mess with coalescence objects,
1088  // the name in inventory can be change for inventory purpuses only
1089  if (objlist.Count == 1)
1090  {
1091  rootPart.Name = item.Name;
1092  rootPart.Description = item.Description;
1093  }
1094 
1095  if ((item.Flags & (uint)InventoryItemFlags.ObjectSlamSale) != 0)
1096  {
1097  rootPart.ObjectSaleType = item.SaleType;
1098  rootPart.SalePrice = item.SalePrice;
1099  }
1100 
1101  so.FromFolderID = item.Folder;
1102 
1103 // m_log.DebugFormat(
1104 // "[INVENTORY ACCESS MODULE]: rootPart.OwnedID {0}, item.Owner {1}, item.CurrentPermissions {2:X}",
1105 // rootPart.OwnerID, item.Owner, item.CurrentPermissions);
1106 
1107  if ((rootPart.OwnerID != item.Owner) ||
1108  (item.CurrentPermissions & 16) != 0 ||
1109  (item.Flags & (uint)InventoryItemFlags.ObjectSlamPerm) != 0)
1110  {
1111  //Need to kill the for sale here
1112  rootPart.ObjectSaleType = 0;
1113  rootPart.SalePrice = 10;
1114 
1115  if (m_Scene.Permissions.PropagatePermissions())
1116  {
1117  foreach (SceneObjectPart part in so.Parts)
1118  {
1119  part.GroupMask = 0; // DO NOT propagate here
1120 
1121  part.LastOwnerID = part.OwnerID;
1122  part.OwnerID = item.Owner;
1123  part.Inventory.ChangeInventoryOwner(item.Owner);
1124  }
1125 
1126  so.ApplyNextOwnerPermissions();
1127 
1128  // In case the user has changed flags on a received item
1129  // we have to apply those changes after the slam. Else we
1130  // get a net loss of permissions
1131  foreach (SceneObjectPart part in so.Parts)
1132  {
1133  if ((item.Flags & (uint)InventoryItemFlags.ObjectHasMultipleItems) == 0)
1134  {
1135  if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteEveryone) != 0)
1136  part.EveryoneMask = item.EveryOnePermissions & part.BaseMask;
1137  if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteNextOwner) != 0)
1138  part.NextOwnerMask = item.NextPermissions & part.BaseMask;
1139  }
1140  }
1141  }
1142  }
1143  else
1144  {
1145  foreach (SceneObjectPart part in so.Parts)
1146  {
1147  part.FromUserInventoryItemID = fromUserInventoryItemId;
1148 
1149  if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteEveryone) != 0)
1150  part.EveryoneMask = item.EveryOnePermissions;
1151  if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteNextOwner) != 0)
1152  part.NextOwnerMask = item.NextPermissions;
1153  if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteGroup) != 0)
1154  part.GroupMask = item.GroupPermissions;
1155  }
1156  }
1157 
1158  rootPart.TrimPermissions();
1159 
1160  if (isAttachment)
1161  so.FromItemID = item.ID;
1162  }
1163 
1164  return true;
1165  }
1166 
1172  private void DoPostRezWhenFromItem(InventoryItemBase item, bool isAttachment)
1173  {
1174  if (!m_Scene.Permissions.BypassPermissions())
1175  {
1176  if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0)
1177  {
1178  // If this is done on attachments, no
1179  // copy ones will be lost, so avoid it
1180  //
1181  if (!isAttachment)
1182  {
1183  List<UUID> uuids = new List<UUID>();
1184  uuids.Add(item.ID);
1185  m_Scene.InventoryService.DeleteItems(item.Owner, uuids);
1186  }
1187  }
1188  }
1189  }
1190 
1191  protected void AddUserData(SceneObjectGroup sog)
1192  {
1193  UserManagementModule.AddUser(sog.RootPart.CreatorID, sog.RootPart.CreatorData);
1194  foreach (SceneObjectPart sop in sog.Parts)
1195  UserManagementModule.AddUser(sop.CreatorID, sop.CreatorData);
1196  }
1197 
1198  public virtual void TransferInventoryAssets(InventoryItemBase item, UUID sender, UUID receiver)
1199  {
1200  }
1201 
1202  public virtual bool CanGetAgentInventoryItem(IClientAPI remoteClient, UUID itemID, UUID requestID)
1203  {
1204  InventoryItemBase assetRequestItem = GetItem(remoteClient.AgentId, itemID);
1205 
1206  if (assetRequestItem == null)
1207  {
1208  ILibraryService lib = m_Scene.RequestModuleInterface<ILibraryService>();
1209 
1210  if (lib != null)
1211  assetRequestItem = lib.LibraryRootFolder.FindItem(itemID);
1212 
1213  if (assetRequestItem == null)
1214  return false;
1215  }
1216 
1217  // At this point, we need to apply perms
1218  // only to notecards and scripts. All
1219  // other asset types are always available
1220  //
1221  if (assetRequestItem.AssetType == (int)AssetType.LSLText)
1222  {
1223  if (!m_Scene.Permissions.CanViewScript(itemID, UUID.Zero, remoteClient.AgentId))
1224  {
1225  remoteClient.SendAgentAlertMessage("Insufficient permissions to view script", false);
1226  return false;
1227  }
1228  }
1229  else if (assetRequestItem.AssetType == (int)AssetType.Notecard)
1230  {
1231  if (!m_Scene.Permissions.CanViewNotecard(itemID, UUID.Zero, remoteClient.AgentId))
1232  {
1233  remoteClient.SendAgentAlertMessage("Insufficient permissions to view notecard", false);
1234  return false;
1235  }
1236  }
1237 
1238  if (assetRequestItem.AssetID != requestID)
1239  {
1240  m_log.WarnFormat(
1241  "[INVENTORY ACCESS MODULE]: {0} requested asset {1} from item {2} but this does not match item's asset {3}",
1242  Name, requestID, itemID, assetRequestItem.AssetID);
1243 
1244  return false;
1245  }
1246 
1247  return true;
1248  }
1249 
1250 
1251  public virtual bool IsForeignUser(UUID userID, out string assetServerURL)
1252  {
1253  assetServerURL = string.Empty;
1254  return false;
1255  }
1256 
1257  #endregion
1258 
1259  #region Misc
1260 
1270  private AssetBase CreateAsset(string name, string description, sbyte assetType, byte[] data, string creatorID)
1271  {
1272  AssetBase asset = new AssetBase(UUID.Random(), name, assetType, creatorID);
1273  asset.Description = description;
1274  asset.Data = (data == null) ? new byte[1] : data;
1275 
1276  return asset;
1277  }
1278 
1279  protected virtual InventoryItemBase GetItem(UUID agentID, UUID itemID)
1280  {
1281  IInventoryService invService = m_Scene.RequestModuleInterface<IInventoryService>();
1282  InventoryItemBase item = new InventoryItemBase(itemID, agentID);
1283  item = invService.GetItem(item);
1284 
1285  if (item != null && item.CreatorData != null && item.CreatorData != string.Empty)
1286  UserManagementModule.AddUser(item.CreatorIdAsUuid, item.CreatorData);
1287 
1288  return item;
1289  }
1290 
1291  #endregion
1292  }
1293 }
InventoryItemBase CreateItemForObject(DeRezAction action, IClientAPI remoteClient, SceneObjectGroup so, UUID folderID)
Create an item using details for the given scene object.
OpenSim.Server.Handlers.Simulation.Utils Utils
virtual string GenerateLandmark(ScenePresence presence, out string prefix, out string suffix)
delegate void RezObject(IClientAPI remoteClient, UUID itemID, Vector3 RayEnd, Vector3 RayStart, UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection, bool RezSelected, bool RemoveItem, UUID fromTaskID)
UUID FromFolderID
The folder ID that this object was rezzed from, if applicable.
A scene object group is conceptually an object in the scene. The object is constituted of SceneObject...
sbyte Type
(sbyte) AssetType enum
Definition: AssetBase.cs:198
virtual void Close()
This is the inverse to Initialise. After a Close(), this instance won't be usable anymore...
virtual SceneObjectGroup RezObject(IClientAPI remoteClient, InventoryItemBase item, UUID assetID, Vector3 RayEnd, Vector3 RayStart, UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection, bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment)
Rez an object into the scene from the user's inventory
virtual void RegionLoaded(Scene scene)
This will be called once for every scene loaded. In a shared module this will be multiple times in on...
virtual void InitialiseCommon(IConfigSource source)
Common module config for both this and descendant classes.
virtual void RemoveRegion(Scene scene)
This is called whenever a Scene is removed. For shared modules, this can happen several times...
void CreateNewInventoryItem(IClientAPI remoteClient, UUID transactionID, UUID folderID, uint callbackID, string description, string name, sbyte invType, sbyte assetType, byte wearableType, uint nextOwnerMask, int creationDate)
Create a new inventory item. Called when the client creates a new item directly within their inventor...
virtual UUID Owner
The agent who's inventory this is contained by
OpenSim.Services.Interfaces.GridRegion GridRegion
Asset class. All Assets are reference by this class or a class derived from this class ...
Definition: AssetBase.cs:49
int PrimCount
Number of prims in this group
virtual void AddRegion(Scene scene)
This is called whenever a Scene is added. For shared modules, this can happen several times...
string CreatorData
Data about the creator in the form home_url;name
virtual void Initialise(IConfigSource source)
This is called to initialize the region module. For shared modules, this is called exactly once...
Inventory Item - contains all the properties associated with an individual inventory piece...
virtual bool UpdateInventoryItemAsset(UUID ownerID, InventoryItemBase item, AssetBase asset)
bool Validate(AnimationSetValidator val)
bool HandleItemCreationFromTransaction(IClientAPI remoteClient, UUID transactionID, UUID folderID, uint callbackID, string description, string name, sbyte invType, sbyte type, byte wearableType, uint nextOwnerMask)
UUID ID
A UUID containing the ID for the inventory node itself
virtual List< InventoryItemBase > CopyToInventory(DeRezAction action, UUID folderID, List< SceneObjectGroup > objectGroups, IClientAPI remoteClient, bool asAttachment)
Copy objects to a user's inventory.
InventoryItemBase AddPermissions(InventoryItemBase item, SceneObjectGroup so, List< SceneObjectGroup > objsForEffectivePermissions, IClientAPI remoteClient)
Add relevant permissions for an object to the item.
virtual string Name
The name of the node (64 characters or less)
UUID FullID
Asset UUID
Definition: AssetBase.cs:168
InventoryItemBase CopyBundleToInventory(DeRezAction action, UUID folderID, List< SceneObjectGroup > objlist, IClientAPI remoteClient, bool asAttachment)
Copy a bundle of objects to inventory. If there is only one object, then this will create an object i...
This maintains the relationship between a UUID and a user name.
virtual UUID CapsUpdateInventoryItemAsset(IClientAPI remoteClient, UUID itemID, byte[] data)
Capability originating call to update the asset of an item in an agent's inventory ...
virtual bool CanGetAgentInventoryItem(IClientAPI remoteClient, UUID itemID, UUID requestID)
Does the client have sufficient permissions to retrieve the inventory item?
OpenSim.Region.Framework.Scenes.Animation.AnimationSet AnimationSet
virtual SceneObjectGroup RezObject(IClientAPI remoteClient, UUID itemID, Vector3 RayEnd, Vector3 RayStart, UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection, bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment)
Rez an object into the scene from the user's inventory
Represents a coalescene of scene objects. A coalescence occurs when objects that are not in the same ...
OpenSim.Framework.PermissionMask PermissionMask
virtual void TransferInventoryAssets(InventoryItemBase item, UUID sender, UUID receiver)
delegate void CreateNewInventoryItem(IClientAPI remoteClient, UUID transActionID, UUID folderID, uint callbackID, string description, string name, sbyte invType, sbyte type, byte wearableType, uint nextOwnerMask, int creationDate)