From c617d658dda92ad97de678d477a98c3df0659303 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 21 Nov 2010 17:19:24 -0800 Subject: Added creator info across the board -- TaskInventoryItems and InventoryItems themselves. Tested. Seems to be working, main tests pass. Nothing done for IARs or HG transfers yet -- this only works for OARs for the time being. New migration in inventory table in order to make CreatorID varchar(255). --- OpenSim/Framework/InventoryItemBase.cs | 50 ++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) (limited to 'OpenSim/Framework/InventoryItemBase.cs') diff --git a/OpenSim/Framework/InventoryItemBase.cs b/OpenSim/Framework/InventoryItemBase.cs index aeb01e2..ce4fc38 100644 --- a/OpenSim/Framework/InventoryItemBase.cs +++ b/OpenSim/Framework/InventoryItemBase.cs @@ -117,6 +117,56 @@ namespace OpenSim.Framework } protected UUID m_creatorIdAsUuid = UUID.Zero; + protected string m_creatorData; + public string CreatorData // = ; + { + get { return m_creatorData; } + set { m_creatorData = value; } + } + + /// + /// Used by the DB layer to retrieve / store the entire user identification. + /// The identification can either be a simple UUID or a string of the form + /// uuid[;profile_url[;name]] + /// + public string CreatorIdentification + { + get + { + if (m_creatorData != null && m_creatorData != string.Empty) + return m_creatorId + ';' + m_creatorData; + else + return m_creatorId; + } + set + { + if ((value == null) || (value != null && value == string.Empty)) + { + m_creatorData = string.Empty; + return; + } + + if (!value.Contains(";")) // plain UUID + { + m_creatorId = value; + } + else // [;[;name]] + { + string name = "Unknown User"; + string[] parts = value.Split(';'); + if (parts.Length >= 1) + m_creatorId = parts[0]; + if (parts.Length >= 2) + m_creatorData = parts[1]; + if (parts.Length >= 3) + name = parts[2]; + + m_creatorData += ';' + name; + + } + } + } + /// /// The description of the inventory item (must be less than 64 characters) /// -- cgit v1.1