2007-10-31 01:21:04 +00:00
|
|
|
/*
|
2008-03-18 05:16:43 +00:00
|
|
|
* Copyright (c) Contributors, http://opensimulator.org/
|
|
|
|
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions are met:
|
|
|
|
* * Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* * Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
* * Neither the name of the OpenSim Project nor the
|
|
|
|
* names of its contributors may be used to endorse or promote products
|
|
|
|
* derived from this software without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
|
|
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
|
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
|
|
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
|
|
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
|
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
|
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
|
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
|
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
2008-10-21 00:44:57 +00:00
|
|
|
using System;
|
2008-09-06 07:52:41 +00:00
|
|
|
using OpenMetaverse;
|
2007-10-31 01:21:04 +00:00
|
|
|
|
|
|
|
namespace OpenSim.Framework
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// Inventory Item - contains all the properties associated with an individual inventory piece.
|
|
|
|
/// </summary>
|
2009-02-11 19:29:59 +00:00
|
|
|
public class InventoryItemBase : InventoryNodeBase
|
2007-10-31 01:21:04 +00:00
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// The UUID of the associated asset on the asset server
|
|
|
|
/// </summary>
|
2008-09-06 07:52:41 +00:00
|
|
|
private UUID _assetID;
|
2007-10-31 01:21:04 +00:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// This is an enumerated value determining the type of asset (eg Notecard, Sound, Object, etc)
|
|
|
|
/// </summary>
|
2008-04-07 23:15:35 +00:00
|
|
|
private int _assetType;
|
2007-10-31 01:21:04 +00:00
|
|
|
|
|
|
|
/// <summary>
|
2008-05-16 01:22:11 +00:00
|
|
|
///
|
2007-10-31 01:21:04 +00:00
|
|
|
/// </summary>
|
2008-04-29 14:04:55 +00:00
|
|
|
private uint _basePermissions;
|
2007-10-31 01:21:04 +00:00
|
|
|
|
|
|
|
/// <summary>
|
2008-04-29 14:04:55 +00:00
|
|
|
/// The creator of this item
|
2007-10-31 01:21:04 +00:00
|
|
|
/// </summary>
|
2009-04-08 17:50:57 +00:00
|
|
|
private string m_creatorId = String.Empty;
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// The creator of this item expressed as a UUID
|
|
|
|
/// </summary>
|
|
|
|
private UUID m_creatorIdAsUuid = UUID.Zero;
|
2007-10-31 01:21:04 +00:00
|
|
|
|
2009-04-08 17:50:57 +00:00
|
|
|
/// <summary>
|
|
|
|
///
|
|
|
|
/// </summary>
|
2008-04-30 16:08:24 +00:00
|
|
|
private uint _nextPermissions;
|
|
|
|
|
2007-10-31 01:21:04 +00:00
|
|
|
/// <summary>
|
2008-04-29 14:04:55 +00:00
|
|
|
/// A mask containing permissions for the current owner (cannot be enforced)
|
2007-10-31 01:21:04 +00:00
|
|
|
/// </summary>
|
2008-04-29 14:04:55 +00:00
|
|
|
private uint _currentPermissions;
|
2007-10-31 01:21:04 +00:00
|
|
|
|
|
|
|
/// <summary>
|
2008-04-29 14:04:55 +00:00
|
|
|
/// The description of the inventory item (must be less than 64 characters)
|
2007-10-31 01:21:04 +00:00
|
|
|
/// </summary>
|
2009-02-17 15:39:18 +00:00
|
|
|
private string _description = string.Empty;
|
2007-10-31 01:21:04 +00:00
|
|
|
|
|
|
|
/// <summary>
|
2008-05-16 01:22:11 +00:00
|
|
|
///
|
2007-10-31 01:21:04 +00:00
|
|
|
/// </summary>
|
2008-04-29 14:04:55 +00:00
|
|
|
private uint _everyOnePermissions;
|
2007-10-31 01:21:04 +00:00
|
|
|
|
2008-11-14 18:54:38 +00:00
|
|
|
/// <summary>
|
|
|
|
///
|
|
|
|
/// </summary>
|
|
|
|
private uint _groupPermissions;
|
|
|
|
|
2007-10-31 01:21:04 +00:00
|
|
|
/// <summary>
|
2008-05-16 01:22:11 +00:00
|
|
|
/// The folder this item is contained in
|
2007-10-31 01:21:04 +00:00
|
|
|
/// </summary>
|
2008-09-06 07:52:41 +00:00
|
|
|
private UUID _folder;
|
2007-10-31 01:21:04 +00:00
|
|
|
|
|
|
|
/// <summary>
|
2009-02-11 19:29:59 +00:00
|
|
|
/// The inventory type of the item. This is slightly different from the asset type in some situations.
|
2007-10-31 01:21:04 +00:00
|
|
|
/// </summary>
|
2008-04-29 14:04:55 +00:00
|
|
|
private int _invType;
|
2007-10-31 01:21:04 +00:00
|
|
|
|
|
|
|
/// <summary>
|
2008-05-16 01:22:11 +00:00
|
|
|
///
|
2007-10-31 01:21:04 +00:00
|
|
|
/// </summary>
|
2008-09-06 07:52:41 +00:00
|
|
|
private UUID _groupID;
|
2008-04-29 14:04:55 +00:00
|
|
|
|
|
|
|
/// <summary>
|
2008-05-16 01:22:11 +00:00
|
|
|
///
|
2008-04-29 14:04:55 +00:00
|
|
|
/// </summary>
|
2008-04-30 16:08:24 +00:00
|
|
|
private bool _groupOwned;
|
2008-04-29 14:04:55 +00:00
|
|
|
|
2008-04-30 16:08:24 +00:00
|
|
|
/// <summary>
|
2008-05-16 01:22:11 +00:00
|
|
|
///
|
2008-04-30 16:08:24 +00:00
|
|
|
/// </summary>
|
|
|
|
private int _salePrice;
|
|
|
|
|
|
|
|
/// <summary>
|
2008-05-16 01:22:11 +00:00
|
|
|
///
|
2008-04-30 16:08:24 +00:00
|
|
|
/// </summary>
|
|
|
|
private byte _saleType;
|
|
|
|
|
|
|
|
/// <summary>
|
2008-05-16 01:22:11 +00:00
|
|
|
///
|
2008-04-30 16:08:24 +00:00
|
|
|
/// </summary>
|
|
|
|
private uint _flags;
|
|
|
|
|
|
|
|
/// <summary>
|
2008-05-16 01:22:11 +00:00
|
|
|
///
|
2008-04-30 16:08:24 +00:00
|
|
|
/// </summary>
|
2008-06-25 19:18:51 +00:00
|
|
|
private int _creationDate;
|
2008-04-30 16:08:24 +00:00
|
|
|
|
2008-09-12 21:00:29 +00:00
|
|
|
public int InvType
|
2008-04-29 14:04:55 +00:00
|
|
|
{
|
|
|
|
get { return _invType; }
|
|
|
|
set { _invType = value; }
|
2008-04-07 23:15:35 +00:00
|
|
|
}
|
|
|
|
|
2008-09-12 21:00:29 +00:00
|
|
|
public UUID Folder
|
2008-04-29 14:04:55 +00:00
|
|
|
{
|
|
|
|
get { return _folder; }
|
|
|
|
set { _folder = value; }
|
2008-04-07 23:15:35 +00:00
|
|
|
}
|
|
|
|
|
2009-04-08 17:50:57 +00:00
|
|
|
/// <value>
|
|
|
|
/// The creator ID
|
|
|
|
/// </value>
|
|
|
|
public string CreatorId
|
|
|
|
{
|
|
|
|
get { return m_creatorId; }
|
|
|
|
set
|
|
|
|
{
|
|
|
|
m_creatorId = value;
|
|
|
|
|
|
|
|
// For now, all IDs are UUIDs
|
|
|
|
UUID.TryParse(m_creatorId, out m_creatorIdAsUuid);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <value>
|
|
|
|
/// The creator ID expressed as a UUID
|
|
|
|
/// </value>
|
|
|
|
public UUID CreatorIdAsUuid
|
2008-04-29 14:04:55 +00:00
|
|
|
{
|
2009-04-08 17:50:57 +00:00
|
|
|
get { return m_creatorIdAsUuid; }
|
2008-04-07 23:15:35 +00:00
|
|
|
}
|
|
|
|
|
2008-09-12 21:00:29 +00:00
|
|
|
public string Description
|
2008-04-29 14:04:55 +00:00
|
|
|
{
|
|
|
|
get { return _description; }
|
|
|
|
set { _description = value; }
|
2008-04-07 23:15:35 +00:00
|
|
|
}
|
|
|
|
|
2008-09-12 21:00:29 +00:00
|
|
|
public uint NextPermissions
|
2008-04-29 14:04:55 +00:00
|
|
|
{
|
|
|
|
get { return _nextPermissions; }
|
|
|
|
set { _nextPermissions = value; }
|
2008-04-07 23:15:35 +00:00
|
|
|
}
|
|
|
|
|
2008-09-12 21:00:29 +00:00
|
|
|
public uint CurrentPermissions
|
2008-04-29 14:04:55 +00:00
|
|
|
{
|
|
|
|
get { return _currentPermissions; }
|
|
|
|
set { _currentPermissions = value; }
|
2008-04-07 23:15:35 +00:00
|
|
|
}
|
|
|
|
|
2008-09-12 21:00:29 +00:00
|
|
|
public uint BasePermissions
|
2008-04-29 14:04:55 +00:00
|
|
|
{
|
|
|
|
get { return _basePermissions; }
|
|
|
|
set { _basePermissions = value; }
|
2008-04-07 23:15:35 +00:00
|
|
|
}
|
|
|
|
|
2008-09-12 21:00:29 +00:00
|
|
|
public uint EveryOnePermissions
|
2008-04-29 14:04:55 +00:00
|
|
|
{
|
|
|
|
get { return _everyOnePermissions; }
|
|
|
|
set { _everyOnePermissions = value; }
|
2008-04-07 23:15:35 +00:00
|
|
|
}
|
|
|
|
|
2008-11-14 18:54:38 +00:00
|
|
|
public uint GroupPermissions
|
|
|
|
{
|
|
|
|
get { return _groupPermissions; }
|
|
|
|
set { _groupPermissions = value; }
|
|
|
|
}
|
|
|
|
|
2008-09-12 21:00:29 +00:00
|
|
|
public int AssetType
|
2008-04-29 14:04:55 +00:00
|
|
|
{
|
|
|
|
get { return _assetType; }
|
|
|
|
set { _assetType = value; }
|
2008-04-07 23:15:35 +00:00
|
|
|
}
|
|
|
|
|
2008-09-12 21:00:29 +00:00
|
|
|
public UUID AssetID
|
2008-04-29 14:04:55 +00:00
|
|
|
{
|
|
|
|
get { return _assetID; }
|
|
|
|
set { _assetID = value; }
|
2008-04-07 23:15:35 +00:00
|
|
|
}
|
2008-04-30 16:08:24 +00:00
|
|
|
|
2008-09-12 21:00:29 +00:00
|
|
|
public UUID GroupID
|
2008-04-30 16:08:24 +00:00
|
|
|
{
|
2008-09-12 21:00:29 +00:00
|
|
|
get { return _groupID; }
|
|
|
|
set { _groupID = value; }
|
2008-04-30 16:08:24 +00:00
|
|
|
}
|
|
|
|
|
2008-09-12 21:00:29 +00:00
|
|
|
public bool GroupOwned
|
2008-04-30 16:08:24 +00:00
|
|
|
{
|
2008-09-12 21:00:29 +00:00
|
|
|
get { return _groupOwned; }
|
|
|
|
set { _groupOwned = value; }
|
2008-04-30 16:08:24 +00:00
|
|
|
}
|
|
|
|
|
2008-09-12 21:00:29 +00:00
|
|
|
public int SalePrice
|
2008-04-30 16:08:24 +00:00
|
|
|
{
|
2008-09-12 21:00:29 +00:00
|
|
|
get { return _salePrice; }
|
|
|
|
set { _salePrice = value; }
|
2008-04-30 16:08:24 +00:00
|
|
|
}
|
|
|
|
|
2008-09-12 21:00:29 +00:00
|
|
|
public byte SaleType
|
2008-04-30 16:08:24 +00:00
|
|
|
{
|
2008-09-12 21:00:29 +00:00
|
|
|
get { return _saleType; }
|
|
|
|
set { _saleType = value; }
|
2008-04-30 16:08:24 +00:00
|
|
|
}
|
|
|
|
|
2008-09-12 21:00:29 +00:00
|
|
|
public uint Flags
|
2008-04-30 16:08:24 +00:00
|
|
|
{
|
2008-09-12 21:00:29 +00:00
|
|
|
get { return _flags; }
|
|
|
|
set { _flags = value; }
|
2008-04-30 16:08:24 +00:00
|
|
|
}
|
|
|
|
|
2008-09-12 21:00:29 +00:00
|
|
|
public int CreationDate
|
2008-04-30 16:08:24 +00:00
|
|
|
{
|
2008-09-12 21:00:29 +00:00
|
|
|
get { return _creationDate; }
|
|
|
|
set { _creationDate = value; }
|
2008-04-30 16:08:24 +00:00
|
|
|
}
|
2008-10-21 00:44:57 +00:00
|
|
|
|
|
|
|
public InventoryItemBase()
|
|
|
|
{
|
|
|
|
_creationDate = (int)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;
|
|
|
|
}
|
2007-10-31 01:21:04 +00:00
|
|
|
}
|
2008-04-30 16:08:24 +00:00
|
|
|
}
|