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/TaskInventoryItem.cs | 56 ++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) (limited to 'OpenSim/Framework/TaskInventoryItem.cs') diff --git a/OpenSim/Framework/TaskInventoryItem.cs b/OpenSim/Framework/TaskInventoryItem.cs index df5b936..30d775c 100644 --- a/OpenSim/Framework/TaskInventoryItem.cs +++ b/OpenSim/Framework/TaskInventoryItem.cs @@ -102,6 +102,7 @@ namespace OpenSim.Framework private uint _baseMask = FULL_MASK_PERMISSIONS_GENERAL; private uint _creationDate = 0; private UUID _creatorID = UUID.Zero; + private string _creatorData = String.Empty; private string _description = String.Empty; private uint _everyoneMask = FULL_MASK_PERMISSIONS_GENERAL; private uint _flags = 0; @@ -160,6 +161,61 @@ namespace OpenSim.Framework } } + public string CreatorData // = ; + { + get { return _creatorData; } + set { _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 (_creatorData != null && _creatorData != string.Empty) + return _creatorID.ToString() + ';' + _creatorData; + else + return _creatorID.ToString(); + } + set + { + if ((value == null) || (value != null && value == string.Empty)) + { + _creatorData = string.Empty; + return; + } + + if (!value.Contains(";")) // plain UUID + { + UUID uuid = UUID.Zero; + UUID.TryParse(value, out uuid); + _creatorID = uuid; + } + else // [;[;name]] + { + string name = "Unknown User"; + string[] parts = value.Split(';'); + if (parts.Length >= 1) + { + UUID uuid = UUID.Zero; + UUID.TryParse(parts[0], out uuid); + _creatorID = uuid; + } + if (parts.Length >= 2) + _creatorData = parts[1]; + if (parts.Length >= 3) + name = parts[2]; + + _creatorData += ';' + name; + + } + } + } + public string Description { get { return _description; -- cgit v1.1